Amortization gap 2026-11-05
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.
Recognition network 2026-11-05
A recognition network is a learned mapping from observed data to parameters of an approximate posterior distribution over latent variables. In a variational autoencoder, it specifies , while the generative decoder specifies the opposite conditional direction . The recognition network supports amortized inference; it need not coincide with the exact posterior of the learned generative model.[ref]
Auto-Encoding Variational Bayes by Diederik P. Kingma and Max Welling. §3 and Appendix C, neural-network recognition model
For a scalar Gaussian recognition law, the neural network can output a mean and log variance . Thenwhere is parameter-independent noise. Exponentiating the log variance ensures a positive variance, and the factor converts it to the standard deviation used in Gaussian reparameterization.[ref]
Auto-Encoding Variational Bayes by Diederik P. Kingma and Max Welling. Appendix C.2, Gaussian output mean and log variance
For an original calculation, suppose one input gives and . The recognition variance is4 and its standard deviation is2. A noise draw gives , while the posterior mean supplied by the same network remains1. Confusing log variance with log standard deviation would instead produce the wrong scale.
A deterministic network evaluation and a random latent sample are distinct steps. Re-evaluating the same fixed network on the same input returns the same distribution parameters; new noise draws can still yield different values. Returning only the mean omits the uncertainty represented by that distribution. Its adequacy must be assessed against the intended inference problem, not inferred merely from the fact that it outputs a positive variance.
Variational autoencoder 2026-11-05
A variational autoencoder is a generative model with a latent variable and a learned approximation to its posterior distribution given an observation . Write the model as . A recognition network, implemented as a neural network, produces the parameters of ; a generative decoder specifies . Using one recognition rule across observations is amortized inference, rather than solving a fresh independent optimization problem for every input.[ref]
Auto-Encoding Variational Bayes by Diederik P. Kingma and Max Welling. §2.1–2.3, generative and recognition models; Introduction, neural-network recognition model
Training maximizes an evidence lower bound, often writtenThe first term scores reconstruction under the declared likelihood; the second compares the inferred latent law with the prior. The identityproves that it is a lower bound, since Kullback-Leibler divergence is nonnegative. It becomes tight when the recognition law equals the model posterior, under the usual density/support conditions.[ref]
For a one-dimensional Gaussian example, let the prior be and the recognition law be . Substituting their log densities and using givesAt , , this is . The value is a penalty for this particular latent law, not the whole training loss. Gaussian reparameterization writes with fixed-law standard-normal noise so that gradients can pass through the sampled latent value. After training, generation instead draws from the prior and then the generative decoder; it need not start from an observed input.