Mean-field variational inference 2026-10-06
Mean-field variational inference restricts the trial probability density function to . With the other factors fixed, , provided this expression has a finite positive normalization constant. Subtracting the objective at leaves , proving the update is optimal when the terms are well defined.
Past exam of the mathematics course of the University of Cambridge 2017 iii Paper 216 4 a Solution Created 2026-10-03 Updated 2026-10-06
Write . Mean-field variational inference minimizes the reverse Kullback-Leibler divergenceEach is a probability density function; without further parametric restrictions, the optimization is over all such product probability distributions. Equivalently it maximizes the evidence lower bound for any unnormalized posterior density . Its difference from is exactly the Kullback-Leibler divergence.
Fix and writeAssume and that the displayed expected values and objective decomposition are well defined. The optimal factor isIndeed, the part of the objective depending on isThe remaining term is fixed. Gibbs inequality gives nonnegativity of the Kullback-Leibler divergence, with equality precisely at almost everywhere. This proves global optimality of that coordinate update; it does not assert global optimality of a sequence of coordinate updates for the full nonconvex product-family problem.
The printed upper index in the list of remaining coordinates is inconsistent with the dimension ; the natural interpretation is . Also, if the exponential expression has zero or infinite normalizing constant, or the expected values are undefined, the usual coordinate formula needs additional support or integrability hypotheses. A restricted parametric factor family need not contain this unrestricted optimal factor.
Variational inference replaces exact Bayesian inference by an optimization problem over a tractable family . A guide program samples from this approximating family. Optimizing an evidence lower bound is equivalent to minimizing . Its appeal is that a fitted approximation can be cheap to sample and may scale well when an exact posterior distribution is inaccessible. A restricted family, such as mean-field variational inference, can miss dependence or entire modes; a local optimum can add further error. More optimization cannot remove approximation error caused by an inadequate family.
Monte Carlo method inference instead estimates posterior expectations using simulated values or weighted values. Examples include rejection sampling, importance sampling and Markov chain Monte Carlo. Under their respective support and convergence assumptions, increasing computation can yield consistent estimates without choosing a finite-dimensional posterior family. Their uncertainty includes simulation error; an inefficient proposal or slow mixing time can make that error large. Markov chain Monte Carlo additionally requires convergence and dependence diagnostics.
The central trade-off is optimization within an approximate family versus simulation under a target probability distribution. It is not an absolute distinction between deterministic and random computation: variational inference often uses Monte Carlo method estimates of its gradient, while Monte Carlo method inference may use fitted proposals. Neither method automatically guarantees accurate uncertainty estimates or superiority at a fixed computational budget.
Variational approximation gap 2026-11-05
The variational approximation gap is the part of the evidence lower bound deficit that remains even after optimizing separately for an observation within a specified variational family. With the generative model fixed and finite , defineThe equality uses the usual evidence lower bound identity for variational inference. A supremum allows for a best value that is not attained. The amortization gap separately measures failure of the shared inference rule to reach this value.[ref]
Inference Suboptimality in Variational Autoencoders by Chris Cremer and others. Table1; §3.1, equation8, decomposition for the ordinary variational-autoencoder bound
An original example shows what independence can cost. Stipulate a centred two-dimensional multivariate normal distribution as the posterior distribution, with covariance matrixRestrict the variational family to centred independent normal distributions, with . This is a simple mean-field variational inference restriction. Writing , the Kullback-Leibler divergence between normal distributions becomesEach variance contributes a term , minimized at . ConsequentlyFor , the best independent variances are both , and the unavoidable deficit is about nat. Matching both marginal variances to one instead would give about nat. The reverse Kullback-Leibler divergence therefore chooses narrower independent marginals here, while still failing to represent the correlation.
Enlarging the family to include the full covariance matrix permits and reduces this example's gap to zero. More generally, inclusion cannot increase the optimum approximation gap at a fixed model. Merely training the same shared rule longer cannot remove a strictly positive family restriction. Numerical improvements are not proofs that the infimum has been reached.