Definition
A Variational Autoencoder (VAE) is a generative model that learns a probabilistic mapping between high-dimensional data and a lower-dimensional latent space. Introduced by Kingma and Welling in 2013, it extends the classic autoencoder by encoding each input not as a single fixed point but as a probability distribution, which lets the model both reconstruct existing data and generate new, realistic samples.
Encoder and decoder
The encoder maps each input to a latent distribution, typically parameterised by a mean and variance of a Gaussian, rather than to a deterministic vector. A latent code is then sampled from that distribution and passed to the decoder, which reconstructs the original input. Because sampling is non-differentiable, VAEs use the reparameterisation trick to keep the network trainable by gradient descent.
Training objective
A VAE is trained to minimise two terms at once: a reconstruction loss that pushes decoded outputs to match the inputs, and a Kullback–Leibler (KL) divergence term that pulls the encoded latent distributions toward a prior — usually a standard normal. The KL term regularises the latent space so it is smooth and continuous, meaning nearby latent points decode to similar outputs. This is what makes generation possible: drawing a fresh latent vector from the prior and decoding it yields a plausible new sample.
VAEs are widely used for representation learning, anomaly detection, and as components inside larger generative pipelines (including the latent stage of some diffusion image models). For contrasting generative approaches, compare the Generative Adversarial Network (GAN), and see the encoder-decoder architecture it builds on.
In Simple Terms
A Variational Autoencoder (VAE) is a generative model that learns a probabilistic mapping between high-dimensional data and a lower-dimensional latent space. Introduced by Kingma and…
