Every model that reasons about hidden things hits the same wall. Bayes' theorem says the probability of a cause given the data is proportional to the likelihood times the prior, divided by the probability of the data. That denominator, the evidence, means adding up the likelihood over every possible configuration of every hidden variable. With a thousand latent variables, that is a sum over a space larger than any computer can traverse. In the words of Blei, Kucukelbir and McAuliffe's 2016 review, "one of the core problems of modern statistics is to approximate difficult-to-compute probability densities."
Variational inference (VI) is the standard workaround, and it is the engine under the hood of variational autoencoders, most topic models, and, on paper, the diffusion models behind today's image generators. The idea is simple to state: stop computing the posterior and start approximating it. Trade an impossible integral for an optimization you can run on a GPU.
From integration to optimization
The trick is to pick a family of simple distributions first. Suppose the true posterior over latent variables z given data x is p(z|x), which you cannot write down. Choose a tractable family q, say independent Gaussians with learnable means and variances, then hunt for the member of that family that sits closest to the target. Closeness is measured by Kullback-Leibler divergence.
KL divergence also hides the intractable evidence term, which is constant with respect to q. Drop it and what remains is the variational lower bound, usually called the ELBO (evidence lower bound):
ELBO(q) = E_q[ log p(x|z) ] - E_q[ log q(z) / p(z) ]
Read it as a tug of war between two familiar losses. The first term wants the approximate posterior to place its samples on latents that explain the data, a reconstruction cost. The second penalizes q for drifting away from the prior, a regularization cost. Because the log evidence decomposes exactly as the ELBO plus a KL divergence, the bound holds for every q, and maximizing the ELBO simultaneously pushes the approximation toward the true posterior and the log evidence up.
The payoff, per the review, is speed: variational methods "tend to be faster than classical methods, such as Markov chain Monte Carlo sampling." Where MCMC burns millions of samples to stalk a distribution, VI settles for a fit.
A short history, from helium to Wikipedia
Variational bounds predate machine learning. Richard Feynman used one in his 1972 textbook Statistical Mechanics: A Set of Lectures to approximate the free energy of quantum systems, replacing an uncomputable partition function with an optimizable bound over trial distributions. That is the same move: an intractable log-sum-exp replaced by a family of easy surrogates.
Geoffrey Hinton brought the physics into neural networks in the early 1990s. His 1993 COLT paper with Drew van Camp proposed minimizing a description-length bound as a way to keep networks simple, and the wake-sleep algorithm, published with Dayan, Frey and Neal in Science in 1995, learned a generative model and a recognition model in alternating phases: wake, where data drives the recognition weights and the generator is trained to reconstruct; sleep, where the generator hallucinates and the recognizer is trained to guess causes. It was a two-network variational game a decade before anyone called it that.
The scale moment came in 2013. Hoffman, Blei, Wang and Paisley showed that stochastic gradient steps on the ELBO let topic models run at corpus scale: 300,000 Nature articles, 1.8 million New York Times articles, 3.8 million Wikipedia articles, where traditional batch variational inference could only handle a smaller subset. Bayesian inference stopped being a small-data craft.

