Profile

Settings

Loading…

← Papers

Help

FAQ

Which features require signing in?

You can read the commentary, paper info, Model Structure and related papers of public papers without signing in. Sign in to manage your account or contact us about your inquiries.

Can I upload a PDF file?

Upload papers with an arXiv or DOI link; the commentary is public to everyone. Papers whose source and terms of use can't be verified, so the commentary can't be made public, can't be uploaded. Uploading PDF files and keeping papers private are for subscribers only, and a paper uploaded as a file is saved as private only. Searching for official info by title runs only when you press the button.

Are the figures and AI commentary accurate?

Figures come only from the original paper, and only those whose terms of use are verified are shown. The commentary is written by AI and may be wrong. Check important claims, numbers and figure context against the evidence in the original paper.

I want to report a copyright issue.

Terms of use and the source of the original paper are on the Paper info tab. If there's a problem, choose "Paper content, figures and copyright" under Contact us and send the paper link, the part in question, and evidence that you hold the rights. Receiving your report doesn't confirm any rights or remove anything right away. You can see the result of the review under My inquiries.

I forgot my password.

If you signed up with email, use Forgot password in the sign-in window to reset it with your verified email. If you signed up with Google, Naver or Kakao, change your password with that service.

What should I include in an inquiry?

Tell us which screen you were on and what you were doing when the problem happened, along with the paper link. Don't include personal information such as passwords, API keys, verification codes or phone numbers. Inquiries and replies are stored in Refivu and you can see them under My inquiries.

How do I delete my account?

In Settings, under My account, press Delete account. Review what will be deleted and complete identity verification to delete your account. For other requests, choose "Account" under Contact us.

Paper commentary

Auto-Encoding Variational Bayes

  • Problem Posterior inference and learning in directed latent-variable models become hard when the posteriors are intractable and the datasets are large, because mean-field variational Bayes needs expectations that cannot be computed, and sampling-based methods need an expensive loop per datapoint.
  • Method Reparameterizes samples from the approximate posterior as a differentiable function of auxiliary noise, which gives the SGVB estimator, and uses it to train a recognition model with minibatch stochastic gradients in the AEVB algorithm.
  • Results With minibatches of 100 datapoints and one latent sample per datapoint, AEVB reached a higher estimated lower bound than wake-sleep in every Figure 2 configuration on MNIST and Frey Face.

Why posterior inference is hard at scale

The study asks how approximate inference and learning can be carried out efficiently in directed probabilistic models whose continuous latent variables or parameters have intractable posteriors. The usual variational Bayes route optimizes an approximation to the posterior, but mean-field methods need closed-form expectations under that approximation, and those expectations are generally intractable.

The authors do not assume the common simplifications for the marginal or the posterior. They target three cases: the marginal likelihood integral cannot be evaluated or differentiated, the true posterior is intractable so EM cannot be used, and the integrals needed by a mean-field algorithm are also intractable. The model family is assumed to have prior and likelihood densities that are differentiable almost everywhere with respect to both the parameters and the latent variable, and the true parameters and latent values are unobserved.

The second obstacle is dataset size. When batch optimization is too costly, updates have to come from small minibatches or single datapoints. Sampling-based methods such as Monte Carlo EM would be too slow in this regime, because each datapoint needs an expensive sampling loop.

The variational bound and its gradient problem

The log marginal likelihood of each datapoint splits into a KL divergence between the approximate and true posteriors plus a term that is a lower bound on the marginal likelihood. \[\log p_\theta(x^{(i)}) = D_{KL}\big(q_\phi(z|x^{(i)})\,\|\,p_\theta(z|x^{(i)})\big) + \mathcal{L}(\theta,\phi;x^{(i)})\] Because the KL divergence is non-negative, the second term bounds the log marginal likelihood from below.

It can be written as an expectation under \(q_\phi\) of the log joint minus the log approximate posterior, or equivalently as a negative KL to the prior plus the expected log likelihood. \[\mathcal{L}(\theta,\phi;x^{(i)}) = -D_{KL}\big(q_\phi(z|x^{(i)})\,\|\,p_\theta(z)\big) + \mathbb{E}_{q_\phi(z|x^{(i)})}\big[\log p_\theta(x^{(i)}|z)\big]\]

Both the variational parameters \(\phi\) and the generative parameters \(\theta\) must be differentiated through this bound. The standard Monte Carlo estimator of the gradient with respect to \(\phi\) weights the function value by the gradient of the log approximate posterior. The authors cite prior work for its very high variance and judge it impractical for their purposes.

Reparameterizing samples to get a differentiable estimator

The latent sample is written as a deterministic function of the datapoint and an auxiliary noise variable drawn from a fixed distribution. \[\tilde{z} = g_\phi(\epsilon, x), \quad \epsilon \sim p(\epsilon)\] Once the sample is a function of \(\phi\) and noise, an expectation under \(q_\phi(z|x)\) becomes an average over noise draws, and that average is differentiable with respect to \(\phi\).

