# Introduction

Probabilistic modeling and inference are core tools in diverse fields including statistics, machine learning, computer vision, cognitive science, robotics, natural language processing, and artificial intelligence. To meet the functional requirements of applications, practitioners use a broad range of modeling techniques and approximate inference algorithms. However, implementing inference algorithms is often difficult and error prone. Gen simplifies the use of probabilistic modeling and inference, by providing modeling languages in which users express models, and high-level programming constructs that automate aspects of inference.

Like some probabilistic programming research languages, Gen includes universal modeling languages that can represent any model, including models with stochastic structure, discrete and continuous random variables, and simulators. However, Gen is distinguished by the flexibility that it affords to users for customizing their inference algorithm. It is possible to use built-in algorithms that require only a couple lines of code, as well as develop custom algorithms that are more able to meet scalability and efficiency requirements.

Gen’s flexible modeling and inference programming capabilities unify symbolic, neural, probabilistic, and simulation-based approaches to modeling and inference, including causal modeling, symbolic programming, deep learning, hierarchical Bayesian modeling, graphics and physics engines, and planning and reinforcement learning.

Gen is a package for the Julia programming language. Gen consists of multiple modeling languages that are implemented as DSLs in Julia and a Julia library for inference programming.

# Getting Started

Warning: Gen is rapidly evolving pre-alpha research software.

## Using Julia package manager

The, install the Gen package with the Julia package manager. From the Julia REPL, type ] to enter the Pkg REPL mode and then run:

pkg> add Gen


## Docker

A docker image containing an installation of Gen, with tutorial Jupyter notebooks, is available here.

# Benchmarks

Code for benchmarks, presented at PLDI 2019, are available here.

# Publications

Gen: A General-Purpose Probabilistic Programming System with Programmable Inference. Cusumano-Towner, M. F.; Saad, F. A.; Lew, A.; and Mansinghka, V. K. In Proceedings of the 40th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ‘19). URL

Incremental inference for probabilistic programs. Cusumano-Towner, M. F.; Bichsel, B.; Gehr, T.; Vechev, M.; and Mansinghka, V. K. In Proceedings of the 39th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), pages 571–585. ACM, 2018. URL.

A design proposal for Gen: Probabilistic programming with fast custom inference via code generation. Cusumano-Towner, M. F.; and Mansinghka, V. K. In Workshop on Machine Learning and Programming Languages (MAPL, co-located with PLDI), pages 52–57. 2018. URL.

Using probabilistic programs as proposals. Cusumano-Towner, M. F.; and Mansinghka, V. K. In Workshop on Probabilistic Programming Languages, Semantics, and Systems (PPS, co-located with POPL). 2018. URL.

Encapsulating models and approximate inference programs in probabilistic modules. Cusumano-Towner, M. F.; and Mansinghka, V. K. In Workshop on Probabilistic Programming Semantics (PPS, co-located with POPL). 2017. URL.

# Getting in Contact

Gen was created at the MIT Probabilstic Computing Project. To get in contact with the Project, please fill out this online form. (But please don’t hesitate to engage directly with the Gen open source project via the Github site!)

# Citing

@inproceedings{Cusumano-Towner:2019:GGP:3314221.3314642,
author = {Cusumano-Towner, Marco F. and Saad, Feras A. and Lew, Alexander K. and Mansinghka, Vikash K.},
title = {Gen: A General-purpose Probabilistic Programming System with Programmable Inference},
booktitle = {Proceedings of the 40th ACM SIGPLAN Conference on Programming Language Design and Implementation},
series = {PLDI 2019},
year = {2019},
isbn = {978-1-4503-6712-7},
location = {Phoenix, AZ, USA},
pages = {221--236},
numpages = {16},
url = {http://doi.acm.org/10.1145/3314221.3314642},
doi = {10.1145/3314221.3314642},
acmid = {3314642},
publisher = {ACM},
address = {New York, NY, USA},
keywords = {Markov chain Monte Carlo, Probabilistic programming, sequential Monte Carlo, variational inference},
}