TL;DR
This paper provides a theoretical explanation for why the popular Adam optimizer often generalizes worse than Stochastic Gradient Descent (SGD): its adaptive learning rate mechanism inadvertently makes it "blind" to the flatness of local minima. To fix this, the authors introduce Adaptive Inertia (Adai), a novel optimizer that adaptively adjusts momentum (inertia) rather than learning rates, achieving the fast convergence of Adam with the superior generalization of SGD.
The Generalization Gap
In the world of deep learning, there is a long-standing "generalization gap." Adam is the go-to optimizer for speed, but it often leads to models that perform worse on new data compared to those trained with SGD.
Researchers believe this is because SGD is better at finding "flat minima"—broad regions in the loss landscape that are more robust to small changes in data. Adam, conversely, tends to get stuck in "sharp minima." While previous work suggested this might be due to the nature of the noise in Adam, we lacked a rigorous theoretical understanding of how the two main components of Adam—Adaptive Learning Rates (ALR) and Momentum—individually contribute to this behavior.
Disentangling Adam and Introducing Adai
The authors use diffusion theory (modeling optimization as a physical process of particles moving through a landscape) to disentangle the effects of ALR and Momentum. They analyze two critical behaviors:
- Saddle-point escaping: How quickly the optimizer moves away from "stuck" points that aren't minima.
- Flat minima selection: How the optimizer chooses between broad (good) and narrow (bad) valleys.
Based on their findings, they propose Adaptive Inertia (Adai). Unlike Adam, which scales the learning rate for each parameter based on past gradient variance, Adai keeps the learning rate stable and instead scales the momentum hyperparameter ($\beta_1$) for each parameter. This allows the optimizer to accelerate through flat regions (high inertia) while remaining sensitive to the "sharpness-dependent noise" that helps select better minima.
Key Insights
- ALR is the Generalization Culprit: The math shows that Adaptive Learning Rates make the "escape time" from a minimum less dependent on its sharpness. Essentially, ALR makes sharp and flat minima look the same to the optimizer, so it doesn't prioritize the flat ones.
- Momentum's "Drift Effect": The paper reveals that momentum provides a "drift" that helps the optimizer pass through saddle points much faster than the random noise (diffusion) of SGD alone. Crucially, this drift doesn't interfere with the selection of flat minima.
- The Best of Both Worlds: By making momentum adaptive instead of the learning rate, Adai retains the "sharpness-dependent" noise of SGD (which finds good minima) while gaining the acceleration benefits of Adam (which handles ill-conditioned landscapes).
- Robustness: Adai appears more robust to hyperparameter choices. It has a wider "basin" of effective learning rates and weight decay settings compared to both SGD and Adam.
Key Results
The authors evaluated Adai across a variety of standard benchmarks, including Computer Vision (CIFAR-10, CIFAR-100, ImageNet) and Natural Language Processing (Penn TreeBank).
- Superior Accuracy: On CIFAR-10 (ResNet18), AdaiW achieved a 4.59% test error, significantly beating SGD (5.01%) and Adam (6.53%).
- ImageNet Success: On the massive ImageNet dataset (ResNet50), Adai achieved a Top-1 error of 23.20%, outperforming the SGD baseline (23.51%) and crushing Adam (27.13%).
- Faster Convergence: In many tests, Adai reached lower training losses faster than SGD, matching or exceeding the convergence speed of Adam-style methods.
- Flatter Minima: Empirical analysis of the Hessian eigenvalues (a measure of sharpness) confirmed that Adai consistently finds flatter regions of the loss landscape than Adam.
Limitations and Future Work
- Theoretical Assumptions: The analysis relies on "Low Temperature" and "Quasi-Equilibrium" approximations. While standard in the field, these assume the noise is relatively small and the system is near a steady state, which may not always hold during the chaotic early stages of training.
- Hyperparameter Tuning: While Adai is robust, it still introduces its own default settings. The interaction between adaptive inertia and complex learning rate schedules (like Cosine Annealing) could be explored further.
- Integration: As a new optimizer, it requires implementation in standard libraries before it can see widespread adoption by the broader engineering community.
Summary updated