Abstract
Stochastic Natural Gradient Variational Inference (NGVI) is a popular, empirically fast algorithm for Bayesian machine learning, but its theoretical convergence guarantees have remained a mystery. This paper provides the first rigorous proof that stochastic NGVI converges at an $\mathcal{O}(1/T)$ rate for conjugate models, matching standard gradient descent but with vastly superior constant factors. However, it also reveals a surprising twist: for non-conjugate models, NGVI implicitly optimizes a non-convex objective, explaining why theoretical guarantees here are so elusive.
The Missing Theoretical Foundation
In Bayesian machine learning, Variational Inference (VI) approximates complex posterior distributions by turning the problem into an optimization task—specifically, maximizing the Evidence Lower Bound (ELBO). To do this, practitioners often use Natural Gradient Descent (NGD) instead of standard Stochastic Gradient Descent (SGD). While SGD takes steps based on flat Euclidean geometry, NGD takes steps based on the actual geometry of probability distributions (measured by KL divergence).
Empirically, NGVI is incredibly fast and is widely used in large-scale Gaussian processes and Bayesian neural networks. However, its theoretical foundation in the stochastic (mini-batch) setting has been missing. Existing convergence proofs rely on unrealistic assumptions that provably break down in practice. This work tackles this gap, mathematically proving how fast stochastic NGVI actually converges under realistic conditions.
Bridging the Gap with Mirror Descent
The authors bridge the theoretical gap by framing NGVI as a form of Mirror Descent, an optimization algorithm that operates in the "expectation parameter" space of exponential families. They split their analysis into two regimes:
- Conjugate Likelihoods: Where the prior and the posterior belong to the same probability family. Here, they leverage recent advances in stochastic mirror descent for functions that are "relatively smooth and strongly convex" to build their proof.
- Non-Conjugate Likelihoods: Where the math is messier (e.g., classification tasks). Here, they analyze the mathematical landscape of the ELBO objective under NGVI's specific parameterization.
Additionally, the authors examine the practical computation of stochastic gradients. They demonstrate that standard automatic differentiation (the reparameterization trick common in PyTorch/JAX) can actually break NGD updates by pushing parameters outside their valid mathematical domain (e.g., resulting in invalid covariance matrices). To fix this, they advocate using specific mathematical estimators based on Bonnet's and Price's theorems to guarantee valid, stable updates.
Key Insights and Results
The Secret to NGVI's Speed (Conjugate Models)
For conjugate models, stochastic NGVI has an $\mathcal{O}(1/T)$ convergence rate. While this is the same complexity class as standard SGD, the NGVI rate is completely independent of the objective's condition number and the initialization distance. This explains the massive empirical speedup—the "constant factor" hidden in the Big-O notation is much smaller for NGVI.
On datasets like UCI Bike (Bayesian Linear Regression), both NGVI and SGD show the predicted $\mathcal{O}(1/T)$ slope. However, as seen in the empirical validations, NGVI achieves in its first few iterations what takes SGD thousands of iterations to reach, perfectly illustrating the theoretical "constant factor" advantage.
The Non-Convexity Surprise (Non-Conjugate Models)
For non-conjugate likelihoods (like simple logistic regression on UCI Mushroom or MNIST), the ELBO objective is actually non-convex with respect to the expectation parameters used by NGVI. This is a huge plot twist, as the exact same problem is convex under the parameterizations used by standard SGD. Despite this, NGVI still empirically outperforms SGD, though the speedup is less dramatic than in the conjugate case.
Interestingly, simply swapping standard auto-diff gradients for Price's theorem gradients caused a massive performance jump even for standard SGD, as it guarantees mathematically valid updates and has lower variance.
Limitations and Future Work
The primary limitation is that the rigorous $\mathcal{O}(1/T)$ convergence proof strictly applies only to conjugate likelihoods. Because the authors discovered that the objective becomes non-convex for non-conjugate likelihoods, extending this proof is not straightforward.
For future work, the authors suggest that proving convergence for non-conjugate models will require discovering new mathematical properties of the ELBO (such as the Polyak-Łojasiewicz inequality). Furthermore, the distance-generating function used in NGVI (negative entropy) is non-strongly convex and non-smooth. This highlights a strong need for the optimization community to develop new stochastic mirror descent theories that can handle these quirky, non-standard geometries.
Summary updated