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 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 90535e04-44c4-4b56-b8b5-a51cccb68e20Cited 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
