Variational inference approximates a posterior distribution by minimizing a Kullback-Leibler divergence over a chosen family of probability distributions. For an unnormalized posterior density and a trial probability density function , minimizing is equivalent to minimizing .
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.
A normalizing flow constructs a probability distribution by passing a simple reference random variable through invertible differentiable transformations. The change of variables formula supplies its probability density function: if and is a diffeomorphism between equal-dimensional spaces, thenThe Jacobian determinant accounts for local expansion or contraction of volume. Composing several transformations gives a flexible distribution while retaining a computable density, useful for a richer approximate posterior distribution in variational inference.[ref]
Variational Inference with Normalizing Flows by Danilo Jimenez Rezende and Shakir Mohamed. §3, equations5–7, invertible transformations and composition
For an original nonlinear example, let have the standard normal distribution with density , and set . Since and tends to opposite infinities at the two ends of the real line, every output has exactly one preimage. Its probability density function satisfiesAt , the output is and . The factor reflects how strongly the transformation stretches nearby inputs. Integrating after the substitution cancels this factor against , leaving total probability one.
For , the chain rule givesGenerating transformed samples alone does not evaluate their probability density function; evaluating the determinant factors is essential. The single-preimage formula also requires invertibility: the map folds two real inputs together, so it cannot be substituted into this formula unchanged.
Amortized inference learns one shared rule that maps observations to approximate posterior distributions, spreading the work of fitting that rule across many inputs. Instead of separately optimizing variational parameters for every observation , a recognition network returns the parameters of . The shared parameters are learned across data; evaluating the rule for a new input is then a different operation from fitting it.[ref]
Stochastic Backpropagation and Approximate Inference in Deep Generative Models by Danilo Jimenez Rezende and others. §4, recognition model and joint optimization
A scalar Gaussian model gives an exact example. Let and . Completing the square givesThe shared rule , with , and fixed variance , represents the exact posterior for every real . Evaluating replaces a separate optimization for each observation in this stipulated model. It does not imply that every nonlinear latent-variable model has an exact rule this simple.
Sharing can introduce an additional restriction even when the chosen distribution family is adequate. For observations and , the exact posterior means are and . The Gaussian family can represent each exactly when is fitted separately. If the shared rule is constrained to output one constant mean for both inputs, its best equal-weight choice is . Each case then hasThis original example isolates an amortization gap: the loss from restricting how observation-specific variational parameters are produced, rather than an inability of the per-observation Gaussian family to express the target. The shared mapping's capacity and its training therefore matter alongside the family of probability distributions.
The amortization gap measures how much evidence lower bound is lost by using the distribution returned by amortized inference instead of the best distribution available for that observation in the same variational family. Hold the generative parameters fixed. Write for the evidence lower bound and suppose the optimum is attained. For the shared rule ,The remaining variational approximation gap is , so the total loss isThus a restrictive recognition network or incomplete training can leave an amortization gap even when the variational family can represent the exact posterior distribution.[ref]
Inference Suboptimality in Variational Autoencoders by Chris Cremer and others. Table1, summary of gap terms; introductory definition of the optimal approximation within its family
For an original example, stipulate for equally weighted observations and . The variational family represents both posterior distributions exactly when fitted separately, so . Restrict the shared rule to : it can adjust the intercept but its slope is fixed at one. The Kullback-Leibler divergence between these unit-variance normal distributions is . Averaging the amortization gap over the two observations givesThe best shared intercept still loses nat on average. A current rule with loses one nat: half a nat can be removed by training this rule better, while the remaining half requires changing its fixed-slope restriction. This separates the variational family's expressive power from the shared mapping's capacity and current training state.
In a numerical comparison, a locally improved per-observation distribution need not be the global optimum . Its improvement supplies a lower bound on the true amortization gap; failing to find an improvement does not establish a zero gap. Comparisons must keep both and fixed.
Under fixed-support regularity permitting differentiation under the integral sign, apply the product rule to . The first derivative term is and the second is . This proves the displayed identity. For an evidence lower bound, take , holding noise fixed in the inner derivatives. Parameter-independent continuous noise contributes a reparameterization gradient; untransformed discrete choices contribute a score-function gradient estimator. A mixed base law cannot be called parameter independent if its discrete factors retain variational parameters.[ref]
A guide program is a probabilistic program whose generated probability distribution approximates a model's posterior distribution. Its adjustable parameters are fitted by variational inference. The guide must assign probability only where the target allows it when minimizing , but a tractable guide can still miss important target regions.
A reparameterization gradient differentiates an expected value by representing the simulated random variable as a differentiable transformation of parameter-independent noise. For , the identity requires justified differentiation under the integral sign. For a normal distribution, use with drawn from the standard normal distribution.
Gaussian reparameterization represents a random variable with a normal distribution using a location, a scale and parameter-independent noise:Here has the standard normal distribution. The resulting has expected value and variance . The probability distribution is unchanged; the representation separates the random draw from the adjustable parameters. This makes reparameterization gradients available for differentiable expectations, including the Gaussian approximate posterior in a variational autoencoder.[ref]
Stochastic Backpropagation and Approximate Inference in Deep Generative Models by Danilo Jimenez Rezende and others. §3.2, Gaussian location-scale transformation and equation(10)
For a complete example, fix and considerHolding the same noise value fixed while differentiating givesAt , , the particular noise draw gives and derivative estimate , while the true derivative is . An individual sample need not equal the derivative; the equality is in expected value.
Parameterizing a positive scale as also gives . One can differentiate through the deterministic transformation while leaving the noise law fixed. For a general integrand, exchanging derivative and expectation still requires justified differentiation under the integral sign; the representation alone is not a proof of that exchange. Reusing noise when parameters change also connects the construction to common random numbers.
Consider the explicitly specified objectiveand estimate its derivative by a symmetric finite difference with step . The choice of shared or independent noise changes the estimator's variance even though both use correct normal distributions at the two parameter values.
With common random numbers, the same appears on both sides:Thus and , independent of . Cancellation removes the noisy square term. For this quadratic, the symmetric difference has no truncation bias in exact arithmetic.
For independent standard normals , instead useIf , expand . The standard-normal moments , and giveAdding the two independent square variances and dividing by yieldsBoth estimators have the correct expected value , but the independent-noise variance diverges as tends to zero. At and , the variances are and . An average of independent replicate estimators divides each variance by .
This is a complete calculation for the stated quadratic, not a universal dominance theorem. At , and , the independent variance is , below the shared value . The covariance principle in common random numbers explains why coupling needs a specified objective and comparison. Very small steps in floating-point evaluation also introduce cancellation concerns that this exact-arithmetic model does not include.
Markov chain variational inference optimizes an initial parametric probability distribution by minimizing after a fixed number of Markov kernel updates. The best initial probability distribution can depend on ; Kullback-Leibler divergence contraction does not imply that optimization commutes with applying the Markov kernel.
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.
Articles by others on the same topic
There are currently no matching articles.