NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

The alignment property of SGD noise and how it helps select flat minima: A stability analysis

Lei Wu, Mingze Wang, Weijie Su

In the world of deep learning, we often operate in an "over-parameterized" regime where models have more parameters than data points. This means there are infinitely many ways to achieve zero training error. Yet, Stochastic Gradient Descent (SGD) consistently finds solutions that generalize well to new data. The common wisdom is that SGD favors "flat minima"—broad valleys in the loss landscape—rather than "sharp minima."

But why does SGD have this preference, and how does it navigate there so efficiently? A NeurIPS 2022 paper by Lei Wu, Mingze Wang, and Weijie J. Su provides a compelling answer through the lens of linear stability analysis.

The Problem with Previous Theories

While the "flat-minima principle" is widely accepted, theoretical explanations have often fallen short. Previous works typically relied on Stochastic Differential Equations (SDEs) to model SGD. However, these models often assume the noise is isotropic (equal in all directions) or state-independent.

Under those older assumptions, escaping a sharp minimum should take a very long time—polynomial or even exponential relative to the "height" of the barrier. In reality, SGD escapes sharp regions with unreasonable efficiency. Furthermore, many existing theories suggest that the "sharpness" of a minimum should depend on the number of parameters, which contradicts empirical observations where massive models still find flat solutions. This paper seeks to provide a quantitative, size-independent characterization of how SGD selects flat minima.

Methods & The Alignment Property

The authors move away from continuous-time SDEs and instead use linear stability analysis, looking at the discrete-time dynamics of SGD near a global minimum $\theta^*$.

The core of their approach is identifying the alignment property of SGD noise. They define a "loss-scaled alignment factor" $\mu(\theta)$ that measures how well the noise covariance aligns with the Fisher Information Matrix (which acts as a proxy for the Hessian $H(\theta)$ near a minimum).

Evolution of the alignment factor $\mu(\theta)$ during training and across model sizes.

By analyzing the stability of the linearized SGD system, they derive a condition: if a minimum is "stable" (meaning SGD doesn't immediately bounce out of it), the landscape's sharpness must be below a specific threshold.

Key Insights

  • Noise is Geometry-Aware: The most critical insight is that SGD noise is highly anisotropic. It is strongest in the directions where the loss landscape is steepest (sharp directions) and nearly zero in flat directions. This isn't a bug; it's a feature that helps the optimizer "feel" the sharpness.
  • Exponential Escape: Because the noise magnitude is proportional to the loss value, any movement toward a sharper region creates a positive feedback loop. This leads to an exponentially fast escape from sharp minima, explaining why we rarely find them in practice.
  • Size-Independence: The authors prove that the bound on sharpness (measured by the Frobenius norm of the Hessian) depends on the learning rate ($\eta$) and batch size ($B$), but is independent of the model size (number of parameters). This explains why massive models don't necessarily find "sharper" minima just because they have more dimensions to be sharp in.
  • The Stability Bound: They establish a concrete limit: for a minimum to be stable, $\|H(\theta^*)\|_F \le \frac{1}{\eta} \sqrt{\frac{B}{\mu_0}}$. If the Hessian norm exceeds this, the noise becomes too violent for the optimizer to stay put.

Key Results

The authors validated their theoretical findings using synthetic models (Linear networks, Random Feature Models) and standard benchmarks like CIFAR-10 across various architectures (FCN, CNN, VGG-19, ResNets).

  • Theoretical Proof: For linear networks and RFMs, the authors rigorously proved that the alignment factor $\mu(\theta)$ is bounded below by a constant, ensuring the alignment property holds.
  • Empirical Confirmation: Experiments showed that $\mu(\theta)$ remains significantly positive throughout training.
  • Sharpness vs. Model Size: As predicted, the Frobenius norm of the Hessian remained nearly constant even as model depth and width increased by orders of magnitude, while the trace of the Hessian (a different measure of sharpness) increased.
Sharpness measures vs. model size. The Frobenius norm remains constant while the trace increases.
  • Batch Size/Learning Rate Relationship: The experiments confirmed that the "flatness" found by SGD scales with $\sqrt{B}/\eta$, providing a theoretical justification for the common practice of tuning these two hyperparameters in tandem.

Limitations and Future Work

  • Local vs. Global: The analysis is primarily "local," focusing on the behavior around a minimum. It doesn't fully explain the "global" trajectory of SGD from initialization to the final valley.
  • Loss Function Specificity: Much of the rigorous proof relies on square loss. While empirical results on cross-entropy (standard for CIFAR-10) align with the theory, a formal proof for other loss functions remains for future work.
  • Generalization Link: While the paper explains why SGD finds flat minima, it takes for granted the existing assumption that "flat equals better generalization." Bridging the gap between this stability analysis and formal generalization bounds is a logical next step.

Summary updated

BibTeX
@inproceedings{wu2022alignment,
  author = {Lei Wu and Mingze Wang and Weijie Su},
  title = {{The alignment property of SGD noise and how it helps select flat minima: A stability analysis}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=TyJbHknaC5},
}
Figure