Probabilistic Programming with Stochastic Probabilities

We present a new approach to the design and implementation of probabilistic programming languages (PPLs), based on the idea of stochastically estimating the probability density ratios necessary for probabilistic inference. By relaxing the usual PPL design constraint that these densities be compute...

Full description

Bibliographic Details
Main Authors: Lew, Alexander K., Ghavamizadeh, Matin, Rinard, Martin C., Mansinghka, Vikash K.
Other Authors: Massachusetts Institute of Technology. Computer Science and Artificial Intelligence Laboratory
Format: Article
Language:English
Published: ACM 2023
Online Access:https://hdl.handle.net/1721.1/151094
_version_ 1826204262322929664
author Lew, Alexander K.
Ghavamizadeh, Matin
Rinard, Martin C.
Mansinghka, Vikash K.
author2 Massachusetts Institute of Technology. Computer Science and Artificial Intelligence Laboratory
author_facet Massachusetts Institute of Technology. Computer Science and Artificial Intelligence Laboratory
Lew, Alexander K.
Ghavamizadeh, Matin
Rinard, Martin C.
Mansinghka, Vikash K.
author_sort Lew, Alexander K.
collection MIT
description We present a new approach to the design and implementation of probabilistic programming languages (PPLs), based on the idea of stochastically estimating the probability density ratios necessary for probabilistic inference. By relaxing the usual PPL design constraint that these densities be computed exactly, we are able to eliminate many common restrictions in current PPLs, to deliver a language that, for the first time, simultaneously supports first-class constructs for marginalization and nested inference, unrestricted stochastic control flow, continuous and discrete sampling, and programmable inference with custom proposals. At the heart of our approach is a new technique for compiling these expressive probabilistic programs into randomized algorithms for unbiasedly estimating their densities and density reciprocals. We employ these stochastic probability estimators within modified Monte Carlo inference algorithms that are guaranteed to be sound despite their reliance on inexact estimates of density ratios. We establish the correctness of our compiler using logical relations over the semantics of ������ , a new core calculus for modeling and inference with stochastic probabilities. We also implement our approach in an open-source extension to Gen, called GenSP, and evaluate it on six challenging inference problems adapted from the modeling and inference literature. We find that: (1) GenSP can automate fast density estimators for programs with very expensive exact densities; (2) convergence of inference is mostly unaffected by the noise from these estimators; and (3) our sound-by-construction estimators are competitive with hand-coded density estimators, incurring only a small constant-factor overhead.
first_indexed 2024-09-23T12:51:30Z
format Article
id mit-1721.1/151094
institution Massachusetts Institute of Technology
language English
last_indexed 2024-09-23T12:51:30Z
publishDate 2023
publisher ACM
record_format dspace
spelling mit-1721.1/1510942024-01-31T18:59:46Z Probabilistic Programming with Stochastic Probabilities Lew, Alexander K. Ghavamizadeh, Matin Rinard, Martin C. Mansinghka, Vikash K. Massachusetts Institute of Technology. Computer Science and Artificial Intelligence Laboratory Massachusetts Institute of Technology. Department of Brain and Cognitive Sciences We present a new approach to the design and implementation of probabilistic programming languages (PPLs), based on the idea of stochastically estimating the probability density ratios necessary for probabilistic inference. By relaxing the usual PPL design constraint that these densities be computed exactly, we are able to eliminate many common restrictions in current PPLs, to deliver a language that, for the first time, simultaneously supports first-class constructs for marginalization and nested inference, unrestricted stochastic control flow, continuous and discrete sampling, and programmable inference with custom proposals. At the heart of our approach is a new technique for compiling these expressive probabilistic programs into randomized algorithms for unbiasedly estimating their densities and density reciprocals. We employ these stochastic probability estimators within modified Monte Carlo inference algorithms that are guaranteed to be sound despite their reliance on inexact estimates of density ratios. We establish the correctness of our compiler using logical relations over the semantics of ������ , a new core calculus for modeling and inference with stochastic probabilities. We also implement our approach in an open-source extension to Gen, called GenSP, and evaluate it on six challenging inference problems adapted from the modeling and inference literature. We find that: (1) GenSP can automate fast density estimators for programs with very expensive exact densities; (2) convergence of inference is mostly unaffected by the noise from these estimators; and (3) our sound-by-construction estimators are competitive with hand-coded density estimators, incurring only a small constant-factor overhead. 2023-07-11T18:59:43Z 2023-07-11T18:59:43Z 2023-06-06 2023-07-01T07:55:52Z Article http://purl.org/eprint/type/JournalArticle 2475-1421 https://hdl.handle.net/1721.1/151094 Lew, Alexander K., Ghavamizadeh, Matin, Rinard, Martin C. and Mansinghka, Vikash K. 2023. "Probabilistic Programming with Stochastic Probabilities." Proceedings of the ACM on Programming Languages, 7 (PLDI). PUBLISHER_CC en https://doi.org/10.1145/3591290 Proceedings of the ACM on Programming Languages Creative Commons Attribution https://creativecommons.org/licenses/by/4.0/ The author(s) application/pdf ACM Association for Computing Machinery
spellingShingle Lew, Alexander K.
Ghavamizadeh, Matin
Rinard, Martin C.
Mansinghka, Vikash K.
Probabilistic Programming with Stochastic Probabilities
title Probabilistic Programming with Stochastic Probabilities
title_full Probabilistic Programming with Stochastic Probabilities
title_fullStr Probabilistic Programming with Stochastic Probabilities
title_full_unstemmed Probabilistic Programming with Stochastic Probabilities
title_short Probabilistic Programming with Stochastic Probabilities
title_sort probabilistic programming with stochastic probabilities
url https://hdl.handle.net/1721.1/151094
work_keys_str_mv AT lewalexanderk probabilisticprogrammingwithstochasticprobabilities
AT ghavamizadehmatin probabilisticprogrammingwithstochasticprobabilities
AT rinardmartinc probabilisticprogrammingwithstochasticprobabilities
AT mansinghkavikashk probabilisticprogrammingwithstochasticprobabilities