Programmable MCMC with Soundly Composed Guide Programs

被引:0
作者
Pham, Long [1 ]
Wang, Di [2 ]
Saad, Feras A. [1 ]
Hoffmann, Jan [1 ]
机构
[1] Carnegie Mellon Univ, Pittsburgh, PA 15213 USA
[2] Peking Univ, Beijing, Peoples R China
来源
PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL | 2024年 / 8卷 / OOPSLA期
基金
美国国家科学基金会;
关键词
probabilistic programming; Bayesian inference; type systems; coroutines; context-free types; MARKOV-CHAINS; GIBBS;
D O I
10.1145/3689748
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Probabilistic programming languages (PPLs) provide language support for expressing flexible probabilistic models and solving Bayesian inference problems. PPLs with programmable inference make it possible for users to obtain improved results by customizing inference engines using guide programs that are tailored to a corresponding model program. However, errors in guide programs can compromise the statistical soundness of the inference. This article introduces a novel coroutine-based framework for verifying the correctness of user-written guide programs for a broad class of Markov chain Monte Carlo (MCMC) inference algorithms. Our approach rests on a novel type system for describing communication protocols between a model program and a sequence of guides that each update only a subset of random variables. We prove that, by translating guide types to context-free processes with finite norms, it is possible to check structural type equality between models and guides in polynomial time. This connection gives rise to an efficient type-inference algorithm for probabilistic programs with flexible constructs such as general recursion and branching. We also contribute a coverage-checking algorithm that verifies the support of sequentially composed guide programs agrees with that of the model program, which is a key soundness condition for MCMC inference with multiple guides. Evaluations on diverse benchmarks show that our type-inference and coverage-checking algorithms efficiently infer types and detect sound and unsound guides for programs that existing static analyses cannot handle.
引用
收藏
页数:30
相关论文
共 53 条
  • [1] Deciding the bisimilarity of context-free session types
    Almeida, Bernardo
    Mordido, Andreia
    Vasconcelos, Vasco T.
    [J]. TOOLS AND ALGORITHMS FOR THE CONSTRUCTION AND ANALYSIS OF SYSTEMS, PT II, TACAS 2020, 2020, 12079 : 39 - 56
  • [2] Barthe Gilles, 2020, Foundations of Probabilistic Programming, DOI DOI 10.1017/9781108770750
  • [3] Bingham E, 2019, J MACH LEARN RES, V20
  • [4] Bonawitz Keith A., 2008, Ph. D. Dissertation
  • [5] Caires L, 2010, LECT NOTES COMPUT SC, V6269, P222, DOI 10.1007/978-3-642-15375-4_16
  • [6] Stan: A Probabilistic Programming Language
    Carpenter, Bob
    Gelman, Andrew
    Hoffman, Matthew D.
    Lee, Daniel
    Goodrich, Ben
    Betancourt, Michael
    Brubaker, Marcus A.
    Guo, Jiqiang
    Li, Peter
    Riddell, Allen
    [J]. JOURNAL OF STATISTICAL SOFTWARE, 2017, 76 (01): : 1 - 29
  • [7] Probabilistic models of cognition: Conceptual foundations
    Chater, Nick
    Tenenbaum, Joshua B.
    Yuille, Alan
    [J]. TRENDS IN COGNITIVE SCIENCES, 2006, 10 (07) : 287 - 291
  • [8] UNDERSTANDING THE METROPOLIS-HASTINGS ALGORITHM
    CHIB, S
    GREENBERG, E
    [J]. AMERICAN STATISTICIAN, 1995, 49 (04) : 327 - 335
  • [9] Chib S, 2001, Handb Econ, V5, P3569, DOI DOI 10.1016/S1573-4412(01)05010-3
  • [10] BISIMULATION EQUIVALENCE IS DECIDABLE FOR ALL CONTEXT-FREE PROCESSES
    CHRISTENSEN, S
    HUTTEL, H
    STIRLING, C
    [J]. INFORMATION AND COMPUTATION, 1995, 121 (02) : 143 - 148