Back to AI Math Mind Map
中文·English
📐 AI MathID: elbo-vi

Variational Inference & ELBO

变分推断与 ELBO
🎯Core Definition
Variational inference approximates an intractable posterior p(zx)p(z|x) with a tractable distribution q(zx)q(z|x) via the evidence lower bound (ELBO). Exact decomposition of the log-evidence: logp(x)=ELBO(q)+DKL(q(zx)p(zx))\log p(x) = \text{ELBO}(q) + D_{KL}(q(z|x) \Vert p(z|x)), where ELBO(q)=Eq(zx)[logp(x,z)q(zx)]=Eq[logp(x,z)]+H(q)=Eq[logp(xz)]DKL(q(zx)p(z))\text{ELBO}(q) = \mathbb{E}_{q(z|x)}\left[\log\frac{p(x,z)}{q(z|x)}\right] = \mathbb{E}_q[\log p(x,z)] + H(q) = \mathbb{E}_q[\log p(x|z)] - D_{KL}(q(z|x) \Vert p(z)). The bound is constructed via Jensen: since log\log is concave, logp(x)=logEq[p(x,z)q(zx)]Eq[logp(x,z)q(zx)]=ELBO(q)\log p(x) = \log\mathbb{E}_q\left[\frac{p(x,z)}{q(z|x)}\right] \ge \mathbb{E}_q\left[\log\frac{p(x,z)}{q(z|x)}\right] = \text{ELBO}(q); expanding Eq[logp(x)]=ELBO+Eq[logqp(zx)]\mathbb{E}_q[\log p(x)] = \text{ELBO} + \mathbb{E}_q\left[\log\frac{q}{p(z|x)}\right] yields the exact decomposition, with equality iff q=p(zx)q = p(z|x), where the KL gap is 0 and ELBO reaches logp(x)\log p(x).
💡Use Cases
the training objective of VAEs (reconstruction + KL regularization with the reparameterization trick), Bayesian neural networks, LDA topic modeling; "derive the ELBO" and "why does a VAE optimize the ELBO" are canonical interview questions.
Key Problems Solved
the posterior p(zx)p(z|x) is usually not analytically integrable and MCMC is infeasible at scale; variational inference turns inference into optimization, compatible with SGD, and yields an approximate posterior with uncertainty. The cost: restricted approximation families (e.g. mean-field independence) tend to underestimate posterior variance.
🎯5 High-Frequency Exam Points
1
Fully derive logp(x)=ELBO+DKL(qp)\log p(x) = \text{ELBO} + D_{KL}(q \Vert p)?
2
How does Jensen's inequality prove that ELBO is a lower bound on logp(x)\log p(x)?
3
Two equivalent ELBO forms (reconstruction + KL penalty)? Why does maximizing ELBO minimize the KL gap?
4
Relation between variational inference and EM? What do the E and M steps do?
5
What is the mean-field assumption? Why does VI tend to underestimate posterior variance?
Updated 2026-08-12
🎯
Test Your Knowledge: Practice Questions for "Variational Inference & ELBO"
Single choice pitfall questions with instant feedback and mistake tracking.
🚀 Start Card Practice
Previous CardBayesian InferenceNext CardHigh-Dim Geometry & Concentration

🔗 More AI Math Knowledge Cards

Adam/AdamW MathBias-Variance DecompositionBootstrapCausal Inference (Rubin)