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 2.3x speedup compared to Stan in geometric mean over 26 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 后端与斯坦相比, 以几何平均值高于26个基准的速度加速了2.3x 。 在 Pyro 的基础上, 我们扩展斯坦, 支持明确的变异推断指南和深度概率模型。 这样, 熟悉Stan 的用户就可以在不必学习基本新语言的情况下获得新特征。