Evidence lower bound

Also known as: ELBO · variational lower bound

On this page 7

The evidence lower bound (ELBO), also called the variational lower bound, is a quantity that is always less than or equal to the log marginal likelihood log p(x) of observed data under a model with latent variables. In probabilistic models, it is the objective function of variational inference: instead of computing an intractable posterior exactly, one chooses an approximate distribution q(z) and adjusts it to make the ELBO as large as possible.

Maximizing the ELBO does two things at once. It pulls the approximation toward the true posterior, and it raises a bound on the evidence, which makes it usable for learning model parameters. This dual role explains why the ELBO appears everywhere from classic mean-field methods to variational autoencoders and Bayesian neural networks in artificial intelligence.

How the ELBO is derived

The ELBO follows from a single identity that splits the log evidence into a bound and a gap. For any distribution q(z) over latent variables, log p(x) = ELBO(q) + KL(q(z) || p(z|x)), where the second term is the Kullback-Leibler divergence between the approximation and the exact posterior.

Because a KL divergence is never negative, the ELBO can never exceed log p(x). The gap between the two equals the KL divergence exactly, so maximizing the ELBO over q is equivalent to minimizing KL(q || p(z|x)) while the evidence stays fixed. An alternative derivation applies Jensen’s inequality to the logarithm of an expectation and reaches the same bound.

The ELBO can be written in several equivalent forms, and each one highlights a different interpretation, as the table shows.

FormExpressionInterpretation
Joint minus entropyE_q[log p(x, z)] + H[q]Fit the joint density while keeping q spread out
Reconstruction minus KLE_q[log p(x|z)] - KL(q(z) || p(z))Explain the data while staying close to the prior
Evidence minus gaplog p(x) - KL(q(z) || p(z|x))Bound tightness equals posterior approximation error
Equivalent forms of the evidence lower bound

What each term of the ELBO controls

In the reconstruction minus KL form, the ELBO expresses a trade-off between data fit and regularization. The expected log-likelihood rewards latent values that explain the observations, and the KL term to the prior penalizes approximations that drift far from prior beliefs.

The entropy view adds a second insight: the term H[q] prevents q from collapsing onto a single point. Without it, the optimum would be a point mass at the most probable latent value, which is essentially maximum a posteriori estimation rather than Bayesian inference.

ComponentIncreases whenPractical effect
Expected log-likelihoodLatent samples reconstruct data wellSharper, data-driven posterior
KL to the priorq stays close to p(z)Regularization and smoother latent space
Entropy of qq spreads probability massAvoids overconfident point estimates
Effect of the ELBO components on the approximation

Optimizing the ELBO in practice

Optimization strategies depend on whether the ELBO’s expectations can be computed in closed form. In conjugate exponential-family models, coordinate ascent variational inference updates each factor of a mean-field approximation analytically, and each step is guaranteed not to decrease the bound.

For non-conjugate or neural models, the expectations are estimated with Monte Carlo samples and optimized by stochastic gradient methods. The reparameterization trick writes a sample as a differentiable function of noise, giving low-variance gradients, while score-function estimators work for discrete latents at the cost of higher variance.

ApproachGradient sourceBest suited for
Coordinate ascentAnalytic updatesConjugate models such as mixture models
Stochastic variational inferenceMinibatch natural gradientsLarge datasets with global parameters
Reparameterization gradientsDifferentiable samplingContinuous latents in deep models
Score-function gradientsLog-derivative identityDiscrete or non-differentiable latents
Amortized inferenceEncoder network outputs qMany data points sharing one inference model
Common ELBO optimization approaches

Because the bound is estimated stochastically, a reported ELBO is a noisy quantity. Practitioners average it over many samples before comparing models and track it on held-out data to detect overfitting.

The standard ELBO is only as tight as the chosen variational family allows, which motivated several tighter or more flexible objectives. Each trades extra computation for a smaller gap to the true evidence.

ObjectiveRelation to the ELBOTypical cost
IWAE boundUses K importance samples, tighter as K growsAbout K times more likelihood evaluations
Beta-weighted ELBOScales the KL term by a factor betaSame cost, changes the fit-regularization balance
Expectation propagationMinimizes the reverse KL locallyMoment matching, no global bound guarantee
Exact marginal likelihoodUpper limit the ELBO approachesUsually intractable in latent variable models
ELBO compared with related objectives

Richer families such as normalizing flows or mixtures also shrink the gap without changing the objective itself, because they let q represent correlated or multimodal posteriors.

Limitations and common misconceptions

The ELBO is a powerful tool, but several limitations follow directly from its definition, and misreading the bound is a frequent source of errors in model comparison.

  • A higher ELBO is not always a better model: it can improve because q got better, not because the model explains data better.
  • Reverse KL is mode-seeking: maximizing the ELBO tends to underestimate posterior variance and may ignore secondary modes.
  • Posterior collapse occurs in deep generative models when a powerful decoder ignores the latent code and the KL term drops to near zero.
  • Comparing ELBOs across variational families is valid only as a comparison of bounds, not of true evidence values.

The short version

Some probability calculations are too hard to do exactly. The evidence lower bound gives a number that is easier to compute. It is always a little lower than the true answer. So it is a safe floor.

You pick a simple guess for the hidden causes behind your data. Then you adjust the guess to push the floor up. The higher the floor rises, the closer your guess gets to the real answer. It is like measuring the height of a ceiling by stacking boxes. You cannot reach above the ceiling, but each box brings you closer.

Where it makes a difference

A team building a variational autoencoder for anomaly detection in factory sensor data trains the model by maximizing the ELBO on about 200,000 windows of normal vibration readings. The encoder outputs a Gaussian q over a 16-dimensional latent space, and gradients come from the reparameterization trick with one sample per window.

Early training shows the KL term falling almost to zero, a sign of posterior collapse. The engineers apply a warm-up schedule that raises the KL weight from 0 to 1 over the first 20 epochs, after which the latent code carries useful information. At deployment, windows whose per-sample ELBO falls far below the training distribution are flagged. The approach detects bearing faults earlier than a fixed vibration threshold while keeping false alarms within the plant’s tolerance.