paperbot · PL 论文追踪

全部论文 待读 收藏

P2 ADEV: Sound Automatic Differentiation of Expected Values of Probabilistic Programs

ADEV:概率程序期望值的健全自动微分
POPL 7(POPL)2023匹配度 4/10 · 论文属于概率编程与自动微分的 PL 工作,形式化证明和原型实现扎实,但与用户核心关注的静态分析/Agentic/LLM 交叉、浮点程序分析、贝叶斯程序分析均无直接关联;仅在“概率程序/期望优化”层面与贝叶斯推断有间接联系。引用 16 inbox
Alexander K. Lew, Mathieu Huot, Sam Staton, Vikash K. Mansinghka
crossref: 2026-09-10

AI 速览

一句话:提出 ADEV,将前向自动微分扩展到概率程序,使变换后程序的期望值等于原程序期望的梯度。

随机过程期望值的优化在人工智能、运筹学和统计计算中十分常见,但面向确定性程序的自动微分通常不能正确计算概率程序所需的梯度。本文提出 ADEV,一种对前向模式自动微分的扩展,用于对含随机选择的程序所表示的随机过程期望值进行正确微分。ADEV 是作用于支持离散与连续概率分布的高阶概率语言的源到源变换,其输出仍是一个概率程序,且该程序的期望返回值正是原程序期望的导数。该输出程序可运行以产生无偏蒙特卡洛梯度估计,并可用于随机梯度下降内循环。作者通过源程序与目标程序指称上的逻辑关系证明 ADEV 的正确性,并利用其模块化扩展前向 AD 的特点,用数十行 Haskell 实现了原型。

问题
如何为以程序表示的随机过程自动且正确地计算其期望值关于参数的梯度,以支持基于梯度的随机优化?
方法
ADEV 在前向模式 AD 基础上做源到源变换,作用于含离散与连续分布的高阶概率语言,输出一个新的概率程序,使其期望返回值等于原程序期望的导数。
评估
作者使用源程序与目标程序指称上的逻辑关系证明变换的正确性,并给出数十行 Haskell 原型,通过蒙特卡洛采样生成可用于随机梯度下降的无偏梯度估计。
原文摘要(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, that can 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).

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@article{paperbot2074,
  title = {ADEV: Sound Automatic Differentiation of Expected Values of Probabilistic Programs},
  author = {Alexander K. Lew and Mathieu Huot and Sam Staton and Vikash K. Mansinghka},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {7},
  number = {POPL},
  year = {2023},
  doi = {10.1145/3571198}
}