arXiv:2607.07840cs.PLcs.LG2026-07

将梯度估计转化为概率推断,实现更高效精准的梯度计算。

GradInf: Gradient Estimation as Probabilistic Inference

  • 通过耦合与分解技术,将梯度问题转为可解的概率推断问题。
  • 在多个案例中生成的新估计器超越现有最优基线性能。
  • 适合需要高精度梯度的机器学习研究者和系统开发者。

梯度估计——计算概率程序期望值梯度的任务——在科学计算中有广泛应用,但因高维积分、离散随机选择和复杂随机依赖等问题而极具挑战。本文提出梯度推断,一种为概率程序设计可靠且高效的梯度估计器的新方法。该方法通过形式化地将梯度估计问题还原为一个密切相关的概率推断问题,其解可微分以获得梯度估计器。该推断问题通过对输入概率程序应用耦合与分解两种强大统计操作得到。这一还原使我们能够利用丰富的概率推断算法工具箱,设计出扩展并改进现有方法的新梯度估计器。我们提出了GradInf,一个支持梯度推断的编程系统,核心是针对高阶概率程序的可编程源到源变换,用于耦合与分解,其正确性基于指称语义证明。关键在于使用信息流类型系统,实现对概率程序中随机选择的分解与部分求值,从而提升复杂概率推断算法的部署能力。该系统为设计梯度估计器提供了原则性框架。我们在多个具有挑战性的案例研究中应用GradInf,表明它不仅能表达文献中的著名梯度估计器,还能构建出优于现有最佳基线的新型前沿估计器。

原文摘要 · Abstract (English)

Gradient estimation -- the task of computing the gradient of the expected value of a probabilistic program -- has diverse applications in scientific computing, but is notoriously difficult because of issues such as high-dimensional integration, discrete random choices, and complex stochastic dependencies. This article introduces gradient inference, a new approach to developing sound and efficient gradient estimators for probabilistic programs. Gradient inference rests on a formal reduction from a gradient estimation problem to a closely related probabilistic inference problem, whose solution can be differentiated to obtain a gradient estimator. This inference problem is obtained by applying two powerful statistical operations -- coupling and factorization -- to the input probabilistic program. Our reduction lets us leverage the rich toolkit of probabilistic inference algorithms to design novel gradient estimators that extend and improve upon existing methods. We introduce GradInf, a probabilistic programming system that facilitates the sound and automated implementation of gradient inference. GradInf is centered around programmable source-to-source transformations for coupling and factorizing higher-order probabilistic programs, whose soundness is proven in terms of a denotational semantics. Key to our development is the use of information-flow typing to allow random choices in a probabilistic program to be factored out and partially evaluated, which improves our ability to deploy sophisticated probabilistic inference algorithms. The resulting system offers practitioners a principled framework for designing gradient estimators. We apply GradInf to several challenging case studies, showing that it can express prominent gradient estimators from the literature and enables the construction of new state-of-the-art estimators that outperform the best existing baselines.

概率编程梯度估计推断系统

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。