Skip to main content
QUICK REVIEW

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

Zeke Xie, Zhiqiang Xu|arXiv (Cornell University)|Nov 23, 2020
Advanced Neural Network ApplicationsComputer Science6 citations
TL;DR

This paper identifies that weight decay in adaptive optimizers like Adam can lead to large gradient norms at training end, harming convergence and generalization. To mitigate this, it proposes Scheduled Weight Decay (SWD), a gradient-norm-aware scheduler that dynamically reduces weight decay strength when gradient norms grow, significantly improving generalization and often matching or surpassing SGD performance.

ABSTRACT

Weight decay is a simple yet powerful regularization technique that has been very widely used in training of deep neural networks (DNNs). While weight decay has attracted much attention, previous studies fail to discover some overlooked pitfalls on large gradient norms resulted by weight decay. In this paper, we discover that, weight decay can unfortunately lead to large gradient norms at the final phase (or the terminated solution) of training, which often indicates bad convergence and poor generalization. To mitigate the gradient-norm-centered pitfalls, we present the first practical scheduler for weight decay, called the Scheduled Weight Decay (SWD) method that can dynamically adjust the weight decay strength according to the gradient norm and significantly penalize large gradient norms during training. Our experiments also support that SWD indeed mitigates large gradient norms and often significantly outperforms the conventional constant weight decay strategy for Adaptive Moment Estimation (Adam).

Motivation & Objective

  • To identify overlooked pitfalls of weight decay in adaptive optimization, particularly its tendency to induce large gradient norms at training termination.
  • To analyze how large gradient norms negatively impact convergence and generalization in adaptive optimizers like Adam.
  • To propose a novel, gradient-norm-aware scheduler for weight decay that dynamically adjusts its strength during training.
  • To empirically validate that SWD improves generalization and convergence over constant weight decay strategies in Adam.
  • To demonstrate that SWD can close the generalization gap between Adam and SGD in CNNs.

Proposed method

  • The paper introduces Scheduled Weight Decay (SWD), a dynamic weight decay scheduler that adjusts the decay strength based on the running average of gradient norms.
  • SWD uses a gradient-norm-aware mechanism that reduces weight decay when the gradient norm increases, acting as a negative feedback system.
  • The method is integrated into Adam by decoupling the weight decay term and scaling it by the inverse of the moving average of the squared gradient norm.
  • The core update rule modifies Adam's parameter update to include a learning rate adjustment proportional to $ \frac{1}{\sqrt{\bar{v}_t} + \epsilon} $, where $ \bar{v}_t $ is the mean of the uncentered second moment estimate.
  • The scheduler is designed to penalize large gradient norms, aligning with theoretical insights that low gradient norms correlate with flatter minima and better generalization.
  • SWD is compatible with other optimizers and does not require retraining, making it a plug-in improvement for existing training pipelines.

Experimental results

Research questions

  • RQ1Does weight decay in Adam lead to large gradient norms at the end of training, and if so, why?
  • RQ2How does a large gradient norm at training termination affect model convergence and generalization?
  • RQ3Can a dynamic, gradient-norm-aware scheduler for weight decay improve generalization in Adam compared to constant weight decay?
  • RQ4To what extent can SWD close the generalization gap between Adam and SGD in CNNs?
  • RQ5Is SWD robust to hyperparameter choices such as learning rate and initial weight decay?

Key findings

  • SWD significantly reduces large gradient norms at the end of training, especially in Adam, leading to improved convergence and generalization.
  • On CIFAR-10 with VGG16, AdamS (Adam with SWD) achieved a test error of 4.52%, outperforming AdamW (4.90%) and Adam (5.49%).
  • On ResNet18, AdamS achieved 4.52% test error, compared to 4.90% for AdamW and 5.49% for Adam, demonstrating consistent superiority.
  • With cosine learning rate scheduling and warm restarts, AdamS maintained lower test errors and training losses than AdamW and Adam across all models.
  • AdamS showed greater robustness to hyperparameter choices, maintaining strong performance across a wide range of weight decay values.
  • In some cases, such as language modeling, SWD did not improve performance over $L_2$ regularization, indicating limitations in specific tasks.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.