Towards Theoretically Understanding Why SGD Generalizes Better Than ADAM in Deep Learning

Pan Zhou, Jiashi Feng, Chao Ma, Caiming Xiong, Steven C. H. Hoi, Weinan E

Abstract

While adaptive optimizers like ADAM are praised for their rapid convergence, Stochastic Gradient Descent (SGD) consistently achieves superior generalization on test data. This paper investigates this "generalization gap" through the lens of heavy-tailed gradient noise and stochastic differential equations (SDEs). By modeling the optimization process as a Lévy-driven SDE, the authors demonstrate that SGD's gradient noise is more heavy-tailed and anisotropic than ADAM's. These properties allow SGD to escape sharp minima—which generalize poorly—more efficiently than ADAM, which tends to be trapped by its internal smoothing and geometry-normalizing mechanisms.

Introduction

The "generalization gap" between adaptive methods (e.g., ADAM) and non-adaptive methods (e.g., SGD) is a well-documented phenomenon in deep learning. Despite ADAM's efficiency in reducing training loss, SGD-trained models often perform better on unseen data. Previous attempts to explain this gap focused on the concept of "flat" vs. "sharp" minima, suggesting that SGD finds flatter regions of the loss landscape. However, these definitions often lacked mathematical rigor or were sensitive to parameter scaling. This work provides a theoretical framework using heavy-tailed noise distributions to explain why SGD is better at navigating the loss landscape toward generalizable solutions.

Theoretical Framework: Heavy-Tailed Noise

The authors move beyond the standard Gaussian assumption for gradient noise. Instead, they model the optimization path using Lévy-driven SDEs, which incorporate "jumps" via $\alpha$-stable ($S\alpha S$) distributions. The "tail index" $\alpha$ determines the heaviness of the tails; a smaller $\alpha$ indicates a higher probability of large gradient updates (heavy tails).

Figure 1: Comparison of real gradient noise distributions for ADAM and SGD against Gaussian and $\alpha$-stable fits. Real noise exhibits heavy tails better captured by $\alpha$-stable distributions.

Empirical analysis on models like AlexNet confirms that gradient noise in deep learning is non-Gaussian and heavy-tailed. SGD typically exhibits a smaller $\alpha$ than ADAM, meaning its noise provides more frequent "kicks" that can push the model out of local basins.

The Escape Mechanism and Radon Measure

A key contribution is the derivation of an "escaping time" formula. The time $\Gamma$ required to exit a basin $\mathcal{W}$ is approximately $O(\epsilon^{-\alpha}/m(\mathcal{W}))$, where $m(\mathcal{W})$ is the Radon measure of the basin. This measure quantifies the "size" or "stability" of a minimum in a way that accounts for its geometry.

Figure 3: A toy loss landscape $f(x) = \min(x^2, a(x-1)^2)$ illustrating basins of different sharpness. The geometry of these basins, quantified by the Radon measure, influences the escaping time of different optimizers.

The paper argues that SGD's noise is more "anisotropic" (directional), which helps it find escape routes from sharp valleys. In contrast, ADAM's coordinate-wise scaling and exponential moving averages "thin" the noise tails and normalize the geometry. This normalization increases the Radon measure of sharp basins, effectively trapping the optimizer in regions that generalize poorly.

Empirical Validation and Results

Experiments on MNIST and CIFAR-10 validate the theoretical predictions. The authors observed that:

  1. SGD Escapes Faster: Due to heavier tails (smaller $\alpha$) and a noise structure that minimizes the Radon measure for sharp basins, SGD exits poor minima significantly faster than ADAM.
  2. Loss Barriers: Solutions found by SGD and ADAM are often separated by high "loss barriers," suggesting they inhabit fundamentally different regions of the landscape.
  3. Tail Heaviness: Real-world gradient noise is consistently better described by $\alpha$-stable distributions than Gaussian ones across different architectures.

Conclusion

This research provides a rigorous explanation for the generalization gap by linking optimizer dynamics to the statistical properties of gradient noise. By showing that SGD's heavy-tailed, anisotropic noise is better suited for escaping sharp minima, the paper offers a theoretical foundation for why SGD remains the preferred choice for final model performance despite the speed of adaptive methods. Future work may leverage these insights to design new optimizers that balance convergence speed with robust generalization, perhaps by finding invariant Radon measures robust to parameter scaling.

Summary updated

BibTeX
@inproceedings{zhou2020towards,
  author = {Pan Zhou and Jiashi Feng and Chao Ma and Caiming Xiong and Steven C. H. Hoi and Weinan E},
  title = {{Towards Theoretically Understanding Why SGD Generalizes Better Than ADAM in Deep Learning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2020},
  url = {https://openreview.net/forum?id=cWPHZnqRE73},
}
Figure