Venture: a higher-order probabilistic programming platform with programmable inference

Vikash Mansinghka, Daniel Selsam, Yura N. PerovarXiv 2014

Introduction

Probabilistic programming languages (PPLs) aim to democratize Bayesian modeling by decoupling model specification from the underlying mathematics of inference. However, researchers have historically faced a "Goldilocks" problem: restricted languages like Stan or Infer.NET are fast but limit model complexity, while highly expressive languages like Church can represent almost any model but rely on inefficient "black-box" inference engines. Venture is a next-generation PPL designed to break this trade-off. By introducing the concept of "programmable inference," Venture allows developers to write custom, scalable inference strategies for Turing-complete probabilistic models, achieving linear scaling where previous systems struggled with quadratic complexity.

The Problem: Expressiveness vs. Efficiency

In traditional expressive PPLs, a single update to a model often requires re-simulating the entire program. This leads to $O(N^2)$ runtime complexity relative to the dataset size, making them impractical for large-scale applications. Restricted languages avoid this by limiting the types of models they can represent—often struggling with dynamic models where the number of variables changes. Venture addresses this by providing both high-level expressiveness and a compositional language for specifying exactly how inference should be performed.

Core Architectural Components

Venture introduces several novel mechanisms to enable efficient, programmable inference:

  • Programmable Inference: Instead of a fixed algorithm, Venture provides a language to assemble custom strategies. Users can mix and match Metropolis-Hastings, Gibbs sampling, Sequential Monte Carlo (SMC), and Variational Inference for different parts of a single model.
  • Probabilistic Execution Traces (PETs): Unlike standard Bayesian networks, PETs represent the history of a program's execution. They explicitly track "existential dependencies," which occur when a random choice (such as an if statement) determines whether other random variables are even instantiated.
  • Scaffolds and Stochastic Regeneration: Scaffolds are partitions of a PET that isolate local sub-problems. By focusing inference on a specific scaffold, Venture can update a small portion of a massive model without touching independent variables. This is powered by "stochastic regeneration," a family of algorithms that allow Venture to achieve $O(N)$ linear scaling for updates.
  • Stochastic Procedure Interface (SPI): This flexible bridge allows Venture to incorporate external, optimized simulators or "likelihood-free" models that lack a tractable probability density, making the system applicable to fields like robotics and complex physical simulations.

Modeling Idioms and Validation

The paper demonstrates Venture's capabilities through several complex modeling scenarios rather than standard machine learning benchmarks:

  1. Hidden Markov Models (HMMs): Venture shows how to interleave observations with inference to maintain linear scaling as data arrives.
  2. Hierarchical Nonparametric Bayesian Models: The system successfully handles Dirichlet Process mixtures of Gaussians, where the number of clusters is itself a random variable.
  3. Inverse Interpretation: Venture can perform "program synthesis," learning the source code of a probabilistic program that could have generated a specific dataset.

Key Insights

The most radical shift in Venture is treating inference as code. By making inference a first-class program that operates on the model, experts can inject domain knowledge into the sampling process. Furthermore, Venture identifies "absorbing nodes"—points in the program that soak up changes, preventing a local update from triggering a global re-simulation. This proves that high-level expressiveness does not have to come at the cost of performance; by tracking dependencies precisely, constant-time updates for single data points are possible even in large models.

Results and Future Directions

Venture successfully implements a wide range of inference strategies (MH, Gibbs, Particle MCMC, and Mean-field Variational Inference) using the same underlying machinery. It demonstrates a significant improvement over the $O(N^2)$ scaling of earlier expressive PPLs, achieving $O(N)$ scaling for typical inference sweeps.

While Venture represents a major step forward, the authors note that current implementations are unoptimized prototypes. Future work will focus on:

  • Reducing Constant-Time Overhead: While asymptotic scaling is improved, the absolute overhead remains a challenge.
  • Language Enhancements: Adding standard features like iteration and procedural abstraction to the inference programming language.
  • Automated Optimization: Developing systems that automatically transform a model's inference strategy for maximum speed.
  • Advanced Kernels: Extending support to Hamiltonian Monte Carlo (HMC) and slice sampling across arbitrary program scopes.

Summary updated

BibTeX
@misc{mansinghka2014venture,
  author = {Vikash Mansinghka and Daniel Selsam and Yura N. Perov},
  title = {{Venture: a higher-order probabilistic programming platform with programmable inference}},
  year = {2014},
  eprint = {1404.0099},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1404.0099},
}
Figure