paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Trace types and denotational semantics for sound programmable inference in probabilistic languages

概率语言中可靠可编程推断的迹类型与指称语义
POPL 4(POPL)2019匹配度 4/10 · 论文研究概率编程语言中可编程推断的迹类型与指称语义,属于PL/形式语义方向,但与用户核心关注的LLM/Agentic程序静态分析、AI辅助静态分析/形式化验证、浮点程序分析以及LLM交叉均无直接关系;仅与贝叶斯/概率编程的形式化基础有一定边缘关联。引用 29 inbox
Alexander K. Lew, Marco F. Cusumano-Towner, Benjamin Sherman, Michael Carbin, Vikash K. Mansinghka
crossref: 2026-09-10

AI 速览

一句话:提出迹类型系统与指称语义,使可编程推断程序在构造上保证可靠性,覆盖变分、SMC、MCMC 等。

现代概率编程语言提供可编程推断构造,让开发者能为特定模型或数据定制推断算法,但这些构造容易被误用,从而写出看似正确、结果却不可靠的程序。论文为高阶概率语言中的可编程推断建立指称语义,并设计类型系统,使良类型的推断程序天然可靠。核心思想是让概率表达式的类型不仅跟踪返回值类型,还跟踪其可能执行迹的空间,因为推断算法常操纵这些迹。作者用该语义与类型系统证明了使用变分推断、序贯蒙特卡洛、重要性采样和马尔可夫链蒙特卡洛构造的自定义推断程序的可靠性。

问题
可编程推断构造虽能定制算法,但缺乏语义与类型保障,容易写出看似运行正确却产生错误结果的不可靠推断程序。
方法
提出跟踪执行迹空间的迹类型系统与高阶概率语言可编程推断的指称语义,并据此证明良类型程序可靠。
评估
以变分推断、序贯蒙特卡洛、重要性采样和 MCMC 等自定义推断程序为案例,建立其可靠性性质。
原文摘要(Abstract)

Modern probabilistic programming languages aim to formalize and automate key aspects of probabilistic modeling and inference. Many languages provide constructs for programmable inference that enable developers to improve inference speed and accuracy by tailoring an algorithm for use with a particular model or dataset. Unfortunately, it is easy to use these constructs to write unsound programs that appear to run correctly but produce incorrect results. To address this problem, we present a denotational semantics for programmable inference in higher-order probabilistic programming languages, along with a type system that ensures that well-typed inference programs are sound by construction. A central insight is that the type of a probabilistic expression can track the space of its possible execution traces, not just the type of value that it returns, as these traces are often the objects that inference algorithms manipulate. We use our semantics and type system to establish soundness properties of custom inference programs that use constructs for variational, sequential Monte Carlo, importance sampling, and Markov chain Monte Carlo inference.

链接与引用

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

BibTeX
@article{paperbot567,
  title = {Trace types and denotational semantics for sound programmable inference in probabilistic languages},
  author = {Alexander K. Lew and Marco F. Cusumano-Towner and Benjamin Sherman and Michael Carbin and Vikash K. Mansinghka},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {4},
  number = {POPL},
  year = {2019},
  doi = {10.1145/3371087}
}