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

On the Overlooked Pitfalls of Weight Decay and How to Mitigate Them: A Gradient-Norm Perspective

Zeke Xie, Zhiqiang Xu, Jingzhao Zhang, Issei Sato, Masashi Sugiyama

TL;DR

While weight decay is a staple regularization technique in deep learning, this paper reveals a hidden pitfall: it can inadvertently cause large gradient norms at the end of training, leading to poor convergence and sharper minima. To fix this, the authors introduce Scheduled Weight Decay (SWD), a practical scheduler that dynamically adjusts weight decay strength based on the gradient norm, effectively closing the generalization gap between adaptive optimizers like Adam and standard SGD.

What Problem Does This Paper Address?

Weight decay is universally used to prevent deep neural networks from overfitting by penalizing large weight values. However, its interaction with optimization dynamics—especially when paired with adaptive learning rate methods like Adam—harbors an overlooked issue.

The authors discover that constant weight decay often forces the network into regions with large gradient norms during the final phase of training. In optimization theory, a large gradient norm at the end of training signifies poor convergence. From a generalization standpoint, it tends to trap models in "sharp" local minima rather than "flat" ones, which heavily degrades performance on unseen test data.

Methods

The authors first mathematically demonstrate that the gradient norm upper bound at convergence monotonically increases with weight decay strength. To counteract this, they propose Scheduled Weight Decay (SWD), the first practical gradient-norm-aware weight decay scheduler.

Instead of keeping the weight decay coefficient constant throughout training, SWD dynamically adjusts it using a negative feedback mechanism. Specifically, it scales the weight decay strength inversely to the running mean of the squared gradient norm ($\bar{v}_t$). When integrated into the Adam optimizer, this approach is called AdamS.

Algorithm 2: AdamS

Datasets

The authors evaluated their approach across several standard computer vision and language modeling benchmarks:

  • CIFAR-10 & CIFAR-100: Used with popular convolutional networks including ResNet18/34, VGG16, DenseNet121, and GoogLeNet.
  • ImageNet: Evaluated using ResNet50 to test scalability on large-scale image classification.
  • Penn TreeBank: Used to evaluate language modeling performance via a 2-layer LSTM network.

Key Insights and Ideas

  • The Weight Decay Paradox: While weight decay successfully restricts the norm of the weights, it systematically inflates the norm of the gradients during the final training phases.
  • Sharper Minima: Conventional wisdom suggests that weight decay encourages low-complexity solutions. However, Hessian eigenvalue analysis in this paper reveals that stronger constant weight decay actually leads to sharper, more complex minima.
  • Self-Stabilizing Feedback: SWD acts as a negative feedback loop. If the gradient norm begins to explode, the scheduler automatically reduces the weight decay strength, penalizing the large gradient norm and guiding the optimizer toward flatter, more robust minima.

Key Results

  • Bridging the Adam-SGD Gap: On CIFAR-10 (ResNet18), AdamS achieved a test error of 4.91%, significantly outperforming standard Adam (6.96%) and AdamW (5.08%), performing on par with SGD (5.01%).
  • Consistent Vision Performance: Across CIFAR-100, AdamS consistently delivered the lowest or second-lowest test errors compared to other complex Adam variants like AMSGrad, AdaBound, and RAdam (see Table 1 in the paper).
  • Large-Scale Success: On ImageNet using ResNet50, AdamS achieved a Top-1 test error of 24.19%, beating AdamW (24.29%) and vanilla Adam (30.07%).

Limitations and Future Work

Despite its success in computer vision, SWD does not generalize perfectly to all domains. In language modeling tasks (LSTM on Penn TreeBank), the authors note that standard $L_2$ regularization still yields better test perplexity than both decoupled weight decay and SWD.

Additionally, this work focuses purely on scheduling decoupled weight decay. Exploring how to dynamically schedule standard $L_2$ regularization strength remains an open problem left for future research.

Summary updated

BibTeX
@inproceedings{xie2023overlooked,
  author = {Zeke Xie and Zhiqiang Xu and Jingzhao Zhang and Issei Sato and Masashi Sugiyama},
  title = {{On the Overlooked Pitfalls of Weight Decay and How to Mitigate Them: A Gradient-Norm Perspective}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=vnGcubtzR1},
}
Figure