\[\mathbb{E}_{q_\phi(z|x^{(i)})}[f(z)] \simeq \frac{1}{L}\sum_{l=1}^{L} f\big(g_\phi(\epsilon^{(l)},x^{(i)})\big), \quad \epsilon^{(l)}\sim p(\epsilon)\]

For a univariate Gaussian \(\mathcal{N}(\mu,\sigma^2)\), the sample can be written as \(z = \mu + \sigma\epsilon\) with \(\epsilon \sim \mathcal{N}(0,1)\), which is the example the authors use to make the idea concrete. The authors list three ways to find such a transformation: inverse CDF sampling with uniform noise, location-scale families with a standard auxiliary variable, and composition of simpler random variables.

When none of these applies, the authors point to approximations to the inverse CDF whose cost is comparable to evaluating the density.

Applying this to the variational bound gives the generic SGVB estimator, which averages the difference between the log joint and the log approximate posterior over \(L\) noise draws. \[\tilde{\mathcal{L}}^{A}(\theta,\phi;x^{(i)}) = \frac{1}{L}\sum_{l=1}^{L}\Big[\log p_\theta(x^{(i)},z^{(i,l)}) - \log q_\phi(z^{(i,l)}|x^{(i)})\Big], \quad z^{(i,l)} = g_\phi(\epsilon^{(i,l)},x^{(i)})\] When the KL term can be integrated analytically, a second estimator samples only the reconstruction term, and the authors expect it to have less variance than the generic one.

\[\tilde{\mathcal{L}}^{B}(\theta,\phi;x^{(i)}) = -D_{KL}\big(q_\phi(z|x^{(i)})\,\|\,p_\theta(z)\big) + \frac{1}{L}\sum_{l=1}^{L}\log p_\theta(x^{(i)}|z^{(i,l)})\] For a dataset of N datapoints, a minibatch of M datapoints gives an estimate of the full bound by scaling the minibatch sum by N/M. \[\mathcal{L}(\theta,\phi;X) \simeq \frac{N}{M}\sum_{i=1}^{M}\tilde{\mathcal{L}}(\theta,\phi;x^{(i)})\] The authors report that a single sample per datapoint, L = 1, was enough as long as the minibatch was large enough, for example M = 100.

Training the recognition model with AEVB

AEVB uses the SGVB estimator to fit a recognition model, which then gives an approximate posterior for a datapoint in one pass. Because posterior inference for each datapoint becomes a simple forward computation, the method avoids expensive per-datapoint iterative schemes such as MCMC.

Each iteration draws a random minibatch from the full dataset and draws noise samples from \(p(\epsilon)\). It then computes the gradients of the minibatch estimator with respect to both the generative and the recognition parameters, and updates them with a stochastic optimizer such as SGD or Adagrad. The loop runs until the parameters converge, and the algorithm returns both sets of parameters.

The KL term of the bound can often be integrated analytically, so only the expected reconstruction error needs sampling. In that form the KL term acts as a regularizer that keeps the approximate posterior close to the prior. In the generic objective, the first term plays the role of that regularizer and the second term is an expected negative reconstruction error, which links the method to auto-encoders.

A Gaussian encoder and MLP decoder as an example

The prior over the latent variables is a centered isotropic Gaussian, \(p_\theta(z) = \mathcal{N}(z;0,I)\), so the prior has no parameters of its own. The decoder \(p_\theta(x|z)\) is a multivariate Gaussian for real-valued data or a Bernoulli for binary data, with distribution parameters computed from \(z\) by a multilayer perceptron with a single hidden layer.

The encoder is a diagonal-covariance Gaussian whose mean and standard deviation are outputs of an encoding MLP that takes \(x\) as input. \[\log q_\phi(z|x^{(i)}) = \log \mathcal{N}(z;\mu^{(i)},\sigma^{2(i)}I)\]

Samples are formed by shifting and scaling the noise with the encoder outputs, \(z^{(i,l)} = \mu^{(i)} + \sigma^{(i)} \odot \epsilon^{(l)}\) with \(\epsilon^{(l)} \sim \mathcal{N}(0,I)\), where \(\odot\) is the element-wise product. Because both the prior and the encoder are Gaussian, the KL term has a closed form, and the estimator for one datapoint becomes a sum over the J latent dimensions plus a sampled reconstruction term.

\[\mathcal{L}(\theta,\phi;x^{(i)}) \simeq \frac{1}{2}\sum_{j=1}^{J}\Big(1 + \log\big((\sigma^{(i)}_j)^2\big) - (\mu^{(i)}_j)^2 - (\sigma^{(i)}_j)^2\Big) + \frac{1}{L}\sum_{l=1}^{L}\log p_\theta(x^{(i)}|z^{(i,l)})\]

The diagonal Gaussian form is described as a simplifying choice rather than a restriction of the method, since the authors assume the true posterior is only approximately Gaussian with an approximately diagonal covariance. In the Gaussian-encoder setting, the reconstruction term is a Bernoulli or Gaussian MLP log likelihood, depending on the data type.

