Incremental Computation for Efficient Programmable Inference in Probabilistic Programs
Fabian Zaiser, Jack Czenszak, Martin C. Rinard, Vikash K. Mansinghka, Alexander K. Lew
Abstract
Inference in probabilistic programs generally requires evaluating many possible program executions to find those of high posterior density. To scale inference to large datasets, it is crucial that expensive intermediate results are shared across these many evaluations, rather than recomputed from scratch. This paper presents a new approach to realizing this sharing, based on incremental computation , a technique for efficiently recomputing (deterministic) program outputs when program inputs change. First, we show how expressive probabilistic programs can be compiled to deterministic ones that compute their density functions. Then, building on the incremental λ -calculus, we develop a general technique for compositionally incrementalizing expressive functional programs, and apply it to these densities. The resulting incremental densities can be used to accelerate a broad range of Monte Carlo inference algorithms, including for nonparametric models not well supported by existing systems. Furthermore, our decomposition of incremental density computation into separate density and incrementalization steps allows for modular reasoning about correctness—a key pain point in existing systems, where ad-hoc incrementalization features are a known source of soundness bugs. We develop denotational logical relations arguments for the correctness of each step independently, and implement the approach in a Julia prototype, finding that it leads to asymptotic runtime improvements in the size of the dataset on a range of models and inference algorithms.
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 433bcbb9-52a2-4586-bba4-a88e4beddfd6Builds on11
- 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
- Towards verified stochastic variational inference for probabilistic programsWonyeol Lee, Hangyeol Yu, Xavier Rival, Hongseok YangPOPL 2020 · 22 citations
- Affine Monads and Lazy Structures for Bayesian ProgrammingSwaraj Dash, Younesse Kaddar, Hugo Paquet, Sam StatonPOPL 2023 · 12 citations
- Sound probabilistic inference via guide typesDi Wang, Jan Hoffmann, Thomas W. RepsPLDI 2021 · 9 citations
- Type-Preserving, Dependence-Aware Guide Generation for Sound, Effective Amortized Probabilistic InferenceJianlin Li, Leni Aniva, Pengyuan Shi, Yizhou ZhangPOPL 2023 · 7 citations
Related papers
- Probabilistic Programming with Stochastic ProbabilitiesAlexander K. Lew, Matin Ghavamizadeh, Martin C. Rinard, Vikash K. MansinghkaPLDI 2023 · 9 citations
- Nonparametric Hamiltonian Monte CarloCarol Mak, Fabian Zaiser, Luke OngICML 2021 · 7 citations
- DeCo: A Core Calculus for Incremental Functional Programming with Generic Data TypesTimon Böhler, Tobias Reinhard, David Richter, Mira MeziniOOPSLA 2026
- Incremental Inference for Probabilistic DatalogXuyang Li, Weiyi Chen, Isil Dillig, Jingbo WangCAV 2026
- ωPAP Spaces: Reasoning Denotationally About Higher-Order, Recursive Probabilistic and Differentiable ProgramsMathieu Huot, Alexander K. Lew, Vikash K. Mansinghka, Sam StatonLICS 2023 · 5 citations
