Compiling Probabilistic Programs for Variable Elimination with Information Flow
Abstract
A key promise of probabilistic programming is the ability to specify rich models using an expressive programming language. However, the expressive power that makes probabilistic programming languages enticing also poses challenges to inference, so much so that specialized approaches to inference ban language features such as recursion. We present an approach to variable elimination and marginal inference for probabilistic programs featuring bounded recursion, discrete distributions, and sometimes continuous distributions. A compiler eliminates probabilistic side effects, using a novel information-flow type system to factorize probabilistic computations and hoist independent subcomputations out of sums or integrals. For a broad class of recursive programs with dynamically recurring substructure, the compiler effectively decomposes a global marginal-inference problem, which may otherwise be intractable, into tractable subproblems. We prove the compilation correct by showing that it preserves denotational semantics. Experiments show that the compiled programs subsume widely used PTIME algorithms for recursive models and that the compilation time scales with the size of the inference problems. As a separate contribution, we develop a denotational, logical-relations model of information-flow types in the novel measure-theoretic setting of probabilistic programming; we use it to prove noninterference and consequently the correctness of variable elimination.
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.
3 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 Inference for Datalog with Correlated Inputs cites Scaling exact inference for discrete probabilistic programs
- Probabilistic Inference for Datalog with Correlated Inputs cites SPPL: probabilistic programming with fast exact symbolic inference
- GradInf: Gradient Estimation as Probabilistic Inference cites Scaling exact inference for discrete probabilistic programs
- GradInf: Gradient Estimation as Probabilistic Inference cites SPPL: probabilistic programming with fast exact symbolic inference
- Lilac: A Modal Separation Logic for Conditional Probability cites A probabilistic separation logic
- SPPL: probabilistic programming with fast exact symbolic inference cites λPSI: exact inference for higher-order probabilistic programs
Cited by top-tier papers3
- Probabilistic Inference for Datalog with Correlated InputsJingbo Wang, Shashin Halalingaiah, Weiyi Chen, Chao Wang et al.OOPSLA 2025 · 2 citations
- KEM-IND-CCA-Preserving Compilation of Jasmin's ML-KEMSantiago Arranz-Olmos, Gilles Barthe, Lionel Blatter, Benjamin Gregoire et al.CCS 2026 · 1 citation
- GradInf: Gradient Estimation as Probabilistic InferenceGaurav Arya, Mathieu Huot, Moritz Schauer, Alexander K. Lew et al.PLDI 2026
Builds on14
- Scaling exact inference for discrete probabilistic programsSteven Holtzen, Guy Van den Broeck, Todd D. MillsteinOOPSLA 2020 · 85 citations
- SPPL: probabilistic programming with fast exact symbolic inferenceFeras A. Saad, Martin C. Rinard, Vikash K. MansinghkaPLDI 2021 · 38 citations
- A probabilistic separation logicGilles Barthe, Justin Hsu, Kevin LiaoPOPL 2020 · 35 citations
- λPSI: exact inference for higher-order probabilistic programsTimon Gehr, Samuel Steffen, Martin T. VechevPLDI 2020 · 29 citations
- Lilac: A Modal Separation Logic for Conditional ProbabilityJohn M. Li, Amal Ahmed, Steven HoltzenPLDI 2023 · 22 citations
Related papers
- Exact Recursive Probabilistic ProgrammingDavid Chiang, Colin McDonald, Chung-chieh ShanOOPSLA 2023 · 12 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
- Sound probabilistic inference via guide typesDi Wang, Jan Hoffmann, Thomas W. RepsPLDI 2021 · 9 citations
- Higher Order Bayesian Networks, ExactlyClaudia Faggian, Daniele Pautasso, Gabriele VanoniPOPL 2024 · 4 citations
- Paradoxes of probabilistic programming: and how to condition on events of measure zero with infinitesimal probabilitiesJules JacobsPOPL 2021 · 7 citations