How the approach relates to earlier work

The wake-sleep algorithm is the closest prior method for continuous latent variable models, since it also trains a recognition model.

Other work reduced the variance of the naive gradient with control variate schemes, and an efficient variant of stochastic variational inference used a similar reparameterization to learn natural parameters of exponential-family approximations. A link between linear auto-encoders and linear-Gaussian generative models had been known. Earlier work showed that PCA is the maximum-likelihood solution of a special linear-Gaussian case with infinitesimally small noise.

Work on autoencoders showed that the training criterion of unregularized autoencoders corresponds to maximizing a lower bound on the mutual information between input and latent code, and that this criterion alone does not yield useful representations. The SGVB objective already includes a regularization term from the variational bound, so it does not need the extra regularization hyperparameter that regularized autoencoders require.

A recognition model was earlier used for efficient learning with Deep Boltzmann Machines, but those methods target unnormalized or sparse coding models, whereas AEVB targets general directed models. DARN also learns a directed model with an auto-encoding structure, but for binary latent variables only, and a later paper made the same connection with the reparameterization trick independently of this work.

Lower bound comparison with wake-sleep

The models are trained on MNIST and on the Frey Face dataset, and the comparison uses the same encoder for AEVB and wake-sleep, with the encoder and decoder having an equal number of hidden units. For Frey Face, which is continuous, the decoder has Gaussian outputs whose means are constrained to (0, 1) by a sigmoidal activation. The generative models used 500 hidden units for MNIST and 200 hidden units for Frey Face, a choice the authors say rests on prior autoencoder work and that they expect to be not very sensitive.

Training uses Adagrad with a global stepsize chosen from {0.01, 0.02, 0.1} using training-set performance in the first iterations, with parameters initialized from N(0, 0.01) and minibatches of 100 datapoints with one sample per datapoint. Parameters are updated by stochastic gradient ascent on the estimator, with a small weight decay that corresponds to a standard normal prior on the parameters, which the authors describe as approximate MAP estimation.

Across the panels of Figure 2, with latent dimensionality Nz of 3, 5, 10, 20 and 200 on MNIST and 2, 5, 10 and 20 on Frey Face, the authors report that AEVB converged much faster than wake-sleep and reached a better solution in every configuration. Adding latent variables did not cause overfitting in these runs, which the authors attribute to the regularizing effect of the variational bound.

The estimator variance was below 1 and omitted from the plots. The authors report about 20-40 minutes of computation per million training samples on an Intel Xeon CPU with an effective 40 GFLOPS.

Marginal likelihood against Monte Carlo EM

The marginal likelihood is estimated with a sampling-based estimator that works only for a low-dimensional latent space, so the comparison uses three latent variables. The encoder and decoder use neural networks with 100 hidden units each on MNIST, and the AEVB and wake-sleep models are compared with Monte Carlo EM that uses Hybrid Monte Carlo sampling.

Convergence is compared for a small training set of 1000 points and a large one of 50000 points.

The figure shows marginal log-likelihood against the number of training samples evaluated, in millions, for AEVB, wake-sleep and Monte Carlo EM, on train and test curves. The text gives no numeric ranking of the three methods. Monte Carlo EM is not an online algorithm and, unlike AEVB and wake-sleep, the authors state it cannot be applied efficiently to the full MNIST dataset.

Limitations

The marginal likelihood estimate became unreliable for higher-dimensional latent spaces, so the reported marginal likelihood comparison is limited to 3 latent variables. Monte Carlo EM is excluded from the online and full-dataset setting in this comparison, so only AEVB and wake-sleep are compared there.

Experiments use only MNIST and Frey Face, with wake-sleep as the baseline for the lower bound and wake-sleep and Monte Carlo EM for the marginal likelihood. Wake-sleep also applies to models with discrete latent variables, which AEVB does not address. Hierarchical deep architectures, time-series models, variational inference on the global parameters, and supervised models with latent variables are listed as future work and were not tested.

Paper info

Authors
Diederik P Kingma, Max Welling
Venue
arXiv · Preprint
First published
2013-12-20
Added
2026-10-20
Updated
2022-12-10
Version
v11
arXiv
1312.6114
Category
stat.ML · cs.LG
Original paper terms
arXiv non-exclusive 1.0
What we show
Paper info and commentary

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

Quote from the paper

Diederik P Kingma, Max Welling (2013). Auto-Encoding Variational Bayes. arXiv:1312.6114v11. https://arxiv.org/abs/1312.6114v11

BibTeX
@misc{kingma2013auto,
  title = {{Auto-Encoding Variational Bayes}},
  author = {Diederik P Kingma and Max Welling},
  year = {2013},
  eprint = {1312.6114},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1312.6114v11}
}

See related papersBrowse other papers

Paper preview
Account security

Connect Google account

If you connect a Google account, you can sign in with it too.

Refivu

Delete account

Refivu
Refivu

Sign up