Introduction
The 2013 work by David Wingate and Theo Weber represents a significant milestone in Probabilistic Programming (PP). It bridges the gap between the flexibility of high-level probabilistic models and the efficiency of Variational Inference (VI), providing a path toward "black-box" inference that does not require specialized statistical expertise to implement. By leveraging the compositional nature of probabilistic programs and using stochastic gradient descent—drawing parallels to reinforcement learning techniques—the authors enable efficient, approximate Bayesian inference without manual mathematical derivations.
The Challenge: Automating Inference
Probabilistic Programming Languages (PPLs) like Church or BLOG allow researchers to define complex generative models using standard programming constructs such as loops and recursion. However, performing inference—calculating the posterior distribution of variables given observed data—is notoriously difficult.
Traditionally, PPLs have relied on Markov Chain Monte Carlo (MCMC) methods. While universal, MCMC can be slow to converge. Variational Inference (VI) is a faster alternative that frames inference as an optimization problem, but it typically requires manual derivation of complex "coordinate descent" equations for every new model. This manual step hinders the goal of fully automated probabilistic programming. This paper addresses the challenge of making VI as universal and automatic as MCMC.
Methodology: Compositional Variational Inference
The core innovation is Compositional Variational Inference. Instead of solving the mathematics for an entire program at once, the authors treat the variational approximation as a program itself.
- The Variational Program: For a given "target" program, they construct a "variational" version. Every time the original program makes a random choice (an Elementary Random Procedure or ERP), the variational program makes a similar choice using adjustable parameters ($\theta$).
- Partial Mean-Field: They employ a "mean-field" approach where variational parameters for one choice are assumed to be independent of the history of other choices, though the program's control flow maintains structural dependencies.
- Stochastic Gradient Descent (SGD): To optimize parameters, the authors use the "log-derivative trick" (REINFORCE algorithm) to estimate the gradient of the Evidence Lower Bound (ELBO) by running the program forward and collecting samples.
- Variance Reduction: To stabilize these stochastic gradients, they introduce a baseline constant ($K$), drawing inspiration from Actor-Critic methods in reinforcement learning.
Experimental Evaluation
The authors evaluated their "Automated Variational Inference" (AVI) framework on two classic benchmarks:
- QMR-DT: A large-scale bipartite graphical model used for medical diagnosis.
- LDA (Latent Dirichlet Allocation): A standard topic model used to discover underlying themes in large document collections.
Results and Discussion
The proposed ENAC (Episodic Natural Actor Critic) variant of the algorithm demonstrated superior performance in terms of convergence speed and stability.
As illustrated in the QMR results, ENAC shows significantly faster convergence and lower variance compared to vanilla stochastic gradient descent. A key finding was that optimizing the baseline constant ($K$) was more impactful for performance than using complex second-order optimization techniques like Fisher Information matrices.
In the LDA benchmark, the stability of the gradient-based AVI is even more pronounced. While second-order methods (SOGD) often diverged or performed poorly, ENAC remained stable. Once trained, the variational program allows for very fast approximate sampling from the posterior—much faster than running a full MCMC chain for every new query.
Conclusion and Future Directions
While the paper focuses on mean-field approximations, which assume independence between random variables in the posterior, it opens the door for "structured" variational inference where dependencies are explicitly modeled. Furthermore, the authors touch on "Learning Inference Transfer," a concept now known as amortized inference, which laid the groundwork for modern techniques like Variational Autoencoders (VAEs). By framing inference as a policy search problem, this work provides a scalable and automated path for Bayesian inference in complex probabilistic models.
Summary updated