Towards verified stochastic variational inference for probabilistic programs
Wonyeol Lee, Hangyeol Yu, Xavier Rival, Hongseok Yang
Abstract
Probabilistic programming is the idea of writing models from statistics and machine learning using program notations and reasoning about these models using generic inference engines. Recently its combination with deep learning has been explored intensely, which led to the development of so called deep probabilistic programming languages, such as Pyro, Edward and ProbTorch. At the core of this development lie inference engines based on stochastic variational inference algorithms. When asked to find information about the posterior distribution of a model written in such a language, these algorithms convert this posterior-inference query into an optimisation problem and solve it approximately by a form of gradient ascent or descent. In this paper, we analyse one of the most fundamental and versatile variational inference algorithms, called score estimator or REINFORCE, using tools from denotational semantics and program analysis. We formally express what this algorithm does on models denoted by programs, and expose implicit assumptions made by the algorithm on the models. The violation of these assumptions may lead to an undefined optimisation objective or the loss of convergence guarantee of the optimisation process. We then describe rules for proving these assumptions, which can be automated by static program analyses. Some of our rules use nontrivial facts from continuous mathematics, and let us replace requirements about integrals in the assumptions, such as integrability of functions defined in terms of programs' denotations, by conditions involving differentiation or boundedness, which are much easier to prove automatically (and manually). Following our general methodology, we have developed a static program analysis for the Pyro programming language that aims at discharging the assumption about what we call model-guide support match. Our analysis is applied to the eight representative model-guide pairs from the Pyro webpage, which include sophisticated neural network models such as AIR. It finds a bug in one of these cases, reveals a non-standard use of an inference engine in another, and shows that the assumptions are met in the remaining six cases.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 977282c9-51eb-49ed-9eb4-124cfc02b478Cited by top-tier papers15
- Trace types and denotational semantics for sound programmable inference in probabilistic languagesAlexander K. Lew, Marco F. Cusumano-Towner, Benjamin Sherman, Michael Carbin et al.POPL 2020 · 30 citations
- Learning Probabilistic Termination ProofsAlessandro Abate, Mirco Giacobbe, Diptarko RoyCAV 2021 · 26 citations
- ADEV: Sound Automatic Differentiation of Expected Values of Probabilistic ProgramsAlexander K. Lew, Mathieu Huot, Sam Staton, Vikash K. MansinghkaPOPL 2023 · 16 citations
- Static Posterior Inference of Bayesian Probabilistic Programming via Polynomial SolvingPeixin Wang, Tengshun Yang, Hongfei Fu, Guanyan Li et al.PLDI 2024 · 13 citations
- Compiling Stan to generative probabilistic languages and extension to deep probabilistic programmingGuillaume Baudart, Javier Burroni, Martin Hirzel, Louis Mandel et al.PLDI 2021 · 13 citations
Related papers
- Marginalized Stochastic Natural Gradients for Black-Box Variational InferenceGeng Ji, Debora Sujono, Erik B. SudderthICML 2021 · 9 citations
- Smoothness Analysis for Probabilistic Programs with Application to Optimised Variational InferenceWonyeol Lee, Xavier Rival, Hongseok YangPOPL 2023 · 8 citations
- Static Factorisation of Probabilistic Programs with User-Labelled Sample Statements and While LoopsMarkus Böck, Jürgen CitoOOPSLA 2026 · 1 citation
- Foundation Posteriors for Approximate Probabilistic InferenceMike Wu, Noah D. GoodmanNeurIPS 2022 · 9 citations
- Sound probabilistic inference via guide typesDi Wang, Jan Hoffmann, Thomas W. RepsPLDI 2021 · 9 citations
