Stochastic variational inference
Matt HoffmanDavid M. BleiChong WangJohn Paisley
Develops stochastic variational inference, a scalable algorithm that applies stochastic optimization to variational bounds, enabling complex Bayesian models to perform posterior inference on massive datasets containing millions of documents.
Modern data analysis increasingly involves massive collections of complex, high-dimensional observations such as millions of documents, user histories, or gene sequences. Probabilistic graphical models provide a principled way to encode assumptions about hidden structure, yet standard posterior inference methods, including traditional variational inference, require repeated passes over the entire data set and therefore cannot scale to these sizes.
The article develops stochastic variational inference, a general algorithm that casts mean-field variational inference as a stochastic optimization problem and solves it with noisy natural-gradient steps obtained by repeatedly subsampling the data. The method is derived for the broad class of models whose complete conditionals belong to the exponential family and is instantiated for latent Dirichlet allocation and its Bayesian nonparametric counterpart, the hierarchical Dirichlet process topic model.
On three large corpora—300,000 Nature articles, 1.8 million New York Times articles, and 3.8 million Wikipedia articles—stochastic variational inference converges faster and reaches better predictive likelihoods than batch variational inference run on subsets that fit in memory. The nonparametric model consistently outperforms its fixed-topic counterpart while automatically determining the number of topics needed.
These results show that complex Bayesian models can be applied to data sets orders of magnitude larger than previously feasible, without clusters or specialized hardware, thereby extending the practical reach of probabilistic modeling to web-scale collections and streaming sources. The approach also highlights the value of combining variational methods with stochastic optimization and natural gradients.
Further gains may come from extending the framework to nonconjugate models, incorporating structured variational families, and developing adaptive or variance-reduced gradient estimators. The main limitations are the conjugacy assumption required for closed-form updates, the need to tune the learning-rate schedule, and the truncation levels chosen for the nonparametric model; results are therefore most reliable when these modeling choices are validated on held-out data.
- Paper: Latent Dirichlet Allocation, David M. Blei et al. (2003). It introduces Latent Dirichlet Allocation and classical batch variational inference, providing the primary probabilistic model and baseline that stochastic variational inference aims to scale.
- Paper: An Introduction to Variational Methods for Graphical Models, MICHAEL I. JORDAN et al. (1999). It provides foundational principles and derivations for mean-field variational approximations in graphical models, which underpin the optimization framework of stochastic variational inference.
- Paper: A Natural Policy Gradient, Sham M. Kakade (2001). It develops the natural gradient formulation based on the Fisher information matrix, which is crucial for deriving the Riemannian natural-gradient updates in stochastic variational inference.
- Paper: Bayesian Learning via Stochastic Gradient Langevin Dynamics, M. Welling et al. (2011). It establishes the paradigm of subsampling mini-batches to scale Bayesian posterior inference, motivating stochastic gradient techniques in large datasets.
- Paper: Adaptive Subgradient Methods for Online Learning and Stochastic Optimization, John Duchi et al. (2011). It introduces adaptive stochastic subgradient methods that directly address the challenge of setting learning-rate schedules in stochastic optimization.
- Paper: Unsupervised Learning by Probabilistic Latent Semantic Analysis, Thomas Hofmann (2001). It presents Probabilistic Latent Semantic Analysis, an essential conceptual predecessor to the topic modeling and latent variable paradigms optimized in stochastic variational inference.
- Paper: Variational Inference: A Review for Statisticians, David M. Blei et al. (2016). It synthesizes modern variational inference for statisticians, positioning stochastic variational inference within the broader ecosystem of coordinate-ascent and scalable optimization techniques.
- Paper: Stochastic Backpropagation and Approximate Inference in Deep Generative Models, Danilo Jimenez Rezende et al. (2014). It extends stochastic variational principles to deep generative models by introducing stochastic backpropagation through continuous latent variables.
- Paper: Neural Variational Inference and Learning in Belief Networks, Andriy Mnih et al. (2014). It builds on stochastic variational inference by using neural networks to amortize inference and introducing variance-reduction techniques for nonconjugate belief networks.
- Paper: Variational Inference with Normalizing Flows, Danilo Jimenez Rezende et al. (2015). It moves beyond the simple mean-field families used in stochastic variational inference by employing normalizing flows to construct flexible posterior approximations.
- Paper: Improving Variational Inference with Inverse Autoregressive Flow, Diederik P. Kingma et al. (2016). It improves upon mean-field stochastic variational methods by introducing inverse autoregressive flows for richer, highly expressive latent variable posteriors.
- Paper: Weight Uncertainty in Neural Network, C. Blundell et al. (2015). It adapts stochastic variational inference to quantify parameter uncertainty in deep neural networks via the Bayes by Backprop algorithm.
- Paper: Variational Autoencoders for Collaborative Filtering, Dawen Liang et al. (2018). It applies scalable stochastic variational principles and amortized inference to large-scale recommender systems and implicit feedback datasets.
- Paper: Accelerating Stochastic Gradient Descent using Predictive Variance Reduction, Rie Johnson et al. (2013). It addresses a key open direction of stochastic variational inference by introducing stochastic variance-reduced gradients to accelerate convergence.
- Paper: An Introduction to Variational Autoencoders, Diederik P. Kingma et al. (2019). It comprehensively surveys variational autoencoders, illustrating the evolution of stochastic variational inference into deep amortized latent-variable modeling.
