Probabilistic Programming with Stochastic Probabilities
Alexander K. Lew, Matin Ghavamizadeh, Martin C. Rinard, Vikash K. Mansinghka
Abstract
We present a new approach to the design and implementation of probabilistic programming languages (PPLs), based on the idea of stochastically estimating the probability density ratios necessary for probabilistic inference. By relaxing the usual PPL design constraint that these densities be computed exactly, we are able to eliminate many common restrictions in current PPLs, to deliver a language that, for the first time, simultaneously supports first-class constructs for marginalization and nested inference, unrestricted stochastic control flow, continuous and discrete sampling, and programmable inference with custom proposals. At the heart of our approach is a new technique for compiling these expressive probabilistic programs into randomized algorithms for unbiasedly estimating their densities and density reciprocals. We employ these stochastic probability estimators within modified Monte Carlo inference algorithms that are guaranteed to be sound despite their reliance on inexact estimates of density ratios. We establish the correctness of our compiler using logical relations over the semantics of 𝜆 𝑆𝑃 , a new core calculus for modeling and inference with stochastic probabilities. We also implement our approach in an open-source extension to Gen, called GenSP, and evaluate it on six challenging inference problems adapted from the modeling and inference literature. We find that: (1) GenSP can automate fast density estimators for programs with very expensive exact densities; (2) convergence of inference is mostly unaffected by the noise from these estimators; and (3) our sound-by-construction estimators are competitive with hand-coded density estimators, incurring only a small constant-factor overhead.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
6 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Probabilistic Programming with Programmable Variational Inference cites Trace types and denotational semantics for sound programmable inference in probabilistic languages
- Probabilistic Programming with Vectorized Programmable Inference cites Probabilistic Programming with Programmable Variational Inference
- Probabilistic Programming with Vectorized Programmable Inference cites Online Bayesian Goal Inference for Boundedly Rational Planning Agents
- Probabilistic Programming with Vectorized Programmable Inference cites 3DP3: 3D Scene Perception via Probabilistic Programming
- Probabilistic Programming with Vectorized Programmable Inference cites Trace types and denotational semantics for sound programmable inference in probabilistic languages
- Probabilistic Programming with Vectorized Programmable Inference cites GenSQL: A Probabilistic Programming System for Querying Generative Models of Database Tables
- Compiling Probabilistic Programs for Variable Elimination with Information Flow cites Scaling exact inference for discrete probabilistic programs
- Compiling Probabilistic Programs for Variable Elimination with Information Flow cites SPPL: probabilistic programming with fast exact symbolic inference
- GenSQL: A Probabilistic Programming System for Querying Generative Models of Database Tables cites Scaling exact inference for discrete probabilistic programs
- GenSQL: A Probabilistic Programming System for Querying Generative Models of Database Tables cites SPPL: probabilistic programming with fast exact symbolic inference
- Scaling Optimization over Uncertainty via Compilation cites Scaling exact inference for discrete probabilistic programs
- Scaling Optimization over Uncertainty via Compilation cites SPPL: probabilistic programming with fast exact symbolic inference
- SPPL: probabilistic programming with fast exact symbolic inference cites Trace types and denotational semantics for sound programmable inference in probabilistic languages
Cited by top-tier papers6
- Probabilistic Programming with Programmable Variational InferenceMcCoy R. Becker, Alexander K. Lew, Xiaoyan Wang, Matin Ghavami et al.PLDI 2024 · 8 citations
- Compiling Probabilistic Programs for Variable Elimination with Information FlowJianlin Li, Eric Wang, Yizhou ZhangPLDI 2024 · 6 citations
- GenSQL: A Probabilistic Programming System for Querying Generative Models of Database TablesMathieu Huot, Matin Ghavami, Alexander K. Lew, Ulrich Schaechtle et al.PLDI 2024 · 6 citations
- Probabilistic Programming with Vectorized Programmable InferenceMcCoy R. Becker, Mathieu Huot, George Matheos, Xiaoyan Wang et al.POPL 2026 · 1 citation
- Scaling Optimization over Uncertainty via CompilationMinsung Cho, John Gouwar, Steven HoltzenOOPSLA 2025 · 1 citation
Builds on11
- Online Bayesian Goal Inference for Boundedly Rational Planning AgentsTan Zhi-Xuan, Jordyn L. Mann, Tom Silver, Josh Tenenbaum et al.NeurIPS 2020 · 122 citations
- Scaling exact inference for discrete probabilistic programsSteven Holtzen, Guy Van den Broeck, Todd D. MillsteinOOPSLA 2020 · 85 citations
- 3DP3: 3D Scene Perception via Probabilistic ProgrammingNishad Gothoskar, Marco F. Cusumano-Towner, Ben Zinberg, Matin Ghavamizadeh et al.NeurIPS 2021 · 59 citations
- SPPL: probabilistic programming with fast exact symbolic inferenceFeras A. Saad, Martin C. Rinard, Vikash K. MansinghkaPLDI 2021 · 38 citations
- 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
Related papers
- Nonparametric Hamiltonian Monte CarloCarol Mak, Fabian Zaiser, Luke OngICML 2021 · 7 citations
- Incremental Computation for Efficient Programmable Inference in Probabilistic ProgramsFabian Zaiser, Jack Czenszak, Martin C. Rinard, Vikash K. Mansinghka et al.PLDI 2026
- Programmable MCMC with Soundly Composed Guide ProgramsLong Pham, Di Wang, Feras A. Saad, Jan HoffmannOOPSLA 2024 · 1 citation
- Exact Bayesian Inference on Discrete Models via Probability Generating Functions: A Probabilistic Programming ApproachFabian Zaiser, Andrzej S. Murawski, Chih-Hao Luke OngNeurIPS 2023 · 17 citations
- Reasoning about "reasoning about reasoning": semantics and contextual equivalence for probabilistic programs with nested queries and recursionYizhou Zhang, Nada AminPOPL 2022 · 20 citations
