In stochastic optimization, the "noise" in your gradient estimates acts like a persistent wind. Even if you are standing exactly on the peak of a hill, a gust of noise can blow you off. In Variational Inference (VI), this noise is often so severe that models never truly settle at the optimum; instead, they "chatter" or oscillate around it.
Recent research has converged on a powerful solution: designing gradient estimators where the variance vanishes—approaching exactly zero—as the model reaches the target distribution. This property, often called "sticking the landing," transforms variational optimization from a noisy search into a precise, stable convergence.
The Problem with Persistent Noise
To approximate a complex posterior distribution $p$, we typically minimize the KL divergence between a parameterized distribution $q_\theta$ and $p$. The standard tool for this is the reparameterization trick, which allows us to compute gradients by sampling from a fixed noise distribution.
However, as Ming Xu and Scott A Sisson demonstrate in On some variance reduction properties of the reparameterization trick, not all reparameterized gradients are equal. Standard estimators often contain a "score function" term. Even when $q_\theta$ perfectly matches $p$, this term continues to fluctuate based on the specific samples drawn. This persistent variance prevents high-precision convergence and can even cause the variance to diverge as the model becomes more certain.
Sticking the Landing with Path Gradients
The breakthrough intuition, popularized by Geoffrey Roeder, Yuhuai Wu, and David Duvenaud in Sticking the Landing, is that the gradient of the KL divergence can be decomposed. One part of the gradient moves the samples (the path derivative), and the other part changes the density at those samples (the score function).
By identifying and removing the score function term—which averages to zero at the optimum but contributes massive noise—researchers created the path-gradient estimator. Because this estimator relies only on the difference between the model and the target, its variance vanishes as the model converges. Justin Domke and colleagues have shown in Provable convergence guarantees for black-box variational inference that this property allows VI to achieve exponential convergence rates, similar to interpolation in supervised learning.
Scaling to Flows and Diffusions
This "zero-variance" principle has recently been extended beyond simple Gaussian distributions to complex generative models:
- Normalizing Flows: Lorenz Vaitl and Pan Kessel developed path-gradient estimators for Continuous Normalizing Flows. By isolating the sample path dependency, they allow these high-dimensional models to settle into precise densities without the "chatter" typical of standard training.
- Schrödinger Bridges and Diffusions: In the context of diffusion-based sampling, Lorenz Richter and Julius Berner proposed a log-variance loss. This objective treats sampling as a control problem where the gradient variance reaches zero at the optimal control path, providing exceptional numerical stability for solving high-dimensional PDEs and sampling unnormalized densities.
- Contrastive Learning: Even in classification-based approaches to inference, such as SoftCVI, Daniel Ward and Matteo Fasiolo show that framing the problem correctly creates an "implicit control variate." This ensures that as the classifier becomes perfect, the training signal becomes noiseless.
Why It Works: The Intuition of Alignment
The core intuition is alignment. In a standard stochastic gradient descent setup, you are chasing a moving target with a noisy compass. In a zero-variance setup, the "noise" is actually a measure of the distance to the solution.
When the model is far from the target, the samples provide a strong, noisy signal of which way to move. As the model aligns with the target, the difference between the model's energy and the target's energy disappears. Because the estimator is built specifically to measure this difference, the "signal" and the "noise" vanish simultaneously. This allows the optimizer to decelerate naturally and "stick" to the exact posterior.