Lune

POPL2023Top-tier venue

ADEV: Sound Automatic Differentiation of Expected Values of Probabilistic Programs

Alexander K. Lew, Mathieu Huot, Sam Staton, Vikash K. Mansinghka

Abstract

Optimizing the expected values of probabilistic processes is a central problem in computer science and its applications, arising in fields ranging from artificial intelligence to operations research to statistical computing. Unfortunately, automatic differentiation techniques developed for deterministic programs do not in general compute the correct gradients needed for widely used solutions based on gradient-based optimization.

In this paper, we present ADEV, an extension to forward-mode AD that correctly differentiates the expectations of probabilistic processes represented as programs that make random choices. Our algorithm is a source-to-source program transformation on an expressive, higher-order language for probabilistic computation, with both discrete and continuous probability distributions. The result of our transformation is a new probabilistic program, whose expected return value is the derivative of the original program's expectation. This output program can be run to generate unbiased Monte Carlo estimates of the desired gradient, which can then be used within the inner loop of stochastic gradient descent. We prove ADEV correct using logical relations over the denotations of the source and target probabilistic programs. Because it modularly extends forward-mode AD, our algorithm lends itself to a concise implementation strategy, which we exploit to develop a prototype in just a few dozen lines of Haskell (https://github.com/probcomp/adev).

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.

9 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

  • Probabilistic Programming with Programmable Variational Inference cites Automatic Differentiation of Programs with Discrete Randomness
  • Probabilistic Programming with Programmable Variational Inference cites Trace types and denotational semantics for sound programmable inference in probabilistic languages
  • Probabilistic Programming with Programmable Variational Inference cites Probabilistic Programming with Stochastic Probabilities
  • ωPAP Spaces: Reasoning Denotationally About Higher-Order, Recursive Probabilistic and Differentiable Programs cites Automatic differentiation in PCF
  • ωPAP Spaces: Reasoning Denotationally About Higher-Order, Recursive Probabilistic and Differentiable Programs cites Trace types and denotational semantics for sound programmable inference in probabilistic languages
  • ωPAP Spaces: Reasoning Denotationally About Higher-Order, Recursive Probabilistic and Differentiable Programs cites On Correctness of Automatic Differentiation for Non-Differentiable Functions
  • Automatic differentiation in PCF cites A simple differentiable programming language
  • Automatic differentiation in PCF cites On Correctness of Automatic Differentiation for Non-Differentiable Functions
  • On Correctness of Automatic Differentiation for Non-Differentiable Functions cites A simple differentiable programming language
  • Probabilistic Programming with Stochastic Probabilities cites Trace types and denotational semantics for sound programmable inference in probabilistic languages
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers9

  1. Automatic Differentiation of Programs with Discrete RandomnessGaurav Arya, Moritz Schauer, Frank Schäfer, Christopher RackauckasNeurIPS 2022 · 56 citations
  2. Probabilistic Programming with Stochastic ProbabilitiesAlexander K. Lew, Matin Ghavamizadeh, Martin C. Rinard, Vikash K. MansinghkaPLDI 2023 · 9 citations
  3. Probabilistic Programming with Programmable Variational InferenceMcCoy R. Becker, Alexander K. Lew, Xiaoyan Wang, Matin Ghavami et al.PLDI 2024 · 8 citations
  4. Automated Efficient Estimation using Monte Carlo Efficient Influence FunctionsRaj Agrawal, Sam Witty, Andy Zane, Elias BinghamNeurIPS 2024 · 6 citations
  5. ωPAP Spaces: Reasoning Denotationally About Higher-Order, Recursive Probabilistic and Differentiable ProgramsMathieu Huot, Alexander K. Lew, Vikash K. Mansinghka, Sam StatonLICS 2023 · 5 citations

Builds on13

  1. Automatic Differentiation of Programs with Discrete RandomnessGaurav Arya, Moritz Schauer, Frank Schäfer, Christopher RackauckasNeurIPS 2022 · 56 citations
  2. On Correctness of Automatic Differentiation for Non-Differentiable FunctionsWonyeol Lee, Hangyeol Yu, Xavier Rival, Hongseok YangNeurIPS 2020 · 50 citations
  3. A simple differentiable programming languageMartín Abadi, Gordon D. PlotkinPOPL 2020 · 49 citations
  4. Automatic differentiation in PCFDamiano Mazza, Michele PaganiPOPL 2021 · 47 citations
  5. 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

Related papers

  1. GradInf: Gradient Estimation as Probabilistic InferenceGaurav Arya, Mathieu Huot, Moritz Schauer, Alexander K. Lew et al.PLDI 2026
  2. Storchastic: A Framework for General Stochastic Automatic DifferentiationEmile van Krieken, Jakub M. Tomczak, Annette ten TeijeNeurIPS 2021 · 19 citations
  3. Provably correct, asymptotically efficient, higher-order reverse-mode automatic differentiationFaustyna Krawiec, Simon Peyton Jones, Neel Krishnaswami, Tom Ellis et al.POPL 2022 · 27 citations
  4. Universal Semantics for the Stochastic λ-CalculusPedro H. Azevedo de Amorim, Dexter Kozen, Radu Mardare, Prakash Panangaden et al.LICS 2021 · 5 citations
  5. 𝜆ₛ: computable semantics for differentiable programming with higher-order functions and datatypesBenjamin Sherman, Jesse Michel, Michael CarbinPOPL 2021 · 11 citations
Dusk over the sea between two cliffs drawn in fine vertical lines