Compiling Stan to generative probabilistic languages and extension to deep probabilistic programming
Guillaume Baudart, Javier Burroni, Martin Hirzel, Louis Mandel, Avraham Shinnar
Abstract
Stan is a probabilistic programming language that is popular in the statistics community, with a high-level syntax for expressing probabilistic models. Stan differs by nature from generative probabilistic programming languages like Church, Anglican, or Pyro. This paper presents a comprehensive compilation scheme to compile any Stan model to a generative language and proves its correctness. We use our compilation scheme to build two new backends for the Stanc3 compiler targeting Pyro and NumPyro. Experimental results show that the NumPyro backend yields a 2.3x speedup compared to Stan in geometric mean over 26 benchmarks. Building on Pyro we extend Stan with support for explicit variational inference guides and deep probabilistic models. That way, users familiar with Stan get access to new features without having to learn a fundamentally new language.
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 ae0e92fc-9eec-4f67-8c10-6d5ef3d73ff2Cited by top-tier papers5
- Foundation Posteriors for Approximate Probabilistic InferenceMike Wu, Noah D. GoodmanNeurIPS 2022 · 9 citations
- Automatically marginalized MCMC in probabilistic programmingJinlin Lai, Javier Burroni, Hui Guan, Daniel SheldonICML 2023 · 4 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
- PPDL: LLM-Based Flows as Probabilistic ProgramsLouis Mandel, Guillaume Baudart, Mandana Vaziri, Martin HirzelICML 2026
- Optimising Density Computations in Probabilistic Programs via Automatic Loop VectorisationSangho Lim, Hyoungjin Lim, Wonyeol Lee, Xavier Rival et al.POPL 2026
Builds on1
Related papers
- Sound probabilistic inference via guide typesDi Wang, Jan Hoffmann, Thomas W. RepsPLDI 2021 · 9 citations
- ProbFlow : Using Probabilistic Programming in Anonymous Communication NetworksHussein Darir, Geir E. Dullerud, Nikita BorisovNDSS 2023
- Probabilistic Programming with Vectorized Programmable InferenceMcCoy R. Becker, Mathieu Huot, George Matheos, Xiaoyan Wang et al.POPL 2026 · 1 citation
- Verified Density Compilation for a Probabilistic Programming LanguageJoseph Tassarotti, Jean-Baptiste TristanPLDI 2023 · 6 citations
- Static Factorisation of Probabilistic Programs with User-Labelled Sample Statements and While LoopsMarkus Böck, Jürgen CitoOOPSLA 2026 · 1 citation
