Adaptive Optimizers as Variational Inference

This direction is no longer present in the current build. Its last version stays readable and citable here.

Version 1 of 112 papers21 conceptsfrozen 2026-10-04

In standard deep learning, we treat training as an optimization problem: finding a single set of weights $\theta$ that minimizes a loss function. In contrast, Bayesian deep learning treats training as an inference problem: finding a posterior distribution $p(\theta | \mathcal{D})$ that represents our uncertainty.

Historically, these two worlds were separated by a massive computational gap. Bayesian methods like Variational Inference (VI) were considered too slow for large-scale models. However, a series of recent insights has revealed that the adaptive optimizers we use every day—like Adam and RMSprop—are actually performing a form of approximate Bayesian inference under the hood.

The Moving Average as Curvature

The core of an adaptive optimizer is the "preconditioner"—the term that scales the gradient for each parameter. In RMSprop and Adam, this is a moving average of squared gradients.

Arnold Salas, Samuel Kessler, and their colleagues in Practical Bayesian Learning of Neural Networks via Adaptive Subgradient Methods point out that this moving average is not just a heuristic for faster convergence. Mathematically, it serves as an approximation of the Hessian (the second derivative) of the log-posterior.

In Bayesian terms, the Hessian at the mode of a distribution represents the precision (the inverse of variance). If the loss surface is very steep (high curvature), we should be very certain about that weight; if it is flat (low curvature), we should be uncertain. By interpreting the optimizer's internal state as a precision matrix, we can extract a Gaussian posterior distribution from a trained model with almost zero extra cost.

Turning Optimizers into Bayesian Solvers

If standard optimizers are already calculating something akin to posterior precision, can we modify them to be "proper" Bayesian solvers?

Mohammad Emtiyaz Khan and Yarin Gal demonstrated this with Vprop in Variational Inference using RMSprop. They showed that by making two minor changes to the RMSprop update rule, the algorithm becomes mathematically equivalent to Gaussian Variational Inference. The "scaling vector" in RMSprop is repurposed to represent the precision of the variational distribution.

This connection was deepened by David Duvenaud and Roger B. Grosse in Noisy Natural Gradient as Variational Inference. They proved a fundamental equivalence: performing Natural Gradient Descent (an optimization technique that accounts for the geometry of the parameter space) is equivalent to Variational Inference if you simply inject a specific amount of adaptive noise into the weights during training.

Scaling to Large Datasets

The practical breakthrough of this perspective is scalability. Because these Bayesian methods "look and feel" like Adam, they can inherit all the engineering tricks that make deep learning work at scale, such as batch normalization and distributed training.

In Practical Deep Learning with Bayesian Principles, Kazuki Osawa and Siddharth Swaroop used an optimizer called VOGN (Variational Online Gauss-Newton) to train a Bayesian ResNet-50 on ImageNet. By aligning the structure of natural-gradient inference with the structure of Adam, they achieved predictive accuracy comparable to standard models while gaining the ability to estimate uncertainty—something previously thought impossible for models of that size.

Principled Hyperparameter Tuning

The Bayesian interpretation doesn't just provide uncertainty estimates; it also provides a more principled way to handle the optimization process itself.

In Variational Stochastic Gradient Descent for Deep Neural Networks, Anna Kuzina and Jakub M. Tomczak argue that standard optimizers are essentially "simplified" Bayesian inference where noise parameters are kept constant. By formalizing the gradient itself as a latent variable and using inference to update it, they derived VSGD, which dynamically adjusts to gradient noise.

Similarly, Filip de Roos and Philipp Hennig showed in A Probabilistically Motivated Learning Rate Adaptation for Stochastic Optimization that momentum can be viewed as a rank-one update to a prior covariance matrix. This allows for a "probabilistic wrapper" that automatically tunes the learning rate by treating the optimization path as a Gaussian process inference problem, reducing the need for expensive manual grid searches.

Summary of the Intuition

The bridge between optimization and inference rests on three pillars:

  1. Curvature is Precision: The second-order information (Hessian) used by adaptive optimizers to scale gradients is the same information needed to define the width of a posterior distribution.
  2. Noise is Exploration: Adding adaptive noise to weights transforms a point-search (optimization) into a distribution-search (inference).
  3. Natural Gradients are Variational Updates: The most efficient way to move in the space of probability distributions (Natural Gradient) mirrors the update rules of our most successful deep learning optimizers.

Papers in this version

History & citationVersion 1 · 2026-10-04

No longer present in the current build · Permanent link

View frozen version 1

Cite this direction

Latest version (a living page):

@misc{lacuna_adaptive_optimizers_as_variational_infer_7687be0e,
  title = {Adaptive Optimizers as Variational Inference},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/adaptive-optimizers-as-variational-inference/rdr_7687be0ecc0042c48852b2a753f5c803},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-12-04},
}

This exact version (version 1, frozen text):

@misc{lacuna_adaptive_optimizers_as_variational_infer_7687be0e_v1,
  title = {Adaptive Optimizers as Variational Inference},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/adaptive-optimizers-as-variational-inference/rdr_7687be0ecc0042c48852b2a753f5c803/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-12-04},
}