一句话:提出用函数式语言特性实现模块化概率编程库,可组合出最先进的贝叶斯推断算法。
论文面向现代函数式语言设计了一个贝叶斯建模与推断库架构。其核心是利用高阶函数、归纳数据类型以及类型类或表达力强的模块系统,实现推断表示、推断变换与推断表示变换器等抽象,从而让现有最先进的推断算法以模块化方式实现。作者在 Haskell 中给出高效实现,将粒子滤波与 Metropolis-Hastings 采样器作为基本构件,并组合出 RM-SMC、PMMH 与 SMC² 等算法。评估表明其性能与现有概率编程系统相比已具竞争力,还可对随机 Monte Carlo 算法做确定性测试,并用 OCaml 验证该设计可由表达力强的模块系统承载。
We present an architectural design of a library for Bayesian modelling and inference in modern functional programming languages. The novel aspect of our approach are modular implementations of existing state-of-the-art inference algorithms. Our design relies on three inherently functional features: higher-order functions, inductive data-types, and support for either type-classes or an expressive module system. We provide a performant Haskell implementation of this architecture, demonstrating that high-level and modular probabilistic programming can be added as a library in sufficiently expressive languages. We review the core abstractions in this architecture: inference representations, inference transformations, and inference representation transformers. We then implement concrete instances of these abstractions, counterparts to particle filters and Metropolis-Hastings samplers, which form the basic building blocks of our library. By composing these building blocks we obtain state-of-the-art inference algorithms: Resample-Move Sequential Monte Carlo, Particle Marginal Metropolis-Hastings, and Sequential Monte Carlo Squared. We evaluate our implementation against existing probabilistic programming systems and find it is already competitively performant, although we conjecture that existing functional programming optimisation techniques could reduce the overhead associated with the abstractions we use. We show that our modular design enables deterministic testing of inherently stochastic Monte Carlo algorithms. Finally, we demonstrate using OCaml that an expressive module system can also implement our design.
@article{paperbot304,
title = {Functional programming for modular Bayesian inference},
author = {Adam Ścibior and Ohad Kammar and Zoubin Ghahramani},
journal = {Proceedings of the ACM on Programming Languages},
volume = {2},
number = {ICFP},
year = {2018},
doi = {10.1145/3236778}
}