一句话:提出以组合式程序变换支持可编程变分推断,将变分目标写成程序并自动变换为无偏梯度估计器。
现代概率编程语言(PPL)对蒙特卡洛方法支持丰富,但对变分推断(VI)的支持较为薄弱:用户通常只能从预定义的变分目标与梯度估计器中挑选,且这些实现是后端单体式的,缺乏形式化正确性论证。本文提出一种更模块化的 VI 支持方式,核心是基于组合式程序变换:变分目标被表达为程序,可使用一等的构造来计算用户定义模型与变分族下的密度与期望值;随后系统系统性地将这些程序变换为无偏梯度估计器,用于优化目标。该设计使自动微分、密度累加、trace 与无偏梯度估计策略等多个相互交织的关注点可以模块化推理。相比现有 PPL 的 VI 支持,它在三方面提升表达力:开放式用户自定义变分目标、组合式梯度估计策略空间、以及支持近似边缘化与归一化构造从而覆盖更广的模型与变分族。作者在 Gen 系统上以 JAX 实现扩展 genjax.vi,并在若干深度生成建模任务上评估,性能开销相对手写实现极小,与主流开源 PPL 相比具有竞争力。
Compared to the wide array of advanced Monte Carlo methods supported by modern probabilistic programming languages (PPLs), PPL support for variational inference (VI) is less developed: users are typically limited to a predefined selection of variational objectives and gradient estimators, which are implemented monolithically (and without formal correctness arguments) in PPL backends. In this paper, we propose a more modular approach to supporting variational inference in PPLs, based on compositional program transformation. In our approach, variational objectives are expressed as programs, that may employ first-class constructs for computing densities of and expected values under user-defined models and variational families. We then transform these programs systematically into unbiased gradient estimators for optimizing the objectives they define. Our design enables modular reasoning about many interacting concerns, including automatic differentiation, density accumulation, tracing, and the application of unbiased gradient estimation strategies. Additionally, relative to existing support for VI in PPLs, our design increases expressiveness along three axes: (1) it supports an open-ended set of user-defined variational objectives, rather than a fixed menu of options; (2) it supports a combinatorial space of gradient estimation strategies, many not automated by today’s PPLs; and (3) it supports a broader class of models and variational families, because it supports constructs for approximate marginalization and normalization (previously introduced only for Monte Carlo inference). We implement our approach in an extension to the Gen probabilistic programming system (genjax.vi, implemented inJAX), and evaluate our automation on several deep generative modeling tasks, showing minimal performance overhead vs. hand-coded implementations and performance competitive with well-established open-source PPLs.
DOI 原文 · arXiv · PDF(开放获取) · DBLP
@article{BeckerLWGHRM24,
title = {Probabilistic Programming with Programmable Variational Inference},
author = {McCoy R. Becker and Alexander K. Lew and Xiaoyan Wang and Matin Ghavami and Mathieu Huot and Martin C. Rinard and Vikash K. Mansinghka},
journal = {Proceedings of the ACM on Programming Languages},
volume = {8},
number = {PLDI},
year = {2024},
doi = {10.1145/3656463}
}