Affine Monads and Lazy Structures for Bayesian Programming
Swaraj Dash, Younesse Kaddar, Hugo Paquet, Sam Staton
Abstract
We show that streams and lazy data structures are a natural idiom for programming with infinite-dimensional Bayesian methods such as Poisson processes, Gaussian processes, jump processes, Dirichlet processes, and Beta processes. The crucial semantic idea, inspired by developments in synthetic probability theory, is to work with two separate monads: an affine monad of probability, which supports laziness, and a commutative, non-affine monad of measures, which does not. (Affine means that T (1)≅ 1.) We show that the separation is important from a decidability perspective, and that the recent model of quasi-Borel spaces supports these two monads. To perform Bayesian inference with these examples, we introduce new inference methods that are specially adapted to laziness; they are proven correct by reference to the Metropolis-Hastings-Green method. Our theoretical development is implemented as a Haskell library, LazyPPL.
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 99babff4-a691-4e07-ac6a-28b5028e401dCited by top-tier papers8
- Probabilistic Programming Interfaces for Random Graphs: Markov Categories, Graphons, and Nominal SetsNathanael L. Ackerman, Cameron E. Freer, Younesse Kaddar, Jacek Karwowski et al.POPL 2024 · 3 citations
- Compositional Imprecise Probability: A Solution from Graded Monads and Markov CategoriesJack Liell-Cock, Sam StatonPOPL 2025 · 3 citations
- Element-free probability distributions and random partitionsVictor Blanchi, Hugo PaquetLICS 2024
- Incremental Computation for Efficient Programmable Inference in Probabilistic ProgramsFabian Zaiser, Jack Czenszak, Martin C. Rinard, Vikash K. Mansinghka et al.PLDI 2026
- Outsourced Diffusion Sampling: Efficient Posterior Inference in Latent Spaces of Generative ModelsSiddarth Venkatraman, Mohsin Hasan, Minsu Kim, Luca Scimeca et al.ICML 2025
Builds on2
- 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
- Compositional Semantics for Probabilistic Programs with Exact ConditioningDario Stein, Sam StatonLICS 2021 · 18 citations
Related papers
- A Convenient Fibration for Dependently-Typed Probability TheoryDanel Ahman, Ohad Kammar, Rasmus Ejlers MøgelbergLICS 2026
- Monoidal Streams for Dataflow ProgrammingElena Di Lavore, Giovanni de Felice, Mario RománLICS 2022 · 10 citations
- Commutative Monads for Probabilistic Programming LanguagesXiaodong Jia, Bert Lindenhovius, Michael W. Mislove, Vladimir ZamdzhievLICS 2021 · 19 citations
- Bayesian Separation Logic: A Logical Foundation and Axiomatic Semantics for Probabilistic ProgrammingShing Hin Ho, Nicolas Wu, Azalea RaadPOPL 2026 · 2 citations
- PλωNK: functional probabilistic NetKATAlexander Vandenbroucke, Tom SchrijversPOPL 2020 · 2 citations
