Models and training

Variational autoencoder (VAE)

stable definition
Machine-readable Download Markdown

Definition

A variational autoencoder is a latent-variable generative model with an encoder, a prior over latent variables, and a decoder. For an input x, the encoder approximates a distribution over latent z rather than producing only one fixed code. The decoder models how an observation could be generated from z.

Training maximizes an evidence lower bound. One term rewards reconstruction or data likelihood. A second term, usually a Kullback-Leibler divergence, keeps the approximate posterior near the chosen prior. The balance creates a latent space that can be sampled, but it can also trade reconstruction detail for regularity.

The reparameterization trick expresses a stochastic latent sample as a differentiable transformation of encoder outputs and independent noise. That lets gradients pass through the sampling operation. At generation time, the model samples z from the prior and sends it through the decoder.

Foundational formulation

Diederik P. Kingma and Max Welling's 2013 preprint "Auto-Encoding Variational Bayes" presented the auto-encoding variational Bayes estimator and the model now commonly called a variational autoencoder. It is a foundational source for the formulation used here.

A VAE can fail to use its latent variables when a powerful decoder models the data without them, a problem called posterior collapse. A smooth-looking latent interpolation also does not prove that individual coordinates map cleanly to human concepts.

Distinguish it from nearby terms

A conventional autoencoder can learn a deterministic code and reconstruction loss without a probabilistic prior. A VAE specifies a latent probability model and a variational objective. A GAN trains through competition with a discriminator rather than an encoder-based likelihood bound.

Check your understanding

Reconstructions are sharp, but samples from the prior are poor. Which part of the objective may have allowed encoded points to drift away from the region sampled at generation time?