Introduction
Variational Autoencoders (VAEs) have become a cornerstone of generative modeling, offering a principled framework for learning latent representations of complex data. Central to the VAE is the Evidence Lower Bound (ELBO), which serves as a surrogate objective for the intractable marginal log-likelihood. While VAEs are powerful, a persistent "inference gap" exists between the true log-likelihood and the ELBO. Historically, this gap has been attributed to the simplicity of the variational distribution family—typically a factorized Gaussian. However, this paper argues that a significant, often dominant, portion of this gap arises from the suboptimality of the inference network itself, a phenomenon termed the amortization gap.
Decomposing the Inference Gap
To understand the limitations of VAEs, the authors formally decompose the total inference gap into two distinct components: the approximation gap and the amortization gap.
- Approximation Gap: This represents the error inherent in the choice of the variational distribution family. Even with the best possible parameters, a simple distribution (like a Gaussian) may be unable to capture the complexity of the true posterior.
- Amortization Gap: This is the additional error introduced by using an inference network (encoder) to predict the parameters of the variational distribution. Instead of optimizing the parameters for each individual data point, the encoder "amortizes" the cost of inference across the entire dataset. If the encoder lacks sufficient capacity, it will produce parameters that are suboptimal even within the chosen distribution family.
Methodology: Isolating the Gaps
The core challenge in measuring these gaps is determining the "optimal" variational parameters for a given data point without relying on the encoder. The authors achieve this by performing local optimization. For a specific input, they directly optimize the variational parameters to maximize the ELBO, bypassing the inference network entirely. This yields the best possible lower bound achievable within the distribution family.
By comparing the standard encoder-based ELBO with this locally optimized bound and the true log-likelihood (estimated via Annealed Importance Sampling), the authors can quantify both gaps. To further explore the approximation gap, they employ more expressive distribution families, such as those parameterized by Normalizing Flows (specifically Real NVP) and auxiliary variables.
Results and Insights
The empirical evaluation across MNIST, Fashion-MNIST, and 3-BIT CIFAR reveals several critical insights into VAE performance.
Amortization as the Primary Bottleneck
On simpler datasets like MNIST, the approximation and amortization gaps are comparable. However, as data complexity increases, the amortization gap becomes the dominant source of suboptimality. On the 3-BIT CIFAR dataset, the amortization gap accounted for approximately 37.47 nats of the total 52-nat inference gap, while the approximation gap was only 14.75 nats. This suggests that improving the encoder's ability to map inputs to latent parameters is often more impactful than increasing the complexity of the latent distribution.
The Role of Normalizing Flows
Normalizing Flows are often motivated as a way to reduce the approximation gap by providing more flexible posterior distributions. While they do achieve this—reducing the approximation gap on CIFAR to a mere 1.60 nats—the authors find that flows also serve a secondary, "hidden" purpose. They effectively increase the capacity of the inference network, helping it generalize better and reducing the amortization gap compared to simpler architectures.
Decoder Accommodation
A striking finding is that the generative model (the decoder) learns to accommodate the limitations of the inference network. If the encoder is restricted to a simple Gaussian family, the decoder adapts the generative process such that the true posterior becomes more Gaussian-like. This "cheating" behavior means that the choice of inference model directly influences the learned generative model, potentially limiting its overall expressiveness.
Conclusion
This research highlights that the performance of VAEs is frequently limited by the amortization gap rather than the approximation gap. While flexible distributions like Normalizing Flows are beneficial, their primary advantage may lie in providing additional capacity to the inference network. Future work in variational inference should place greater emphasis on reducing amortization error, perhaps through more powerful encoder architectures or hybrid methods that combine amortized inference with local refinement.
Summary updated