Papers · arXiv 1312.6114
Auto-Encoding Variational Bayes
Published stat.MLcs.LG arXivPDF
Summary in three lines
- 🎯 Perform efficient posterior inference and parameter learning in directed probabilistic models with continuous latent variables and intractable posteriors on large datasets.
- 🔧 Formulates the Stochastic Gradient Variational Bayes (SGVB) estimator via a reparameterization trick (expressing latent variables as deterministic mappings of auxiliary noise) and trains an amortized neural recognition model (variational auto-encoder).
- 📈 Outperforms wake-sleep and Monte Carlo EM in lower-bound optimization and convergence speed, training successfully with small batch sizes () and just sample per datapoint.
Abstract
How can we perform efficient inference and learning in directed probabilistic models, in the presence of continuous latent variables with intractable posterior distributions, and large datasets? We introduce a stochastic variational inference and learning algorithm that scales to large datasets and, under some mild differentiability conditions, even works in the intractable case. Our contributions are two-fold. First, we show that a reparameterization of the variational lower bound yields a lower bound estimator that can be straightforwardly optimized using standard stochastic gradient methods. Second, we show that for i.i.d. datasets with continuous latent variables per datapoint, posterior inference can be made especially efficient by fitting an approximate inference model (also called a recognition model) to the intractable posterior using the proposed lower bound estimator. Theoretical advantages are reflected in experimental results.
Reading guide
Problem and motivation
Directed probabilistic models with continuous latent variables are useful for generative modeling, unsupervised representation learning, and marginal inference. However, learning them via maximum likelihood or Bayesian methods faces severe computational hurdles when:
- Posterior intractability: For non-linear relationships (e.g., deep neural networks), the marginal likelihood integral and the posterior lack closed-form analytical solutions, rendering standard Expectation-Maximization (EM) and mean-field variational Bayes inapplicable.
- Large datasets: Traditional sampling approaches such as Monte Carlo EM require slow, iterative MCMC sampling per datapoint across the dataset, making large-scale mini-batch optimization prohibitively expensive.
The standard naive score-function gradient estimator exhibits excessively high variance, preventing reliable optimization with stochastic gradient ascent.
Key ideas
- Reparameterization Trick: Instead of sampling directly from an intractable parameterized distribution , the variable is rewritten as a deterministic transformation of an independent noise variable : . This allows differentiation with respect to through standard backpropagation with dramatically reduced variance.
- Amortized Inference (Recognition Model): Instead of optimizing variational parameters per datapoint, an encoder neural network predicts variational parameters (such as the mean and variance of a latent Gaussian) conditioned on .
- Auto-Encoding Variational Bayes (AEVB): Jointly optimizes generative parameters (probabilistic decoder) and variational parameters (probabilistic encoder) using stochastic gradient ascent on the reparameterized variational lower bound.
Method
The variational objective maximizes the Evidence Lower Bound (ELBO) :
Applying the reparameterization trick with , the generic SGVB estimator (Estimator A) is:
When the prior and approximate posterior are Gaussian, the KL divergence can be computed analytically, yielding Estimator B: where and .
For mini-batches of size , the full lower-bound estimator is: In practice, setting sample per datapoint is sufficient when paired with mini-batch sizes such as .
Results
- Model Settings: Generative models were evaluated on MNIST (Bernoulli MLP decoder, 500 hidden units) and Frey Face (Gaussian MLP decoder, 200 hidden units), optimized via Adagrad with learning rates in and weight decay.
- Lower Bound Optimization: Across various latent dimensionalities ( on Frey Face and MNIST), AEVB converged significantly faster and attained a higher lower bound than the wake-sleep algorithm.
- Overfitting Resistance: Increasing the dimensionality of did not cause overfitting due to the regularizing effect of the analytical KL divergence term toward the prior.
- Marginal Likelihood Estimation: On 3-dimensional latent space MNIST experiments using an HMC-based marginal likelihood estimator, AEVB converged faster than wake-sleep and far exceeded the feasibility of Monte Carlo EM (which was too slow to run on the full MNIST dataset).
- Runtime: Training took roughly 20–40 minutes per million samples on an Intel Xeon CPU (~40 GFLOPS).
Limitations and open questions
- Continuous Latent Variables: The reparameterization trick directly relies on differentiability with respect to parameters, making it non-trivial to apply directly to discrete latent variable distributions.
- Approximation Gap: Assuming a diagonal Gaussian distribution for limits the expressive capacity when the true posterior is multimodal or strongly coupled.
- Extension to Full Variational Bayes: The empirical evaluation focused on MAP/ML parameter estimation for ; variational inference over global parameters was formulated in the appendix but left for future empirical validation.
Key terms
- SGVB (Stochastic Gradient Variational Bayes)
- A low-variance, differentiable Monte Carlo estimator of the variational lower bound achieved through reparameterization of continuous latent variables.
- AEVB (Auto-Encoding Variational Bayes)
- An algorithm that jointly trains a generative model (decoder) and a recognition model (encoder) using SGVB over mini-batches.
- Reparameterization Trick
- A technique to express a random variable as a deterministic, differentiable function of parameters, input data, and an independent noise distribution.
- Recognition Model
- A neural network (probabilistic encoder) parameterized by that predicts the distribution of latent variables given observed data .
- Variational Auto-Encoder (VAE)
- The architecture instantiated when neural networks are used as the encoder and decoder within the AEVB framework.
- Variational Lower Bound (ELBO)
- A computable objective function lower-bounding the marginal log-likelihood, comprising reconstruction log-likelihood and a KL divergence penalty against the prior.
- Wake-Sleep Algorithm
- An alternative learning algorithm that optimizes separate recognition and generative objectives, not guaranteeing optimization of a single marginal likelihood bound.
Questions
Why is the score-function (REINFORCE) estimator replaced?
The naive score-function Monte Carlo gradient estimator exhibits excessively high variance, making optimization with stochastic gradient ascent impractical without complex control variates.
How many Monte Carlo samples $L$ are needed during training?
The authors empirically found that sample per datapoint is sufficient for stable convergence, provided the mini-batch size is moderately large (e.g., ).
What distributions support the reparameterization trick?
Distributions with a tractable inverse CDF (e.g., Cauchy, Gumbel), location-scale families (e.g., Gaussian, Student's t, Laplace), and compositions of simpler continuous variables (e.g., Log-Normal, Gamma, Beta).
How does AEVB prevent overfitting when latent space dimensionality is increased?
The KL divergence term acts as a natural regularizer by penalizing latent posterior dimensions that deviate from the prior, effectively setting uninformative latent channels to the standard Gaussian prior.
The overview on this page was written by AI from the paper and may contain mistakes. Read the paper for the details.