Lune

PLDI2021Top-tier venue

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 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.

5 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers5

  1. Foundation Posteriors for Approximate Probabilistic InferenceMike Wu, Noah D. GoodmanNeurIPS 2022 · 9 citations
  2. Automatically marginalized MCMC in probabilistic programmingJinlin Lai, Javier Burroni, Hui Guan, Daniel SheldonICML 2023 · 4 citations
  3. KEM-IND-CCA-Preserving Compilation of Jasmin's ML-KEMSantiago Arranz-Olmos, Gilles Barthe, Lionel Blatter, Benjamin Gregoire et al.CCS 2026 · 1 citation
  4. PPDL: LLM-Based Flows as Probabilistic ProgramsLouis Mandel, Guillaume Baudart, Mandana Vaziri, Martin HirzelICML 2026
  5. Optimising Density Computations in Probabilistic Programs via Automatic Loop VectorisationSangho Lim, Hyoungjin Lim, Wonyeol Lee, Xavier Rival et al.POPL 2026

Builds on1

  1. Towards verified stochastic variational inference for probabilistic programsWonyeol Lee, Hangyeol Yu, Xavier Rival, Hongseok YangPOPL 2020 · 22 citations

Related papers

  1. Sound probabilistic inference via guide typesDi Wang, Jan Hoffmann, Thomas W. RepsPLDI 2021 · 9 citations
  2. ProbFlow : Using Probabilistic Programming in Anonymous Communication NetworksHussein Darir, Geir E. Dullerud, Nikita BorisovNDSS 2023
  3. Probabilistic Programming with Vectorized Programmable InferenceMcCoy R. Becker, Mathieu Huot, George Matheos, Xiaoyan Wang et al.POPL 2026 · 1 citation
  4. Verified Density Compilation for a Probabilistic Programming LanguageJoseph Tassarotti, Jean-Baptiste TristanPLDI 2023 · 6 citations
  5. Static Factorisation of Probabilistic Programs with User-Labelled Sample Statements and While LoopsMarkus Böck, Jürgen CitoOOPSLA 2026 · 1 citation
Dusk over the sea between two cliffs drawn in fine vertical lines