This page hunts the misconceptions around the ELBO objective and KL term. Every reveal below is a trap that a quick reader falls into. Try to answer before peeking — if your reasoning matches the "why", you actually understand the bound.
Before we start, here are the symbols we will lean on. Everything is defined here so this page stands on its own — no need to jump to the parent first.
The picture below shows this split as heights on a bar — reconstruction pushes the bound up, KL pulls it down, and the two together can never rise above the true ceiling logpθ(x).
The one equation that resolves half the traps:
logpθ(x)=L(θ,ϕ;x)+DKL(qϕ(z∣x)∥pθ(z∣x))
Read it as: true log-likelihood = the bound + the gap, and the gap is a KL divergence, so it can never be negative.
Finally, a question that trips up nearly everyone: why do we always write the KL as q∥p (encoder first) and never p∥q? The next figure makes the difference geometric.
The ELBO is always less than or equal to the true log-likelihood.
True. The gap term DKL(qϕ∥pθ(z∣x)) is a KL divergence, which is ≥0, so L=logpθ(x)−gap≤logpθ(x) for every ϕ.
Maximizing the ELBO can never increase the true log-likelihood logpθ(x).
False. The ELBO depends on both θ and ϕ; changing θ moves the whole generative model, so climbing L genuinely raises logpθ(x) — it is not just closing a fixed gap.
If the KL regularization term is zero, the encoder has failed.
False in general — it depends on which KL. If DKL(qϕ(z∣x)∥p(z))=0 the encoder outputs the prior regardless of x, which is posterior collapse and is a failure. But if the gap KL DKL(qϕ∥pθ(z∣x))=0, the encoder is perfect and the ELBO is tight — a triumph.
A larger ELBO always means better sample quality from the generator.
False. ELBO bundles reconstruction and KL; a model can score high ELBO while placing probability mass poorly for sampling, and Monte-Carlo ELBO estimates are also noisy — see Posterior Collapse for a case where ELBO looks fine but samples are useless.
KL divergence is a distance, so DKL(q∥p)=DKL(p∥q).
False. KL is not symmetric and violates the triangle inequality, so it is not a metric. Swapping the arguments generally changes the value; VAEs deliberately use the reverse form DKL(q∥p).
The reconstruction term Eqϕ[logpθ(x∣z)] can be positive.
True for continuous x. A Gaussian density can exceed 1, so its log can be positive; only probabilities (discrete case) are capped at 1 and give non-positive logs.
Jensen's inequality is what guarantees the ELBO is a lower bound rather than upper.
True. Because log is concave, logE[f]≥E[logf], so pulling the log inside the expectation can only lose value — the result sits below logpθ(x).
If qϕ(z∣x) equals the true posterior pθ(z∣x), the ELBO equals the log-likelihood exactly.
True. Then the gap KL is zero, so logpθ(x)=L — the bound is tight and Monte-Carlo estimation of logpθ(x) becomes exact in expectation.
"logpθ(x)=log∫pθ(x∣z)p(z)dz is intractable, so we just replace the integral with pθ(x∣z0) for one sampled z0."
Error: one sample of pθ(x∣z0) is not an unbiased estimate of the integral over the prior — most prior samples make x nearly impossible, so this estimate is astronomically high-variance. The ELBO fixes this by sampling from qϕ, which concentrates on the codes that actually explain x.
"Because DKL≥0, dropping the KL term from the ELBO gives a tighter lower bound."
Error: removing the KL term does not tighten anything — it changes the objective entirely into just reconstruction, which is not a lower bound on logpθ(x) and encourages posterior collapse in reverse (each x mapped to an arbitrary z).
"We use DKL(qϕ∥pθ(z∣x)) inside the training loss and minimize it directly."
Error: we cannot compute pθ(z∣x) (that was the whole problem), so we never touch the gap KL directly. The training loss uses DKL(qϕ(z∣x)∥p(z)) against the prior, and minimizing the gap happens implicitly by maximizing L.
"Jensen gives f(E[X])≤E[f(X)], so logE[f]≤E[logf]."
Error: the inequality direction is stated for convexf. Since log is concave, the inequality flips: logE[f]≥E[logf]. Getting the direction wrong would make the "bound" an upper bound and break the whole derivation.
"DKL(q∥p)=21∑j(μj2+σj2−logσj2−1) can be negative if the σj are tiny."
Error: the formula is provably ≥0. As σj→0, −logσj2→+∞ dominates and drives KL up, not negative; the −1 is just the constant that makes KL=0 exactly at μ=0,σ=1.
"The expectation Eqϕ[logpθ(x∣z)] is taken over the prior p(z)."
Error: it is taken over the encoderqϕ(z∣x), not the prior. This is the point of variational inference — we sample the codes that qϕ says are relevant to this specific x, which is why the estimate is low-variance.
Why do we pick the reverse KL DKL(q∥p) instead of forward DKL(p∥q)?
Because the expectation is over q, which is exactly the distribution we can sample from and control; forward KL would need samples from the intractable true posterior. This choice makes qzero-forcing — it avoids putting mass where p has none, at the cost of possibly ignoring some modes.
Why is the term called the Evidence Lower Bound and not just "the bound"?
In Bayesian language pθ(x) is the evidence for the model, and L is a guaranteed lower bound on its logarithm — the name literally spells out "lower bound on the (log) evidence".
Why does the KL term prevent latent codes from drifting arbitrarily far apart?
It penalizes any encoder distribution that strays from the prior p(z)=N(0,I), pulling every qϕ(z∣x) toward a common, overlapping region. This keeps the latent space continuous so that decoding a fresh z∼p(z) produces sensible outputs — the sampling guarantee.
Why can we not just maximize logpθ(x) directly if we have the decoder network?
Because logpθ(x)=log∫pθ(x∣z)p(z)dz integrates the decoder over all latent codes, an integral with no closed form and exponential cost in the latent dimension. The ELBO sidesteps this by replacing the integral with a tractable expectation under qϕ.
Why does the closed-form Gaussian KL make VAE training so much faster?
The KL term needs no Monte-Carlo sampling — it is an exact algebraic function of the encoder's μ and σ, so only the reconstruction term is estimated by sampling, cutting both cost and variance.
Why does raising a "β" weight on the KL term (as in β-VAE) risk posterior collapse?
Over-weighting KL makes the cheapest way to lower the loss be qϕ(z∣x)→p(z) for all x, ignoring x entirely; the encoder stops carrying information — the collapse discussed in Posterior Collapse.
What is the ELBO if the encoder is deterministic, i.e. σj→0 for all j?
The KL term −logσj2→+∞ blows up to +∞, so KL →+∞ and the ELBO →−∞ — the objective explicitly forbids a zero-variance encoder, which is why VAEs keep stochastic latents.
What happens to reconstruction and KL when qϕ(z∣x)=p(z) exactly for every x?
KL =0 (perfect regularization) but the code carries no information about x, so reconstruction collapses to the best a blind decoder can do — this is textbook posterior collapse: great KL, useless model.
Is the ELBO still a valid lower bound if qϕ is a terrible approximation to the posterior?
Yes.L≤logpθ(x) holds for any valid distribution qϕ; a poor q just makes the gap KL large and the bound loose, but never invalid.
What does the ELBO gap look like at the very start of training with a randomly initialized encoder?
The gap DKL(qϕ∥pθ(z∣x)) is typically huge, so L sits far below logpθ(x) — training then simultaneously raises the ceiling (θ) and shrinks the gap (ϕ).
If a data point x is genuinely impossible under the model (pθ(x)→0), what happens to logpθ(x) and the ELBO?
logpθ(x)→−∞, and since L≤logpθ(x) the ELBO is dragged down with it — the bound faithfully reports "this point is unexplainable".
Can the gap KL and the regularization KL ever both be zero at once?
Only in the degenerate case where the true posterior equals the prior for that x (i.e. z tells you nothing about x). Then qϕ=p=pθ(z∣x), giving a tight bound but a latent code that ignores the data.
Does tightening the bound with more samples (importance weighting) change what "ELBO" means?
Yes — Importance Weighted Autoencoders use a multi-sample bound that is tighter (closer to logpθ(x)) than the single-sample ELBO, though it is no longer decomposable into a clean reconstruction-minus-KL form.
Recall Self-check
Why is the gap between ELBO and log-likelihood never negative? ::: It equals DKL(qϕ(z∣x)∥pθ(z∣x)), and every KL divergence is ≥0.
Which distribution's samples power the reconstruction expectation? ::: The encoder qϕ(z∣x), not the prior p(z).