Skip to main content
QUICK REVIEW

[Paper Review] Inference Compilation and Universal Probabilistic Programming

Tuan Le, Atılım Güneş Baydin|arXiv (Cornell University)|Oct 31, 2016
Bayesian Modeling and Causal InferenceComputer Science33 citations
TL;DR

This paper introduces inference compilation for universal probabilistic programming, where a deep neural network is trained to act as a proposal distribution for sequential importance sampling, enabling fast approximate inference in complex generative models. The method compiles probabilistic programs into neural architectures that adaptively generate proposals, achieving significant speedups on mixture models and captcha-solving tasks without requiring model retraining.

ABSTRACT

We introduce a method for using deep neural networks to amortize the cost of inference in models from the family induced by universal probabilistic programming languages, establishing a framework that combines the strengths of probabilistic programming and deep learning methods. We call what we do "compilation of inference" because our method transforms a denotational specification of an inference problem in the form of a probabilistic program written in a universal programming language into a trained neural network denoted in a neural network specification language. When at test time this neural network is fed observational data and executed, it performs approximate inference in the original model specified by the probabilistic program. Our training objective and learning procedure are designed to allow the trained neural network to be used as a proposal distribution in a sequential importance sampling inference engine. We illustrate our method on mixture models and Captcha solving and show significant speedups in the efficiency of inference.

Motivation & Objective

  • To address the high computational cost of inference in universal probabilistic programming languages by amortizing it using deep neural networks.
  • To develop a method that generates neural proposal networks tailored to the structure of arbitrary probabilistic programs without requiring model inversion.
  • To enable efficient, scalable inference by training a neural network on an infinite stream of synthetic data generated from the model.
  • To maintain interpretability of the generative model while achieving the speed of deep learning inference.
  • To provide a framework that combines the expressiveness of universal probabilistic programming with the efficiency of neural network inference.

Proposed method

  • The method compiles a probabilistic program into a neural architecture with an LSTM core, embedding layers for observed variables, and proposal layers for latent variables.
  • The neural network is trained end-to-end using an infinite stream of synthetic data sampled from the probabilistic program.
  • During inference, the trained network parameterizes a proposal distribution $ q(\mathbf{x}|\mathbf{y};\phi) $ used in sequential importance sampling.
  • Observe embeddings are processed via a neural network that can be configured per program trace, with options to feed them at all time steps or only at the first step.
  • The architecture is reconfigured on-the-fly for each execution trace, ensuring adaptability to varying program structures.
  • The training objective ensures the proposal network approximates the true posterior, minimizing the variance of importance weights.

Experimental results

Research questions

  • RQ1Can a neural network be trained to serve as an effective proposal distribution for sequential importance sampling in arbitrary universal probabilistic programs?
  • RQ2How can neural architecture be automatically adapted to the structure of a given probabilistic program without requiring model inversion?
  • RQ3What is the impact of different observe embedding strategies (e.g., single vs. recurrent input) on training efficiency and performance?
  • RQ4Can this framework achieve significant speedups in inference while maintaining accuracy on complex models like mixture models and captchas?
  • RQ5How robust is the method to model misspecification when the generative model does not perfectly match the true data distribution?

Key findings

  • The method achieves significant speedups in inference efficiency on both mixture models and captcha-solving tasks by amortizing inference through a trained neural proposal network.
  • Feeding observe embeddings only at the first time step led to slower training (approx. 3× longer) compared to feeding them at every step, despite equivalent performance.
  • The approach successfully learns nonlinear posterior approximations from the observe space to the latent space, enabling accurate inference in complex models.
  • The framework is robust to model misspecification to some extent, but performance degrades when priors in the generative model do not match real-world data, requiring manual adjustments.
  • The neural architecture can be effectively reconfigured per execution trace, enabling dynamic handling of diverse program structures.
  • The method avoids overfitting to training data by relying on an infinite stream of synthetic data, though model misspecification remains a risk if the generative model is too narrow or uncalibrated.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.