Variational Autoencoder
An autoencoder whose latent space you can actually sample from — the principled generative model that lost to GANs on looks and won by being useful.
When not to use it
- When sharpness is the product. Blurriness is structural under MSE. Diffusion is the answer now.
- When you only need compression. A plain autoencoder is simpler and reconstructs better; the KL term costs you fidelity you didn't need.
- With a very powerful decoder, carelessly. Posterior collapse means the latent gets ignored and you won't get an error.
- When a pretrained embedding exists. Usually better than a latent space you trained yourself.
Reach for something else instead
- Diffusion models — better generation, and they use a VAE internally anyway.
- Plain autoencoder — for pure compression, sharper and simpler.
- GAN — sharper, unstable, largely superseded.
- VQ-VAE — discrete latents, so a transformer can model them. The bridge to token-based generation.
Read more on the blog
- How AI generates images: from noise to a pictureType a sentence, get an image that never existed. The technology behind it, diffusion, is one of the most simple ideas in modern AI: teach a model to remove noise, then hand it pure static and let it sculpt. Here's how it actually works, how text steers it, and the 2026 rivalry reshaping the field.
- What is generative AI? The complete guideGenerative AI is the technology behind the chatbots, image makers, and video tools of the last few years, and it is usually explained as if each were a separate trick. Underneath, they share one idea: learn the probability distribution of some kind of data, then sample from it to make new examples. This guide explains what generative AI is, how it works, the model families, and where it really falls short.
- How AI generates video: from noise to motionText-to-video went from a novelty to convincing minute-long clips with synchronised audio in about two years. The technology behind it extends image generation into time, and the hardest part is not making a frame look good but making a thousand frames hang together. Here is how it works.
A VAE learns a smooth latent space you can sample from.
Like an autoencoder, a variational autoencoder compresses and reconstructs — but it maps each input to a distribution in latent space rather than a single point, and forces that space to be smooth and continuous. That smoothness is what lets you sample new points and decode them into novel, plausible outputs, making it a true generative model.
Further reading
- Kingma & Welling (2014), Auto-Encoding Variational Bayes — the paper; the ELBO and the reparameterisation trick.
- Higgins et al. (2017), β-VAE: Learning Basic Visual Concepts with a Constrained Variational Framework — the disentanglement dial, and its cost.
- van den Oord, Vinyals & Kavukcuoglu (2017), Neural Discrete Representation Learning — VQ-VAE; discrete latents, and the bridge to token-based generation.
Primary sources, listed so you can check the claims on this page rather than take them on trust.
Where people go wrong
- Trying to tune away the blurriness. It's the MSE objective averaging plausible outputs. Change the loss, not the learning rate.
- Not watching for posterior collapse. KL going to zero looks like convergence and means the latent was abandoned.
- Treating β as free. It trades latent structure against reconstruction, directly.
- Using a VAE for compression when an autoencoder would reconstruct better.
At a glance
Often compared with
Where this sits
15 concepts come first. Understanding it opens up 5 more.
Computed from the prerequisite graph, not assigned. How this works