Trace Types and Denotational Semantics for Sound Programmable Inference in Probabilistic Languages

被引:15
|
作者
Lew, Alexander K. [1 ]
Cusumano-Towner, Marco F. [1 ]
Sherman, Benjamin [1 ]
Carbin, Michael [1 ]
Mansinghka, Vikash K. [2 ]
机构
[1] MIT, Comp Sci & Artificial Intelligence Lab, Cambridge, MA 02139 USA
[2] MIT, Dept Brain & Cognit Sci, Cambridge, MA 02139 USA
关键词
Probabilistic programming; type systems; programmable inference;
D O I
10.1145/3371087
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Modern probabilistic programming languages aim to formalize and automate key aspects of probabilistic modeling arid 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.
引用
收藏
页数:32
相关论文
共 50 条