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

Stable Weight Decay Regularization

Zeke Xie, Issei Sato, Masashi Sugiyama

Abstract

Weight decay is a popular regularization technique for training deep neural networks. While modern libraries often use $L_2$ regularization as a proxy, research has shown that $L_2$ is not identical to weight decay for adaptive gradient methods like Adam. While AdamW (Decoupled Weight Decay) attempted to address this, it remains unstable. We identify that popular implementations of weight decay often damage performance by preventing convergence to stable stationary points. We propose Stable Weight Decay (SWD), a method that fixes this instability from a dynamical perspective. SWD demonstrates significant improvements over $L_2$ and decoupled weight decay, allowing Adam-based optimizers to outperform complex variants and even SGD in generalization.

Introduction

In the landscape of deep learning optimization, weight decay is the standard tool for preventing overfitting. However, a subtle but significant flaw exists in how it is currently implemented. In adaptive optimizers like Adam, the community has largely shifted to Decoupled Weight Decay (AdamW) to separate the weight penalty from the gradient update. Despite this improvement, a fundamental problem remains: constant weight decay prevents the model from truly settling into stable minima, particularly when combined with learning rate schedules.

The Instability of Constant Weight Decay

The core issue identified in this research is that applying a constant weight decay hyperparameter throughout training forces the gradient norms to remain large, even as the learning rate decays. From an optimization standpoint, this means the model never reaches a zero-gradient stationary point.

Mathematically, the authors prove that standard weight decay guarantees non-convergence to a stationary point. This has a direct impact on generalization. Large gradient norms at the end of training are strongly correlated with "sharp" minima in the loss landscape. These sharp basins are notorious for poor performance on unseen data, explaining the persistent "generalization gap" between adaptive optimizers like Adam and traditional Stochastic Gradient Descent (SGD).

Proposed Method: Stable Weight Decay (SWD)

To resolve this, the authors introduce Stable Weight Decay (SWD), implemented in the AdamS algorithm. The intuition is to make the weight decay "gradient-norm-aware."

Instead of a static penalty, SWD dynamically adjusts the weight decay strength inversely proportional to the gradient norm. In AdamS, the weight decay term is scaled by $1/\sqrt{\bar{v}_t}$, where $\bar{v}_t$ is the mean of the exponential moving average of the squared gradients—a value already computed by the Adam optimizer.

This creates a negative feedback loop:

  1. If gradient norms become too large (indicating instability or a sharp region), the weight decay penalty is automatically reduced.
  2. As the model approaches a potential minimum and gradients shrink, the relative influence of weight decay is stabilized.

This mechanism acts as a stabilizer for training dynamics, guiding the optimizer toward wider, flatter basins in the loss landscape, which are more robust and generalize better.

Experimental Evaluation

The effectiveness of SWD was evaluated across standard benchmarks, including CIFAR-10, CIFAR-100, and ImageNet, using various architectures like ResNet, VGG, and DenseNet.

Closing the Generalization Gap

One of the most striking results is AdamS's ability to outperform SGD on tasks where SGD is traditionally superior. On CIFAR-10 with a ResNet18 architecture, AdamS achieved a 4.91% test error, surpassing both AdamW (5.08%) and SGD (5.01%). Furthermore, AdamS consistently outperformed other complex Adam variants such as AMSGrad, Yogi, AdaBound, and RAdam, despite having fewer hyperparameters to tune.

Landscape Analysis

To validate the theoretical motivation, the authors performed Hessian eigenvalue analysis. The results confirmed that AdamS finds significantly flatter minima than AdamW. By visualizing the top Hessian eigenvalues (a mathematical measure of sharpness), the research demonstrates that standard weight decay pushes models into high-complexity, sharp basins, whereas SWD successfully stabilizes the trajectory toward flatter regions.

Robustness and Limitations

AdamS shows remarkable robustness to hyperparameter selection. While AdamW is often sensitive to the specific weight decay value, AdamS maintains high performance across a much broader range of initial values.

However, the method is not a universal fix. In Natural Language Processing (NLP) tasks, specifically training LSTMs on the Penn TreeBank (PTB) dataset, SWD did not outperform standard $L_2$ regularization. The authors suggest that the dynamics of weight decay in language models differ significantly from computer vision, and finding an optimal weight decay scheduler for NLP remains an open area of research.

Conclusion

Stable Weight Decay addresses a fundamental dynamical flaw in modern optimization. By tying the regularization strength to the gradient norm, SWD prevents the destabilization of minima and allows adaptive optimizers to achieve the generalization performance previously reserved for SGD. It offers a simple, hyperparameter-efficient upgrade for practitioners using Adam-based optimizers.

Summary updated

BibTeX
@inproceedings{xie2023stable,
  author = {Zeke Xie and Issei Sato and Masashi Sugiyama},
  title = {{Stable Weight Decay Regularization}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=vnGcubtzR1},
}
Figure