Lightweight Implementations of Probabilistic Programming Languages via Transformational Compilation

Abstract

We describe a general method of transforming arbitrary programming languages into probabilistic programming languages with straightforward MCMC inference engines. Random choices in the program are “named” with information about their position in an execution trace; these names are used in conjunction with a database of randomness to implement MCMC inference in the space of execution traces. We encode naming information using lightweight source-to-source compilers. Our method enables us to reuse existing infrastructure (compilers, interpreters, etc.) with minimal additional code, implying fast models with low development overhead. We illustrate the technique on two languages, one functional and one imperative: Bher, a compiled version of the Church language which eliminates interpretive overhead of the original MIT-Church implementation, and Stochastic Matlab, a new open-source language.

Cite

Text

Wingate et al. "Lightweight Implementations of Probabilistic Programming Languages via Transformational Compilation." Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics, 2011.

Markdown

[Wingate et al. "Lightweight Implementations of Probabilistic Programming Languages via Transformational Compilation." Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics, 2011.](https://mlanthology.org/aistats/2011/wingate2011aistats-lightweight/)

BibTeX

@inproceedings{wingate2011aistats-lightweight,
  title     = {{Lightweight Implementations of Probabilistic Programming Languages via Transformational Compilation}},
  author    = {Wingate, David and Stuhlmueller, Andreas and Goodman, Noah},
  booktitle = {Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics},
  year      = {2011},
  pages     = {770-778},
  volume    = {15},
  url       = {https://mlanthology.org/aistats/2011/wingate2011aistats-lightweight/}
}