[Paper Review] Deep Amortized Inference for Probabilistic Programs
This paper proposes a deep amortized inference framework for probabilistic programs using neural network-guided inference, where a parameterized guide program learns to approximate the posterior distribution by leveraging shared structure across multiple inference tasks. The method uses stochastic gradient optimization to train the guide, enabling fast and accurate inference across Bayesian networks, topic models, and deep generative models with significant speedups over traditional sampling-based methods.
Probabilistic programming languages (PPLs) are a powerful modeling tool, able to represent any computable probability distribution. Unfortunately, probabilistic program inference is often intractable, and existing PPLs mostly rely on expensive, approximate sampling-based methods. To alleviate this problem, one could try to learn from past inferences, so that future inferences run faster. This strategy is known as amortized inference; it has recently been applied to Bayesian networks and deep generative models. This paper proposes a system for amortized inference in PPLs. In our system, amortization comes in the form of a parameterized guide program. Guide programs have similar structure to the original program, but can have richer data flow, including neural network components. These networks can be optimized so that the guide approximately samples from the posterior distribution defined by the original program. We present a flexible interface for defining guide programs and a stochastic gradient-based scheme for optimizing guide parameters, as well as some preliminary results on automatically deriving guide programs. We explore in detail the common machine learning pattern in which a 'local' model is specified by 'global' random values and used to generate independent observed data points; this gives rise to amortized local inference supporting global model learning.
Motivation & Objective
- To address the computational intractability of posterior inference in probabilistic programs, especially when using expensive sampling-based methods.
- To enable faster inference by learning a reusable guide program that approximates the true posterior across multiple queries.
- To unify and extend existing variational inference approaches by embedding neural networks within a structured guide program framework.
- To support efficient global model learning by amortizing local inference across independent data points using a mapData abstraction.
- To provide a flexible, differentiable interface for defining and optimizing guide programs in a probabilistic programming language.
Proposed method
- The system constructs a guide program with identical control flow but distinct data flow from the original probabilistic program, using neural networks to parameterize the data flow.
- The guide is optimized via stochastic gradient descent to minimize the evidence lower bound (ELBO), enabling end-to-end training of the guide parameters.
- A novel mapData construct is introduced to separate global model variables from local data-specific variables, enabling mini-batch processing and variance reduction in gradient estimation.
- The method supports both discrete and continuous random variables, with variance reduction techniques to stabilize training on discrete latent variables.
- The framework is implemented as an extension to the WebPPL probabilistic programming language, enabling integration with existing PPL workflows.
- The guide is trained using backpropagation through stochastic computation graphs, allowing gradient-based optimization of neural network components within the guide.
Experimental results
Research questions
- RQ1Can a neural network-based guide program be trained to efficiently and accurately approximate the posterior distribution in probabilistic programs?
- RQ2How can amortized inference be effectively applied to models with independent and identically distributed (IID) data points, such as topic models and deep generative models?
- RQ3To what extent can a guide with shared control flow but learnable data flow (via neural networks) outperform traditional sampling-based inference in terms of speed and accuracy?
- RQ4Can the proposed framework support end-to-end optimization of both model parameters and guide parameters in a unified training procedure?
- RQ5How can variance in gradient estimates be reduced when optimizing guides with discrete latent variables?
Key findings
- The proposed deep amortized inference framework achieves significant speedups over traditional MCMC and SMC methods, particularly when scaling to large datasets with repeated inference queries.
- The use of the mapData construct enables efficient mini-batch processing and variance reduction, improving training stability and convergence speed for guide optimization.
- The system successfully learns guide programs for Bayesian networks, topic models, and deep generative models, demonstrating accurate posterior approximation across diverse model classes.
- The framework supports joint learning of global model parameters and local inference guides, enabling a virtuous cycle where better guides improve global model learning.
- The method achieves competitive performance on benchmark models, with results showing that neural network-guided inference can match or exceed the accuracy of standard variational inference baselines.
- Preliminary results show that the guide network can generalize across different data points, reducing the need for per-query re-computation and enabling fast inference at test time.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.