The Evidence Lower Bound
The ELBO is a quantity you can actually compute that sits below the number you actually want, and pushing it up is how variational methods approximate a posterior distribution nobody can integrate exactly.
Prerequisites: Bayesian Inference, KL Divergence
Suppose you fit a model with a hidden variable — a regime nobody labelled, a factor nobody observed directly. Bayes' rule says the right belief about that hidden variable, given the data, is the posterior . Writing it down exactly requires dividing by , the "evidence": the total probability of the data averaged over every possible value of the hidden variable. For anything beyond a toy model, that average is an integral over a space too large to sum, and it has no closed form. You know the rule but cannot evaluate it.
The analogy: appraising a house you cannot fully inspect
You want to know a house's true value. You cannot get inside every room, so an exact appraisal is out of reach. What you can do is walk the perimeter, check the neighbourhood, and build a conservative valuation from what's visible — a number you can defend as a floor: "it's worth at least this much." A better inspector, with a richer checklist, pushes that floor closer to the true value without ever proving it exact.
The evidence lower bound, or ELBO, is that floor. You cannot compute , the log-evidence, directly. You can compute a related quantity that is always less than or equal to it, and the closer your approximating "checklist" gets to reality, the tighter that floor becomes.
Building the bound
Introduce an approximating distribution — a guess at the posterior, chosen from a family simple enough to compute with, such as a Gaussian with parameters you control. A short algebraic identity (splitting using ) gives:
In words: the true log-evidence splits into two pieces. The first piece — the ELBO — is an average, under your guess , of the log joint probability of data and hidden variable minus the log of your guess itself. The second piece is the KL Divergence between your guess and the true posterior, which measures how wrong your guess is. Crucially, KL divergence is never negative, so the ELBO can never exceed : it is a genuine lower bound, and the gap between them is exactly your guess's error.
In words: reward for placing mass where the data and hidden variable are jointly plausible (first term), and reward it separately for not collapsing to a single point — the second term is 's own entropy, and a confident, low-entropy guess that's wrong gets penalised harder than a spread-out one. Since is a fixed number that does not depend on , maximising the ELBO over is mathematically identical to minimising the KL gap. You never touch the intractable quantity directly; you climb a bound instead, and the true posterior is what you land on when the family containing is rich enough to reach it exactly.
Worked example 1: a two-outcome hidden variable, by hand
A hidden variable takes value 1 (a "risk-on" regime) or 0 ("risk-off") with true posterior after seeing today's data — but suppose, for illustration, you cannot compute this directly and only know the unnormalised joint values and , so the true evidence is , giving .
Guess , — a deliberately imperfect approximation. Compute the ELBO term by term:
Check: , so the bound holds, with a gap of — that gap is , and it is nonzero because doesn't match the true .
Worked example 2: tightening the guess
Now try , — matching the true posterior exactly.
That equals exactly. When matches the true posterior, the KL gap vanishes and the floor touches the ceiling — this is the whole mechanism variational inference exploits: search over for whatever maximises the ELBO, and you are, without ever computing , searching for the best available approximation to .
What this means in practice
Nobody in production computes an ELBO by hand over two outcomes — the real payoff is when is continuous and high-dimensional, such as the latent factors in a variational autoencoder used for anomaly detection on order-book snapshots, or the latent regime in a state-space model of returns. There, truly has no closed form, and optimising the ELBO with gradient ascent (via the reparameterisation trick, so gradients can flow through the sampling step) is the only practical route to an approximate posterior. It also underlies model selection: the ELBO is sometimes used as a cheap stand-in for the evidence when comparing model families, since a model whose best achievable ELBO is higher tends to explain the data better — though this comparison inherits any bias from how tight each model's bound actually is.
Watch how the tracked quantity climbs and settles as more updates accumulate — the ELBO under gradient ascent behaves the same way, rising each step and flattening out once stops improving, never above the true log-evidence.
The ELBO is not an approximation to in the sense of being close by default — it is a provable lower bound, tight only when your approximating family can actually represent the true posterior. Maximising it is a proxy objective that happens to be exactly equivalent to minimising the one error you actually care about.
The classic confusion: assuming a rising ELBO during training always means the model is "getting better" in the sense of explaining the data better. In plain variational inference the model is fixed and only moves, so a rising ELBO purely means is tracking the true posterior more closely — good. But in joint training (as in a variational autoencoder, where 's parameters and 's parameters are optimised together), the ELBO can rise because itself is changing to make the data easier to explain, which is a different and sometimes undesirable effect. Always ask which side of the bound is moving before reading meaning into the number going up.
Practice in interviews
Further reading
- Blei, Kucukelbir & McAuliffe, Variational Inference: A Review for Statisticians
- Bishop, Pattern Recognition and Machine Learning, ch. 10