Characterizing the Edge of Stability in Variational Training Without Priors

Juraj Marusic, Jonathan Wenger, Beau Coker, John Patrick CunninghamNeurIPS 2026

TL;DR

In Bayesian deep learning, approximating gradients by taking just one or two random parameter samples is usually treated as a necessary evil to save compute. This paper flips that intuition on its head: when training variational models without explicit priors, taking fewer samples injects beneficial noise that forces the optimizer into flatter, more generalizable regions of the loss landscape. In short, the cheapest way to train these models is actually the best way.

What Problem Does This Paper Address?

Bayesian methods promise neural networks that know what they don't know, learning a probability distribution over weights rather than single point estimates. Traditionally, Variational Inference (VI) keeps this distribution well-behaved by penalizing how far it strays from a chosen "prior" distribution (via KL divergence). The catch? Nobody really knows how to pick a good prior over millions of neural network weights, and bad priors cause severe underfitting.

Recently, researchers proposed throwing out the explicit prior penalty altogether—relying entirely on the natural quirks of gradient descent (implicit regularization) to keep the learned weight distribution sensible while minimizing the expected loss.

Meanwhile, in standard deep learning, we know about the Edge of Stability (EoS): during gradient descent with learning rate $\eta$, the "sharpness" (maximum curvature, or largest Hessian eigenvalue) of the loss landscape rises until it hits $2/\eta$ and hovers there. Flatter minima (lower sharpness) generalize better. The mystery this paper tackles is: how does unregularized variational training interact with the Edge of Stability? If we learn the noise distribution without a prior to hold it back, why doesn't the noise just collapse to zero and undo any regularization benefits?

Methods

The authors bridge variational training and EoS theory by analyzing a Gaussian distribution over weights, parameterized by a mean $\mu$ and a low-rank covariance factor $S$. Because computing the exact expected loss over all possible weights is intractable, it is approximated via Monte Carlo sampling—drawing $M$ weight samples per step.

  • What is standard: Optimizing variational parameters via Monte Carlo gradient estimates and measuring Hessian sharpness at convergence.
  • What is new: The authors mathematically derive the exact maximum learning rates for both $\mu$ and $S$ that guarantee the expected loss decreases on average, first in linear regression (Theorem 1 & Lemma 2) and then for arbitrary smooth loss landscapes (Theorem 2). They connect these bounds to neural network training via a modified EoS sharpness threshold: $$\text{Sharpness} \approx \frac{2}{\eta} \left( \frac{1}{1 + \frac{1}{M\gamma}} \right)$$ where $M$ is the number of Monte Carlo samples and $\gamma$ is the Signal-to-Noise Ratio (SNR) of the gradient estimates. For their deep learning experiments, they apply this framework to ResNet34 models (treating input and output layers variationally) using a variance-reduced 1-sample estimator.

Datasets

  • Synthetic data: Used to verify theoretical bounds on linear models and one-layer SiLU networks.
  • In-Distribution (ID): CIFAR-10 and CIFAR-100.
  • Out-of-Distribution (OOD): CIFAR-10-C and CIFAR-100-C (standard robustness benchmarks featuring programmatic corruptions like blur and brightness shifts). No new datasets were introduced.

Key Insights and Ideas

  • Computational thriftiness is a regularizer: Usually, more Monte Carlo samples ($M$) means better gradient estimates. Here, as $M \to \infty$, the modified EoS threshold reverts to the sharper standard threshold ($2/\eta$). Using fewer samples ($M=1$) lowers the stability ceiling, forcing the model into flatter minima that generalize better.
  • Sampling noise $\neq$ SGD minibatch noise: Standard SGD noise comes from data subsampling; if a model perfectly fits the training data, residuals hit zero and SGD noise vanishes. Parameter-sampling noise comes from the learned covariance $S$, meaning it persists even at zero training error unless $S$ collapses.
  • The Signal-to-Noise Ratio (SNR) governs stability: Because the noise parameter $S$ is learned alongside the mean $\mu$, the gradient SNR ($\gamma$) stays relatively stable rather than blowing up or vanishing, preserving the flatness bias throughout training.

Key Results

  • Sharpness tracks theory: Across learning rates and sample counts $M \in \{1, 2, 4, 8, 16\}$ on CIFAR-10, variational models consistently settle at sharpness levels strictly below $2/\eta$. As $M$ increases from 1 to 16, sharpness climbs monotonically from ~180 toward the standard threshold of 200.
  • Fewer samples boost accuracy: On CIFAR-10, $M=1$ achieves the highest ID accuracy (~0.91) and OOD accuracy (~0.71), with both metrics degrading monotonically as $M$ increases to 16.
  • Robustness without an ID tax: On CIFAR-10-C and CIFAR-100-C, 1-sample variational training matches standard ResNet34 training on clean ID accuracy while significantly outperforming it on corrupted OOD accuracy, Negative Log-Likelihood (dropping from ~2.20 to ~1.70 on CIFAR-10-C, and ~4.00 to ~3.55 on CIFAR-100-C), and calibration error.

Limitations and Future Work

  • Theoretical vs. practical gaps: The mathematical proofs assume smooth losses, full-batch gradient descent, and Gaussian variational families. However, the deep learning experiments rely on cross-entropy loss, SGD with momentum, and only make the input/output layers variational.
  • Prediction vs. Posterior Quality: This work evaluates variational training (making accurate, calibrated predictions) rather than variational inference (how faithfully the learned distribution approximates a true Bayesian posterior).
  • Future directions: Extending the theory to non-smooth functions and expressive families like normalizing flows, comparing parameter-sampling noise directly against dropout, and using the derived stability bounds to design smarter learning rate schedulers.

Summary updated

Abstract

Variational approaches in deep learning promise to deliver improved uncertainty quantification and out-of-distribution generalization by inferring a distribution over weights, regularized by a divergence to a chosen prior. However, prior elicitation presents a significant challenge in deep learning, resulting in the common practice of significantly downweighting the regularization term in the variational objective. Recently, it was proposed to train solely via the expected loss by relying on implicit regularization from the optimizer, rather than explicit regularization from the divergence to the prior. While this approach largely sidesteps the issue of prior elicitation, current theory lacks an understanding of how key optimization hyperparameters impact the implicit regularization. Here, we theoretically and empirically demonstrate that larger learning rates and fewer parameter samples lead to flatter minima of the loss landscape, which are known to generalize better. We show that training on the expected loss operates at a modified edge of stability, characterized by the signal-to-noise ratio of the gradient estimates and the number of Monte Carlo samples. Experiments on out-of-distribution benchmark datasets confirm the practical significance of the theoretical results.
BibTeX
@inproceedings{marusic2026characterizing,
  author = {Juraj Marusic and Jonathan Wenger and Beau Coker and John Patrick Cunningham},
  title = {{Characterizing the Edge of Stability in Variational Training Without Priors}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=Mfhyva9QO7},
}
Figure