From high-level inference algorithms to efficient code
Rajan Walia, Praveen Narayanan, Jacques Carette, Sam Tobin-Hochstadt,, Chung-chieh Shan

TL;DR
This paper presents a compilation approach that transforms high-level probabilistic programs into efficient low-level code, enabling automatic, optimized execution of complex inference algorithms traditionally implemented manually.
Contribution
It introduces new transformations and optimizations that compile high-level probabilistic models into efficient loop code, matching manual implementation performance.
Findings
Compiled probabilistic programs achieve performance comparable to handwritten code.
New transformations enable direct expression of inference algorithms in high-level languages.
Optimizations and JIT compilation improve execution efficiency significantly.
Abstract
Probabilistic programming languages are valuable because they allow domain experts to express probabilistic models and inference algorithms without worrying about irrelevant details. However, for decades there remained an important and popular class of probabilistic inference algorithms whose efficient implementation required manual low-level coding that is tedious and error-prone. They are algorithms whose idiomatic expression requires random array variables that are latent or whose likelihood is conjugate. Although that is how practitioners communicate and compose these algorithms on paper, executing such expressions requires eliminating the latent variables and recognizing the conjugacy by symbolic mathematics. Moreover, matching the performance of handwritten code requires speeding up loops by more than a constant factor. We show how probabilistic programs that directly and…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsBayesian Modeling and Causal Inference · Machine Learning and Algorithms · Algorithms and Data Compression
