paperbot · PL 论文追踪

全部论文 待读 收藏

P0 Static Factorisation of Probabilistic Programs with User-Labelled Sample Statements and While Loops

带用户标注采样语句与 while 循环的概率程序的静态因子分解
OOPSLA 10(OOPSLA1)2026匹配度 8/10 · 该论文直接研究贝叶斯/概率程序的静态分析与程序切片,通过控制流图和抽象语义推导程序密度的因子分解,属于用户画像中“贝叶斯程序分析”的核心方向。虽然不涉及 LLM/Agent,但其理论形式化与工程优化结合较好,匹配度较高。引用 0 inbox
Markus Böck, Jürgen Cito
crossref: 2026-09-10

AI 速览

一句话:为含用户标注采样语句与 while 循环的概率程序给出静态因子分解与程序切片,并据此加速概率推断优化。

已知任何贝叶斯网络都可实现为概率程序,但反向问题尚不明确。本文研究含用户标注采样语句与 while 循环(如 Gen、Turing、Pyro 中的特性)的概率程序在多大程度上可被图形化表示。作者扩展操作语义以支持这些语言特性,并将程序翻译为控制流图,给出可靠的静态分析来近似随机变量的依赖结构,从而得到程序隐式定义密度的静态因子分解:对无循环、标签恒定的程序它与已知的贝叶斯网络因子分解一致,对由循环或动态标签定义无界多个随机变量的程序则给出新的图形表示。基于该结构,作者进一步提出可靠的程序切片技术,静态地支持三类优化:降低变分推断中梯度估计的方差,加速单点 Metropolis-Hastings 与序列蒙特卡洛。这些优化被证明正确,并在实验中匹配或优于现有技术。

问题
研究含用户标注采样语句与 while 循环的概率程序能否、以及在多大程度上被表示为图模型,即贝叶斯网络实现为概率程序的反方向问题。
方法
扩展概率程序的操作语义以覆盖这些语言特性,将程序翻译为控制流图,并定义可靠的静态分析来近似随机变量的依赖结构,由此得到程序密度的静态因子分解,并设计可靠的程序切片技术。
评估
对三类推断优化给出正确性证明,并通过实验表明其在变分推断梯度方差、单点 Metropolis-Hastings 与序列蒙特卡洛速度上匹配或优于现有技术。
原文摘要(Abstract)

It is commonly known that any Bayesian network can be implemented as a probabilistic program, but the reverse direction is not so clear. In this work, we address the open question to what extent a probabilistic program with user-labelled sample statements and while loops – features found in languages like Gen, Turing, and Pyro – can be represented graphically. To this end, we extend existing operational semantics to support these language features. By translating a program to its control-flow graph, we define a sound static analysis that approximates the dependency structure of the random variables in the program. As a result, we obtain a static factorisation of the implicitly defined program density, which is equivalent to the known Bayesian network factorisation for programs without loops and constant labels, but constitutes a novel graphical representation for programs that define an unbounded number of random variables via loops or dynamic labels. We further develop a sound program slicing technique to leverage this structure to statically enable three well-known optimisations for the considered program class: we reduce the variance of gradient estimates in variational inference and we speed up both single-site Metropolis Hastings and sequential Monte Carlo. These optimisations are proven correct and empirically shown to match or outperform existing techniques.

链接与引用

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

BibTeX
@article{paperbot3816,
  title = {Static Factorisation of Probabilistic Programs with User-Labelled Sample Statements and While Loops},
  author = {Markus Böck and Jürgen Cito},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {10},
  number = {OOPSLA1},
  year = {2026},
  doi = {10.1145/3798223}
}