Exact Bayesian Inference on Discrete Models via Probability Generating Functions: A Probabilistic Programming Approach
Fabian Zaiser, Andrzej S. Murawski, Chih-Hao Luke Ong
Abstract
We present an exact Bayesian inference method for discrete statistical models, which can find exact solutions to a large class of discrete inference problems, even with infinite support and continuous priors. To express such models, we introduce a probabilistic programming language that supports discrete and continuous sampling, discrete observations, affine functions, (stochastic) branching, and conditioning on discrete events. Our key tool is probability generating functions: they provide a compact closed-form representation of distributions that are definable by programs, thus enabling the exact computation of posterior probabilities, expectation, variance, and higher moments. Our inference method is provably correct and fully automated in a tool called Genfer, which uses automatic differentiation (specifically, Taylor polynomials), but does not require computer algebra. Our experiments show that Genfer is often faster than the existing exact inference tools PSI, Dice, and Prodigy. On a range of real-world inference problems that none of these exact tools can solve, Genfer's performance is competitive with approximate Monte Carlo methods, while avoiding approximation errors.
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.
8 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
- Static Posterior Inference of Bayesian Probabilistic Programming via Polynomial Solving cites Exact Bayesian Inference for Loopy Probabilistic Programs using Generating Functions
- Static Posterior Inference of Bayesian Probabilistic Programming via Polynomial Solving cites SPPL: probabilistic programming with fast exact symbolic inference
- Guaranteed Bounds on Posterior Distributions of Discrete Probabilistic Programs with Loops cites Static Posterior Inference of Bayesian Probabilistic Programming via Polynomial Solving
- Guaranteed Bounds on Posterior Distributions of Discrete Probabilistic Programs with Loops cites Scaling exact inference for discrete probabilistic programs
- Guaranteed Bounds on Posterior Distributions of Discrete Probabilistic Programs with Loops cites Exact Bayesian Inference for Loopy Probabilistic Programs using Generating Functions
- Guaranteed Bounds on Posterior Distributions of Discrete Probabilistic Programs with Loops cites SPPL: probabilistic programming with fast exact symbolic inference
- Does a Program Yield the Right Distribution? - Verifying Probabilistic Programs via Generating Functions cites Scaling exact inference for discrete probabilistic programs
- Exact Bayesian Inference for Loopy Probabilistic Programs using Generating Functions cites Scaling exact inference for discrete probabilistic programs
- Exact Bayesian Inference for Loopy Probabilistic Programs using Generating Functions cites Does a Program Yield the Right Distribution? - Verifying Probabilistic Programs via Generating Functions
- 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
- Total Variation Distance Meets Probabilistic Inference cites SPPL: probabilistic programming with fast exact symbolic inference
Cited by top-tier papers8
- Static Posterior Inference of Bayesian Probabilistic Programming via Polynomial SolvingPeixin Wang, Tengshun Yang, Hongfei Fu, Guanyan Li et al.PLDI 2024 · 13 citations
- Exact Bayesian Inference for Loopy Probabilistic Programs using Generating FunctionsLutz Klinkenberg, Christian Blumenthal, Mingshuai Chen, Darion Haase et al.OOPSLA 2024 · 11 citations
- Total Variation Distance Meets Probabilistic InferenceArnab Bhattacharyya, Sutanu Gayen, Kuldeep S. Meel, Dimitrios Myrisiotis et al.ICML 2024 · 10 citations
- Guaranteed Bounds on Posterior Distributions of Discrete Probabilistic Programs with LoopsFabian Zaiser, Andrzej S. Murawski, C.-H. Luke OngPOPL 2025 · 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
Builds on4
- 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
- Does a Program Yield the Right Distribution? - Verifying Probabilistic Programs via Generating FunctionsMingshuai Chen, Joost-Pieter Katoen, Lutz Klinkenberg, Tobias WinklerCAV 2022 · 14 citations
- Probabilistic Generating CircuitsHonghua Zhang, Brendan Juba, Guy Van den BroeckICML 2021 · 5 citations
Related papers
- λPSI: exact inference for higher-order probabilistic programsTimon Gehr, Samuel Steffen, Martin T. VechevPLDI 2020 · 29 citations
- Type-Directed Discretization of Probabilistic ProgramsKatherine Wu, Jules Jacobs, Kevin Batz, Alexandra SilvaOOPSLA 2026
- Exact Recursive Probabilistic ProgrammingDavid Chiang, Colin McDonald, Chung-chieh ShanOOPSLA 2023 · 12 citations
- Probabilistic Programming with Stochastic ProbabilitiesAlexander K. Lew, Matin Ghavamizadeh, Martin C. Rinard, Vikash K. MansinghkaPLDI 2023 · 9 citations
- Probabilistic Programming with Vectorized Programmable InferenceMcCoy R. Becker, Mathieu Huot, George Matheos, Xiaoyan Wang et al.POPL 2026 · 1 citation
