skip to main content
research-article
Open access

A pre-expectation calculus for probabilistic sensitivity

Published: 04 January 2021 Publication History

Abstract

Sensitivity properties describe how changes to the input of a program affect the output, typically by upper bounding the distance between the outputs of two runs by a monotone function of the distance between the corresponding inputs. When programs are probabilistic, the distance between outputs is a distance between distributions. The Kantorovich lifting provides a general way of defining a distance between distributions by lifting the distance of the underlying sample space; by choosing an appropriate distance on the base space, one can recover other usual probabilistic distances, such as the Total Variation distance. We develop a relational pre-expectation calculus to upper bound the Kantorovich distance between two executions of a probabilistic program. We illustrate our methods by proving algorithmic stability of a machine learning algorithm, convergence of a reinforcement learning algorithm, and fast mixing for card shuffling algorithms. We also consider some extensions: using our calculus to show convergence of Markov chains to the uniform distribution over states and an asynchronous extension to reason about pairs of program executions with different control flow.

References

[1]
David Aldous. 1983. Random Walks on Finite Groups and Rapidly Mixing Markov Chains. In Séminaire de Probabilités XVII 1981/82 (Lecture Notes in Mathematics, Vol. 986 ). Springer-Verlag, 243-297. https://eudml.org/doc/113445
[2]
Philip Amortila, Doina Precup, Prakash Panangaden, and Marc G. Bellemare. 2020. A Distributional Analysis of SamplingBased Reinforcement Learning Algorithms. In The 23rd International Conference on Artificial Intelligence and Statistics, AISTATS 2020, 26-28 August 2020, Online [Palermo, Sicily, Italy] (Proceedings of Machine Learning Research, Vol. 108 ), Silvia Chiappa and Roberto Calandra (Eds.). PMLR, 4357-4366. http://proceedings.mlr.press/v108/amortila20a.html
[3]
Robert B. Ash and Catherine A. Doleans-Dade. 2000. Probability and Measure Theory. Academic Press.
[4]
Arthur Azevedo de Amorim, Marco Gaboardi, Emilio Jesús Gallego Arias, and Justin Hsu. 2014. Really natural linear indexed type-checking. In Symposium on Implementation and Application of Functional Programming Languages (IFL), Boston, Massachusetts. ACM Press, 5 : 1-5 : 12. https://doi.org/10.1145/2746325.2746335
[5]
Arthur Azevedo de Amorim, Marco Gaboardi, Justin Hsu, Shin-ya Katsumata, and Ikram Cherigui. 2017. A semantic account of metric preservation. In ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL), Paris, France. 545-556. https://doi.org/10.1145/3009837.3009890
[6]
Giorgio Bacci, Radu Mardare, Prakash Panangaden, and Gordon D. Plotkin. 2018. An Algebraic Theory of Markov Processes. In Proceedings of the 33rd Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2018, Oxford, UK, July 09-12, 2018, Anuj Dawar and Erich Grädel (Eds.). ACM, 679-688. https://doi.org/10.1145/3209108.3209177
[7]
Gilles Barthe, Thomas Espitau, Benjamin Grégoire, Justin Hsu, and Pierre-Yves Strub. 2018. Proving expected sensitivity of probabilistic programs. PACMPL 2, POPL ( 2018 ), 57 : 1-57 : 29. https://doi.org/10.1145/3158145
[8]
Kevin Batz, Benjamin Lucien Kaminski, Joost-Pieter Katoen, Christoph Matheja, and Thomas Noll. 2019. Quantitative Separation Logic: A Logic for Reasoning About Probabilistic Pointer Programs. PACMPL 3, POPL ( 2019 ), 34 : 1-34 : 29. https://doi.org/10.1145/3290347
[9]
Kevin Batz, Benjamin Lucien Kaminski, Joost-Pieter Katoen, and Christoph Matheja. 2021. Relatively Complete Verification of Probabilistic Programs-An Expressive Language for Expectation-based Reasoning. Proc. ACM Program. Lang. 5, POPL ( 2021 ).
[10]
Nick Benton. 2004. Simple Relational Correctness Proofs for Static Analyses and Program Transformations. In ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL), Venice, Italy. 14-25. https://doi.org/10. 1145/964001.964003
[11]
Olivier Bousquet and André Elisseef. 2002. Stability and Generalization. Journal of Machine Learning Research 2 ( 2002 ), 499-526. http://www.jmlr.org/papers/v2/bousquet02a.html
[12]
Swarat Chaudhuri, Sumit Gulwani, and Roberto Lublinerman. 2010. Continuity analysis of programs. In ACM SIGPLANSIGACT Symposium on Principles of Programming Languages (POPL), Madrid, Spain. 57-70. https://doi.org/10.1145/ 1706299.1706308
[13]
Swarat Chaudhuri, Sumit Gulwani, and Roberto Lublinerman. 2012. Continuity and robustness of programs. Commun. ACM 55, 8 ( 2012 ), 107-115. https://doi.org/10.1145/2240236.2240262
[14]
Marco Gaboardi, Andreas Haeberlen, Justin Hsu, Arjun Narayan, and Benjamin C. Pierce. 2013. Linear dependent types for diferential privacy. In ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL), Rome, Italy. 357-370. https://doi.org/10.1145/2429069.2429113
[15]
Daniel Gebler, Kim G. Larsen, and Simone Tini. 2016. Compositional bisimulation metric reasoning with probabilistic process calculi. Logical Methods in Computer Science 12, 4 ( 2016 ). https://doi.org/10.2168/LMCS-12 ( 4 :12) 2016
[16]
Daniel Gebler and Simone Tini. 2018. SOS specifications for uniformly continuous operators. J. Comput. Syst. Sci. 92 ( 2018 ), 113-151. https://doi.org/10.1016/j.jcss. 2017. 09.011
[17]
Friedrich Gretz, Joost-Pieter Katoen, and Annabelle McIver. 2014. Operational versus weakest pre-expectation semantics for the probabilistic guarded command language. Perform. Evaluation 73 ( 2014 ), 110-132. https://doi.org/10.1016/j.peva. 2013. 11.004
[18]
Moritz Hardt, Ben Recht, and Yoram Singer. 2016. Train faster, generalize better: Stability of stochastic gradient descent. In International Conference on Machine Learning (ICML), New York, NY (Journal of Machine Learning Research, Vol. 48 ). JMLR.org, 1225-1234. http://jmlr.org/proceedings/papers/v48/hardt16.html
[19]
Zixin Huang, Zhenbang Wang, and Sasa Misailovic. 2018. PSense: Automatic Sensitivity Analysis for Probabilistic Programs. In Automated Technology for Verification and Analysis-16th International Symposium, ATVA 2018, Los Angeles, CA, USA, October 7-10, 2018, Proceedings (LNCS, Vol. 11138 ), Shuvendu K. Lahiri and Chao Wang (Eds.). Springer, 387-403. https://doi.org/10.1007/978-3-030-01090-4_23
[20]
Benjamin Lucien Kaminski and Joost-Pieter Katoen. 2017. A weakest pre-expectation semantics for mixed-sign expectations. In LICS. IEEE Computer Society, 1-12. https://doi.org/10.1109/LICS. 2017.8005153
[21]
Benjamin Lucien Kaminski, Joost-Pieter Katoen, Christoph Matheja, and Federico Olmedo. 2016. Weakest Precondition Reasoning for Expected Run-Times of Probabilistic Programs. In European Symposium on Programming (ESOP), Eindhoven, The Netherlands (Lecture Notes in Computer Science, Vol. 9632 ). Springer-Verlag, 364-389. https://doi.org/10.1007/978-3-662-49498-1_15
[22]
Dexter Kozen. 1985. A Probabilistic PDL. J. Comput. System Sci. 30, 2 ( 1985 ), 162-178. https://doi.org/10.1016/ 0022-0000 ( 85 ) 90012-1
[23]
Annabelle McIver and Carroll Morgan. 2005. Abstraction, Refinement and Proof for Probabilistic Systems. Springer.
[24]
Carroll Morgan, Annabelle McIver, and Karen Seidel. 1996. Probabilistic Predicate Transformers. ACM Transactions on Programming Languages and Systems 18, 3 ( 1996 ), 325-353.
[25]
Federico Olmedo, Friedrich Gretz, Nils Jansen, Benjamin Lucien Kaminski, Joost-Pieter Katoen, and Annabelle McIver. 2018. Conditioning in Probabilistic Programming. ACM Trans. Program. Lang. Syst. 40, 1 ( 2018 ), 4 : 1-4 : 50. https: //doi.org/10.1145/3156018
[26]
Federico Olmedo, Benjamin Lucien Kaminski, Joost-Pieter Katoen, and Christoph Matheja. 2016. Reasoning about Recursive Probabilistic Programs. In Proceedings of the 31st Annual ACM/IEEE Symposium on Logic in Computer Science, LICS ' 16, New York, NY, USA, July 5-8, 2016, Martin Grohe, Eric Koskinen, and Natarajan Shankar (Eds.). ACM, 672-681. https://doi.org/10.1145/2933575.2935317
[27]
David Park. 1969. Fixpoint Induction and Proofs of Program Properties. Machine Intelligence 5 ( 1969 ).
[28]
Benedetto Piccoli and Francesco Rossi. 2016. On Properties of the Generalized Wasserstein Distance. Archive for Rational Mechanics and Analysis 222, 3 ( 01 Dec 2016 ), 1339-1365. https://doi.org/10.1007/s00205-016-1026-7
[29]
Jason Reed and Benjamin C Pierce. 2010. Distance Makes the Types Grow Stronger: A Calculus for Diferential Privacy. In ACM SIGPLAN International Conference on Functional Programming (ICFP), Baltimore, Maryland. https://doi.org/10.1145/ 1863543.1863568
[30]
Richard S. Sutton. 1988. Learning to Predict by the Methods of Temporal Diferences. Mach. Learn. 3 ( 1988 ), 9-44. https://doi.org/10.1007/BF00115009
[31]
Cédric Villani. 2008. Optimal Transport: Old and New. Springer-Verlag.
[32]
Peixin Wang, Hongfei Fu, Krishnendu Chatterjee, Yuxin Deng, and Ming Xu. 2020. Proving expected sensitivity of probabilistic programs with randomized variable-dependent termination time. Proc. ACM Program. Lang. 4, POPL ( 2020 ), 25 : 1-25 : 30. https://doi.org/10.1145/3371093
[33]
Daniel Winograd-Cort, Andreas Haeberlen, Aaron Roth, and Benjamin C. Pierce. 2017. A framework for adaptive diferential privacy. In ACM SIGPLAN International Conference on Functional Programming (ICFP), Oxford, England. 10 : 1-10 : 29. https://doi.org/10.1145/3110254

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

Published In

cover image Proceedings of the ACM on Programming Languages
Proceedings of the ACM on Programming Languages  Volume 5, Issue POPL
January 2021
1789 pages
EISSN:2475-1421
DOI:10.1145/3445980
Issue’s Table of Contents
This work is licensed under a Creative Commons Attribution International 4.0 License.

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 04 January 2021
Published in PACMPL Volume 5, Issue POPL

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. probabilistic programming
  2. verification

Qualifiers

  • Research-article

Funding Sources

  • University of Wisconsin
  • National Science Foundation SaTC
  • National Science Foundation CCF
  • Facebook

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)248
  • Downloads (Last 6 weeks)37
Reflects downloads up to 09 Oct 2024

Other Metrics

Citations

Cited By

View all

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Get Access

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media