The reparameterization trick
One problem remained. Training q requires gradients through a sampling operation, and the gradient of an expectation whose distribution is itself the thing being learned is awkward. Kingma and Welling's December 2013 paper fixed it with a one-line change of variables. Instead of drawing z from a Gaussian with parameters mu and sigma, draw fixed noise epsilon and construct z = mu + sigma * epsilon. The randomness is now upstream of everything differentiable, so backpropagation flows normally. Rezende, Mohamed and Wierstra published the same device independently as "stochastic backpropagation."
The alternative was the score-function route, the REINFORCE estimators Williams formalized in a 1992 Machine Learning paper: unbiased gradients, but noisy enough that deep latent-variable models trained with them crawl. Reparameterization cut the variance enough to make variational autoencoders a default building block. The same distinction reappears today as the gap between policy-gradient RL and anything with a differentiable path: reparameterization is the trick, everywhere.
What you actually get
The Kingma-Welling recipe, an encoder network fitting the approximate posterior and a decoder network defining the likelihood, is the VAE. Its practical output is a compressed, smooth latent space: useful for representation learning and, via the discrete cousin, for compression. Google's VQ-VAE in 2017 replaced the continuous Gaussian latent with a learned codebook of discrete vectors, which sidestepped posterior collapse when paired with a powerful autoregressive decoder, and demonstrated generation of images, video and speech plus unsupervised learning of phonemes. That discrete-latent design is a direct ancestor of the learned tokenizers behind modern speech and image models.
The diffusion models powering text-to-image systems are also variational creatures. Sohl-Dickstein et al. in 2015 built the model from nonequilibrium thermodynamics, destroying data structure with a forward diffusion and learning a reverse process; the training objective is a bound on the log likelihood over a chain of latent variables. Calvin Luo's 2022 tutorial derives this cleanly, showing variational diffusion models are a special case of a Markovian hierarchical VAE where three assumptions make the ELBO tractable, and that optimizing it reduces to predicting noise. The denoising objective in DALL-E 2 or Imagen, read correctly, is a variational lower bound wearing a different hat.

The bill
VI buys speed with honesty. Because the approximation lives in a restricted family, the fitted distribution tends to understate uncertainty: Blei's review states flatly that "variational inference generally underestimates the variance of the posterior density; this is a consequence of its objective function," while noting the underestimation may be acceptable depending on the task. If you want calibrated credible intervals, sampling still wins.
And the objective's failure modes have their own literature. The canonical complaint about VAEs is posterior collapse, where latent dimensions end up matching the prior and get ignored entirely. Lucas et al. put a dent in the usual explanation: through a linear-VAE analysis tied to probabilistic PCA, they proved the ELBO introduces no spurious local maxima beyond those already present in the exact marginal likelihood, so the collapse blame belongs to the model's likelihood landscape and noise scale, not the variational bound itself. When the approximation is exact, VI optimizes the real objective; when it misbehaves, the model deserves most of the scolding.
That is the bargain to remember. An uncomputable integral replaced by a bound you can backpropagate through, learned two-network games since 1995, noise re-routed around gradients since 2013, and a diffusion loss that is secretly an ELBO. The models that generate your images and the codecs that tokenize your audio all run on the old physicist's move: when you cannot sum over all possibilities, optimize over the easy ones that imitate them best.
Sources
- Variational Inference: A Review for Statisticians, Blei, Kucukelbir, McAuliffe (JASA 2018; arXiv 1601.00670)
- Statistical Mechanics: A Set of Lectures, Richard Feynman (W. A. Benjamin, 1972)
- Keeping the neural networks simple by minimizing the description length of the weights, Hinton and van Camp (COLT 1993)
- The "Wake-Sleep" Algorithm for Unsupervised Neural Networks, Hinton, Dayan, Frey, Neal (Science, 1995); author PDF
- Stochastic Variational Inference, Hoffman, Blei, Wang, Paisley (JMLR 2013)
- Auto-Encoding Variational Bayes, Kingma and Welling (ICLR 2014)
- Stochastic Backpropagation and Approximate Inference in Deep Generative Models, Rezende, Mohamed, Wierstra (ICML 2014)
- Simple statistical gradient-following algorithms for connectionist reinforcement learning, Williams (Machine Learning, 1992)
- Neural Discrete Representation Learning, van den Oord, Vinyals, Kavukcuoglu (NeurIPS 2017)
- Deep Unsupervised Learning using Nonequilibrium Thermodynamics, Sohl-Dickstein et al. (ICML 2015)
- Understanding Diffusion Models: A Unified Perspective, Calvin Luo (arXiv 2022)
- Don't Blame the ELBO! A Linear VAE Perspective on Posterior Collapse, Lucas et al. (NeurIPS 2019)
