Variational Autoencoder (VAE)
Last Updated: July 29, 2026 | By Mihail Sebastian | AI Dictionary
A generative model that encodes data as probability distributions in a latent space, so sampling from that space decodes into new, realistic data points.
What is a Variational Autoencoder (VAE)?
A variational autoencoder (VAE) is a generative model that encodes data as probability distributions in a compressed latent space, then decodes samples from that space into new data resembling its training set.
It takes the compress-and-reconstruct design of the autoencoder and rebuilds it for generation. Where an ordinary autoencoder answers “what does this data look like compressed?”, a VAE answers “what else could this data have looked like?”
How a VAE Works
The encoder does not map an input to a single code. It outputs a mean and a variance, defining a small probability distribution for that input, and the decoder draws a point from the distribution to reconstruct the data.
Training balances two pressures. The reconstruction term demands accurate rebuilds, while a second term pushes every distribution toward a shared standard shape, so the latent space stays smooth and connected. Smoothness is what makes generation work: any sampled point decodes into something plausible.
Variational Autoencoder vs Autoencoder
The practical difference: a VAE generates data, an autoencoder compresses it. A standard autoencoder maps each input to one fixed point in latent space, which serves reconstruction well but leaves the space between points meaningless; sampling there produces junk. A VAE’s distributions fill the space smoothly, so any sample decodes into coherent new data.
| Criterion | Variational Autoencoder | Autoencoder |
|---|---|---|
| Latent code | A probability distribution per input | One fixed point per input |
| Main use | Generating new data | Compression, denoising, anomaly detection |
| Same input twice | Output varies with each sample | Identical output |
| Training objective | Reconstruction error plus a term that keeps the latent space smooth | Reconstruction error only |
Example of a VAE
Train a VAE on a large dataset of face photographs. The encoder learns to place each face in latent space along directions that loosely track pose, lighting, and facial features. Sample a random point and the decoder returns a face that belongs to no one.
Encode two real people and walk the line between their codes: the decoder produces a gradual morph from one face into the other. Compared with a GAN, a VAE’s images run blurrier but its training is far more stable, the standing trade-off between the two generative designs.
Related AI terms: Autoencoder · Generative Adversarial Network · Generative AI · Latent Space
Did you like the Variational Autoencoder (VAE) gist?
Learn about 250+ need-to-know artificial intelligence terms in the AI Dictionary.
Mihail Sebastian — Writes about AI governance, regulation, and the technology behind them. Placeholder bio — replace with a real credential line. About