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

On the Implicit Bias of Adam

Matias D. Cattaneo, Jason Matthew Klusowski, Boris Shigida

Researchers have long wondered why adaptive optimizers like Adam often generalize worse than simple Stochastic Gradient Descent (SGD) on certain tasks, particularly in computer vision. This paper uses "backward error analysis" to reveal a fascinating mathematical mechanism: while SGD implicitly penalizes the $L_2$ norm of gradients (leading to flatter, more robust minima), Adam can actually anti-penalize a perturbed $L_1$ norm. This effectively pushes the model toward sharper, less robust regions of the loss landscape.

The Problem: Implicit Bias in Deep Learning

In deep learning, the "implicit bias" of an algorithm refers to the hidden ways it regularizes a model beyond the explicit loss function. For Gradient Descent (GD), we know that using a finite step size acts like a regularizer that penalizes the $L_2$ norm of the gradients. This steers the model toward "flatter" minima, which usually generalize better to unseen data.

However, adaptive methods like Adam and RMSProp—which scale updates based on moving averages of past gradients—do not follow this same path. Despite their popularity and speed, they often struggle to match SGD's generalization performance on vision tasks. This paper seeks to mathematically characterize the implicit bias of Adam to explain this performance gap.

Methodology: Backward Error Analysis

To uncover this bias, the authors employ backward error analysis (BEA). Instead of looking at the standard Ordinary Differential Equation (ODE) that an optimizer ideally follows (gradient flow), BEA finds a "modified" ODE that the discrete steps of the algorithm actually track much more closely.

The key technical contribution is the derivation of a global, second-order piecewise ODE for Adam in both mini-batch and full-batch settings. By analyzing the "correction term" in this ODE—the difference between the ideal flow and the actual path—the authors can identify exactly what the algorithm is implicitly regularizing (or "anti-regularizing"). The authors proved that their modified ODE stays close to the actual Adam trajectory with an error of only $O(h^2)$, where $h$ is the step size.

The "Anti-Regularization" Effect and Sharpness

While GD penalizes the Euclidean ($L_2$) norm of the gradient, Adam's bias involves a "perturbed $L_1$ norm." This shift happens because Adam normalizes updates by the square root of the second moment of the gradients.

Implicit regularization landscapes for varying epsilon and rho.

This leads to the paper's core insight: the anti-regularization effect. For standard hyperparameter settings (specifically when the squared gradient momentum $\rho$ is larger than the gradient momentum $\beta$), the correction term in Adam’s path actually hinders the reduction of the gradient norm. Instead of smoothing the path, it makes it "rougher."

The $L_1$ norm of the gradient is a first-order approximation of $\ell_\infty$-sharpness. By "anti-penalizing" this norm, Adam is mathematically biased toward "sharper" minima—regions where the loss changes rapidly with small parameter tweaks.

Hyperparameter Sensitivity and Optimization Trajectories

The strength of this sharpness bias is highly sensitive to the ratio of $\beta$ and $\rho$. Increasing $\beta$ (momentum) can help counteract the anti-regularization, while increasing $\rho$ (the denominator's moving average) typically makes it worse.

Optimization trajectories for different values of momentum beta.

In experiments on ResNet-50 and Vision Transformers (ViTs) using CIFAR-10 and CIFAR-100, the authors showed that as they tuned hyperparameters to increase the theoretical "anti-regularization," the measured $L_1$ norm of the gradients rose, and the test accuracy consistently dropped. This pattern held true across diverse architectures, suggesting that this implicit bias is a fundamental property of the Adam optimizer itself, not just a quirk of specific neural network designs.

Limitations and Future Work

While this analysis provides a strong mathematical foundation for understanding Adam's behavior, the authors note a few limitations:

  • The "Edge of Stability": The analysis assumes that higher-order derivatives of the loss function are bounded. However, modern networks often operate at the "edge of stability," where the Hessian (curvature) can be very large, potentially challenging these assumptions.
  • The Transformer Paradox: While Adam struggles with generalization in many vision tasks, it remains the gold standard for Transformers in NLP. The authors hypothesize that in the "interpolation regime" (where training loss is near zero), the anti-regularization effect might vanish, but more work is needed to bridge this gap.
  • Mini-batch Dynamics: While the paper provides the math for the mini-batch case, a deep qualitative dive into how batch noise interacts with this $L_1$ bias is left for future research.

Summary updated

BibTeX
@inproceedings{cattaneo2024implicit,
  author = {Matias D. Cattaneo and Jason Matthew Klusowski and Boris Shigida},
  title = {{On the Implicit Bias of Adam}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=y8YovS0lOg},
}
Figure