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

On the different regimes of Stochastic Gradient Descent

Antonio Sclocchi, Matthieu Wyart · DOI

Abstract: Stochastic Gradient Descent (SGD) is the fundamental optimization engine of modern deep learning, yet its internal dynamics are often treated as a "black box." This paper, published in PNAS, provides a theoretical and empirical mapping of SGD's behavior across different hyperparameters. By analyzing a perceptron model and validating it on deep networks, the authors identify three distinct dynamical regimes—noise-dominated, first-step-dominated, and gradient descent—governed by the interplay of learning rate, batch size, and training set size. Crucially, they demonstrate that the transition between these regimes follows a power law determined by the inherent difficulty of the classification task.

Introduction

Despite its ubiquity, SGD is frequently tuned via trial and error. A common theoretical simplification treats SGD as a noisy version of Gradient Descent (GD), where the noise level is controlled by a "temperature" $T = \eta/B$ (learning rate $\eta$ over batch size $B$). However, this analogy fails to account for the finite size of the training set $P$ and breaks down when the batch size exceeds a certain "critical" threshold $B^*$. This research seeks to explain these crossovers and how optimal hyperparameters depend on data volume and task complexity.

Methodology

The researchers employed a two-pronged approach to map these dynamics:

  1. Theoretical Analysis: Using a "teacher-student" perceptron model, they modeled weight dynamics via Stochastic Differential Equations (SDEs) to analytically derive the boundaries between different regimes.
  2. Empirical Validation: They tested these theoretical phases on real-world architectures, including Fully-Connected Networks (FCNs) on MNIST and Convolutional Neural Networks (CNNs) on CIFAR-10. They specifically measured "alignment"—how well the network's output matches the task labels—across the $B$-$\eta$ plane.

The SGD Phase Diagram

The core contribution of the work is the identification of three distinct phases in the $B$-$\eta$ plane, as shown in the phase diagram below:

  • Noise-dominated SGD: In this regime, the "temperature" $T = \eta/B$ is the primary driver. Generalization error remains constant along lines of fixed $\eta/B$.
  • First-step-dominated SGD: At large batch sizes, the very first step of training is so significant that it determines the final weight magnitude, overriding the cumulative effect of subsequent SGD noise.
  • Gradient Descent (GD): At very low temperatures, the noise becomes negligible, and the dynamics revert to standard, deterministic GD.
Phase diagram showing the three dynamical regimes of SGD—noise-dominated, first-step-dominated, and gradient descent—based on the alignment metric.

Scaling Laws and Task Hardness

A key discovery is that the critical batch size $B^*$, which marks the transition from noise-dominated to first-step-dominated behavior, is not a fixed constant. Instead, it follows a power law: $B^* \sim P^\gamma$. The exponent $\gamma$ is determined by a "hardness" parameter $\chi$, which describes the density of data points near the decision boundary. "Harder" tasks (smaller $\chi$) result in a larger $B^*$, explaining why different datasets require vastly different batch sizes for optimal training.

Empirical Results and Generalization

The authors successfully collapsed data from various training set sizes onto single curves by rescaling the batch size by $P^\gamma$. For MNIST, they found $\chi \approx 4$ ($B^* \sim P^{0.2}$), while the more complex CIFAR-10 yielded $\chi \approx 1.5$ ($B^* \sim P^{0.4}$).

Test error phase diagram for the perceptron model, illustrating how generalization performance aligns with the theoretical regime boundaries.

As seen in the test error phase diagrams, the best generalization typically occurs within the noise-dominated regime. Increasing the batch size beyond $B^*$ without adjusting the learning rate can lead to performance degradation, highlighting the importance of understanding these phase boundaries for efficient hyperparameter tuning.

Discussion and Limitations

While the study provides a robust framework for understanding SGD, it focuses primarily on the hinge loss. Future work is needed to establish a more direct mathematical link to the cross-entropy loss commonly used in deep learning. Additionally, while the authors provide evidence that these findings hold for SGD with momentum and weight decay, a full theoretical treatment of these variations remains an open challenge. Finally, while $\chi$ is a powerful abstraction, calculating it directly from raw image data remains difficult, currently requiring estimation from training curves.

Summary updated

BibTeX
@inproceedings{sclocchi2024different,
  author = {Antonio Sclocchi and Matthieu Wyart},
  title = {{On the different regimes of Stochastic Gradient Descent}},
  booktitle = {Proceedings of the National Academy of Sciences},
  year = {2024},
  doi = {10.1073/pnas.2316301121},
}
Figure