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

Tutorial on Variational Autoencoders

Variational autoencoders learn a proposal network that makes sampling-based likelihood estimates practical

  • Problem Sampling latent values from the prior wastes most draws, because for nearly every value the likelihood of the data is almost zero. The Gaussian output makes this worse, so only samples very close to the input count.
  • Method The VAE trains a second network, Q(z|X), to propose latent codes for each input and optimizes a bound on log P(X). It reparameterizes the sampling step so gradients can reach the encoder.
  • Results In one dimension, the authors show that the gap between the bound and the true likelihood vanishes as the output noise shrinks. They report no multi-dimensional proof.

Why sampling from the prior is too slow

The most direct estimate of P(X) draws many z values from the prior and averages P(X|z) over them. That estimate needs a very large number of draws in high-dimensional spaces, because for most z the term P(X|z) is almost zero. The Gaussian output makes this worse, since the negative log probability grows with squared pixel distance, so only samples very close to X count as evidence.

The handwritten digit example makes the problem concrete. A correct digit shifted by half a pixel sits at a squared distance of .2693 from the target, while a wrong digit sits at only .0387. To reject the wrong digit, sigma would have to be so small that the model must match the target more closely than the shifted correct digit does. A better similarity metric would help, but such metrics are hard to engineer for vision and need labels that mark which datapoints are alike.

Instead, the VAE keeps the pixel metric and changes the sampling procedure.

Sampling where the latent codes are likely

The key idea is to learn a second network Q(z|X) that proposes the z values likely to have produced a given X, and to compute P(X) from those values. Q can be any distribution in principle, but it is useful when it depends on X. The starting point is an identity that ties the expectation under Q to log P(X): \( \log P(X) - D[Q(z|X)\|P(z|X)] = E_{z\sim Q}[\log P(X|z)] - D[Q(z|X)\|P(z)] \).

The left side is the quantity we want to raise, minus a gap term that measures how far Q is from the true posterior. The right side can be optimized with stochastic gradient descent once Q is chosen well.

Because the gap term is never negative, the right side is a lower bound on log P(X). The same identity makes the posterior P(z|X) usable, since Q(z|X) stands in for it. Read from left to right, Q encodes X into z and P decodes z back into X, which is why the framework resembles an autoencoder. Helmholtz Machines use nearly the same mathematics, but they sum over a discrete latent space instead of integrating over a continuous one.

That discrete choice blocks the transformations that make gradient descent workable in VAEs.

Turning the bound into a trainable network

The authors choose Q(z|X) as a Gaussian whose mean µ(X) and diagonal covariance Σ(X) come from neural networks. The expectation over z is approximated with one sample of z per X, the usual move in stochastic gradient descent.

Sampling z directly blocks gradients, because the parameters of Q sit inside an operation that has no gradient. The reparameterization trick fixes this by drawing noise ε from N(0, I) and computing \( z = \mu(X) + \Sigma^{1/2}(X)\,\epsilon \). The randomness now sits in an input, so for a fixed X and ε the network is deterministic and continuous in both sets of parameters.

This trick needs a continuous Q, so a discrete Q(z|X) can't be trained this way.

Generating samples and scoring test points

At test time the encoder is removed, z is drawn from N(0, I), and the decoder turns it into a sample. The sampling path is the decoder alone, which makes the test-time network simpler than the training network. Computing log P(X) exactly is not tractable, so the bound serves as the score for a test point. The authors note that sampling z from Q gives an estimator that converges much faster than sampling from the prior.

What the bound hides and how it is regularized

The bound is tight only when the gap term goes to zero, and the authors don't know a general guarantee of that. Any f that maximizes log P(X) fits equally well, so the question becomes whether one such f also makes P(z|X) Gaussian. The authors say they know no general proof, but they show in one dimension that such an f exists.

The authors read the terms in bits: the KL term to the prior is the extra information needed to move from a prior sample to a sample from Q. The reconstruction term is the number of bits needed to recover X from z, and the gap term is subtracted as a penalty for a suboptimal code.

Unlike a sparse autoencoder, a VAE does not in general have a regularization weight to set by hand. Rescaling the prior to N(0, λI) turns out to leave the model unchanged, since the scale can be absorbed into the encoder and decoder. For a Gaussian output, the noise σ does act as a weight between the reconstruction term and the KL term. With a binary X and a Bernoulli output, that weight disappears.

One-dimensional proof of zero approximation error

The authors assume the true density is positive everywhere, infinitely differentiable, and has bounded derivatives. They let the output noise σ go to zero, so the decoder becomes \( P_\sigma(X|z)=\mathcal N(X\mid f(z),\sigma^2) \) with z drawn from N(0, 1).

Then G(z) is uniform on (0, 1), so f(z) follows the true distribution, and the model density converges to it as σ goes to 0.

The gap term is invariant to affine changes of the sample space, so the authors rescale it to a σ-free Q0 and compare densities. They argue that the rescaled posterior converges to Q0 as σ goes to 0, so the gap term goes to zero. The result stays in one dimension, and the authors suggest the technique might extend to several dimensions but leave that for future work.

They also warn that a small σ can leave gradients badly scaled, which matters in practice.

MNIST samples and latent size

The authors adapted the basic MNIST AutoEncoder example from Caffe rather than using a published VAE architecture, and added ReLU and ADAM. Because MNIST pixels lie between 0 and 1, the authors used a sigmoid cross entropy loss for P(X|z).

Most generated digits look realistic, but a number of them fall between two classes, such as a shape between a 7 and a 9. They also note that the samples are hard to judge, since no simple measure of distance from the training set exists.

The model is fairly insensitive to the latent size, but fewer than 4 z dimensions gave noticeably worse results. Results with 1,000 z dimensions were good, while 10,000 degraded them. The authors attribute the degradation at very large sizes to stochastic gradient descent struggling to keep the KL term low.

Ambiguous digit completion with a CVAE

A standard regressor minimizes the distance to one answer, so when several digits are plausible its output lands between them. A CVAE instead conditions the whole generative process on the input, so the model samples P(Y|X) by drawing z from N(0, I).

The authors first meant to complete half of each digit, but a regressor did about as well because it can memorize MNIST. They made the task more ambiguous by giving only one central column of pixels.

The regressor blurs its output across the possible digits, though it is sometimes confidently wrong, which the authors read as overfitting. The CVAE generally picks one specific digit and produces it without blur. The comparison is visual, and the text reports no score for either model.

Limitations

The proof covers only one dimension, and the authors left the multi-dimensional case for future work. The reparameterization trick needs a continuous Q, so discrete latent variables are not covered by this route.

Sample quality is judged by eye, since no simple similarity measure is available. The final training run was done once, though training was restarted 5 times to find the learning rate. The binarized cross entropy loss is not exactly the framework the authors describe.

The regressor's overfitting and the latent-size explanation are the authors' interpretations, not controlled tests.

Paper info

Authors
Carl Doersch
Venue
arXiv · Preprint
First published
2016-6-19
Added
2026-11-12
Updated
2021-1-3
Version
v3
arXiv
1606.05908
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

Carl Doersch (2016). Tutorial on Variational Autoencoders. arXiv:1606.05908v3. https://arxiv.org/abs/1606.05908v3

BibTeX
@misc{doersch2016tutorial,
  title = {{Tutorial on Variational Autoencoders}},
  author = {Carl Doersch},
  year = {2016},
  eprint = {1606.05908},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1606.05908v3}
}

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