Stan is a probabilistic programming language that is popular in the statistics community, with a high-level syntax for expressing probabilistic models. Stan differs by nature from generative probabilistic programming languages like Church, Anglican, or Pyro. This paper presents a comprehensive compilation scheme to compile any Stan model to a generative language and proves its correctness. We use our compilation scheme to build two new backends for the Stanc3 compiler targeting Pyro and NumPyro. Experimental results show that the NumPyro backend yields a 4.1x speedup compared to Stan in geometric mean over 25 benchmarks. Building on Pyro we extend Stan with support for explicit variational inference guides and deep probabilistic models. That way, users familiar with Stan get access to new features without having to learn a fundamentally new language.
翻译:Stan 是统计界流行的一种概率编程语言, 用于表达概率模型的高级语法。 Stan 自然性质与教会、 英国圣公会或皮洛等基因性概率编程语言不同。 本文提出了一个综合汇编计划, 将任何斯坦模式编成一种基因化语言, 并证明其正确性。 我们用我们的编程计划为Stanc3编程者针对Pyro 和 NumPyro 建立两个新的后端。 实验结果表明, NumPyro 后端与斯坦相比, 具有4.1x 速度, 以几何平均值超过25个基准。 在Pyro 的基础上, 我们扩展Stan, 支持明确的变异推断指南和深度概率模型。 这样, 熟悉Stan 的用户就可以在不必学习基本新语言的情况下获得新特征。