A plain autoencoder learns to squeeze an input, such as a photo, into a short code and then rebuild it. That is useful for compression, but the codes can be scattered unevenly, so picking a random code and decoding it often produces noise. A variational autoencoder changes the encoder’s job. Instead of one exact code, it outputs a small probability distribution for each input, and training pushes those distributions to fit together into one smooth, well-organized latent space.
Everyday example. Train a VAE on faces and nearby points in its latent space decode to similar faces. Move slowly from one point to another and the decoded face changes gradually, perhaps from smiling to neutral. Sample a fresh point and the decoder produces a face that was never in the training set. That is what makes it a generative model rather than only a compressor.
How it is trained. Kingma and Welling’s 2013 paper balances two goals: rebuild the input accurately, and keep each encoded distribution close to a simple standard shape. Their “reparameterization trick” made the random sampling step trainable with ordinary backpropagation.
Where it shows up now. VAE samples on their own tend to look blurry next to diffusion models or GANs. VAEs are still widely used as components. Many latent diffusion image generators use a VAE-style encoder to shrink images into a compact latent space, run the expensive generation there, and use the decoder to turn the result back into pixels. Researchers also use VAEs for anomaly detection and for generating molecules.
Why it matters. The VAE is one of the main families of generative AI. It is a clear introduction to the idea that a model can learn a map of possible data and then draw new examples from it. See also generative vs. discriminative models.
Sources
- Kingma and Welling: Auto-Encoding Variational Bayes — 2013 paper that introduced the variational autoencoder and the reparameterization trick used to train it; checked October 24, 2026
- Goodfellow, Bengio and Courville: Autoencoders — Deep Learning textbook chapter on autoencoders, including their use as generative models; checked October 24, 2026