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