Profile

Settings

Loading…

← Papers

Help

FAQ

Which features require signing in?

You can read the commentary, paper info, Model Structure and related papers of public papers without signing in. Sign in to manage your account or contact us about your inquiries.

Can I upload a PDF file?

Upload papers with an arXiv or DOI link; the commentary is public to everyone. Papers whose source and terms of use can't be verified, so the commentary can't be made public, can't be uploaded. Uploading PDF files and keeping papers private are for subscribers only, and a paper uploaded as a file is saved as private only. Searching for official info by title runs only when you press the button.

Are the figures and AI commentary accurate?

Figures come only from the original paper, and only those whose terms of use are verified are shown. The commentary is written by AI and may be wrong. Check important claims, numbers and figure context against the evidence in the original paper.

I want to report a copyright issue.

Terms of use and the source of the original paper are on the Paper info tab. If there's a problem, choose "Paper content, figures and copyright" under Contact us and send the paper link, the part in question, and evidence that you hold the rights. Receiving your report doesn't confirm any rights or remove anything right away. You can see the result of the review under My inquiries.

I forgot my password.

If you signed up with email, use Forgot password in the sign-in window to reset it with your verified email. If you signed up with Google, Naver or Kakao, change your password with that service.

What should I include in an inquiry?

Tell us which screen you were on and what you were doing when the problem happened, along with the paper link. Don't include personal information such as passwords, API keys, verification codes or phone numbers. Inquiries and replies are stored in Refivu and you can see them under My inquiries.

How do I delete my account?

In Settings, under My account, press Delete account. Review what will be deleted and complete identity verification to delete your account. For other requests, choose "Account" under Contact us.

Paper commentary

Decoupled Weight Decay Regularization

Adam with decoupled weight decay generalizes better than L2 regularization

  • Problem L2 regularization and weight decay are equivalent for SGD but not for Adam. Adam's per-weight scaling rescales the L2 penalty, so weights with large gradients are regularized less.
  • Method AdamW moves weight decay out of the gradient update, applying it directly to the weights. The decay skips Adam's adaptive scaling, so every weight shrinks at the same rate.
  • Results AdamW reached 15% relative lower test error than Adam on CIFAR-10 and ImageNet32x32 at learning rate 0.001.

Why L2 regularization fails in Adam

Adaptive gradient methods such as Adam have become a default choice for training neural networks. Yet the best image classification results on CIFAR-10 and CIFAR-100 still come from SGD with momentum. Wilson et al. (2017) reported that adaptive methods generalize worse than SGD with momentum across several deep learning tasks. The authors trace a large part of Adam's gap to L2 regularization, which works far less well for Adam than for SGD.

For plain SGD, L2 regularization and weight decay are the same once the L2 coefficient is scaled by the learning rate. Deep learning libraries therefore often call L2 regularization weight decay. That equivalence breaks for Adam, and the authors argue this is the part most often overlooked.

Inside Adam the L2 term joins the batch gradient, so the adaptive scaling rescales the penalty together with the loss gradient. A weight that tends to have large gradients therefore gets a smaller effective penalty than it would under weight decay. This mechanism is the basis of the authors' claim that L2 regularization is not effective in Adam.

Decoupling the decay from the gradient step

The idea is to shrink the weights in a separate step, rather than folding the penalty into the gradient. Each weight then decays at the same rate λ, whatever its gradient history. The starting point is the classic weight decay rule, in which each step multiplies the weights by \((1-\lambda)\) before the gradient step: \( \theta_{t+1} = (1-\lambda)\theta_t - \alpha\nabla f_t(\theta_t) \).

For plain SGD, this matches L2 regularization with the coefficient \( \lambda' = \lambda\alpha \).

The authors apply the same idea to SGD with momentum, which gives SGDW, where the decay sits in the parameter update of Line 9 in Algorithm 1. The scaling factor \( \eta_t \) multiplies the decay term along with the learning rate, so both can follow one schedule. For Adam, the change sits in line 12 of Algorithm 2, which gives AdamW. There the decay term \( \eta_t\lambda\theta_{t-1} \) is added outside the fraction \( \alpha\hat m_t/(\sqrt{\hat v_t}+\epsilon) \), so it is not divided by the second-moment estimate.

Why adaptive scaling breaks the equivalence

The authors prove that, when the preconditioner \(M_t\) is not a multiple of the identity, no L2 coefficient makes the two update rules equal. The reason is that Adam's per-weight scaling rescales the penalty by a different amount for each weight. Where the typical gradient is large, the penalty is damped, so those weights are regularized by a smaller relative amount.

Decoupled decay skips that normalization and applies one uniform rate, so weights with large historic gradients are regularized more than under L2. The authors make this precise for a fixed diagonal preconditioner \( M_t = \mathrm{diag}(s)^{-1} \). In that case weight decay performs the same steps as an optimizer without decay on a loss with penalty \( \frac{\lambda'}{2\alpha}\|\theta\odot\sqrt{s}\|_2^2 \), where \( \lambda'=\lambda\alpha \).

Each parameter's penalty is scaled by \( \sqrt{s_i} \), so a parameter with a large inverse preconditioner \( s_i \) is regularized more. The authors add that this result does not directly cover practical Adam, because its preconditioner changes at every step.

A Bayesian filtering view of the decay

The authors also give a justification based on Aitchison's (2018) unified view of adaptive gradient methods as Bayesian filtering. In that view the optimizer's parameters are tracked over time, with a state transition prior describing a small, data-independent change between steps. A likelihood from each mini-batch then updates the belief about the parameters.

With a Gaussian transition and an approximate conjugate likelihood, the posterior mean moves by the posterior covariance times the gradient, \( \mu_{post} = \mu_{prior} + \Sigma_{post} \times g \). The posterior uncertainty therefore acts as a preconditioner, so uncertain parameters take larger steps. Aitchison also shows that Adam, RMSprop and Kronecker-factored methods fit this framework.

Decoupled decay fits into the state transition, \( P(\theta_{t+1}|\theta_t)=\mathcal{N}((I-A)\theta_t,Q) \), where \(Q\) is the covariance of the Gaussian perturbations. With \(A=\lambda I\), this regularizer is exactly decoupled weight decay, and it applies to the prior without depending on each parameter's uncertainty. L2 regularization, by contrast, would need that uncertainty.

Learning rate schedules for Adam and AdamW

The first experiment compares Adam with L2 regularization against AdamW under three learning rate schedules. The network is a 26 2x64d ResNet on CIFAR-10, trained for 100 epochs with batch size 128. The schedules were fixed, step-drop with drops at epochs 30, 60 and 80, and cosine annealing. For each schedule the authors varied the initial learning rate and the weight decay factor.

Decoupled weight decay beat L2 regularization under every schedule, and the gap grew with the better schedules. Cosine annealing was clearly best, so the authors used it for the rest of the experiments. The authors argue that Adam can still gain from a global learning rate multiplier, even though it adapts each parameter's rate.

The decoupled variant also gave a more separable search space, which the authors show in the hyperparameter plots. This matters for tuning, because a good weight decay is easier to find when the learning rate is also being set.

Separating the learning rate from the weight decay

The next experiment asks whether the learning rate and the weight decay can be tuned separately, starting with SGD. With L2 regularization in SGD, the best settings lie along a diagonal of the grid, so the two values depend on each other. From the top setting, α = 1/2 and λ = 1/8 * 0.001, changing only one value would worsen results, according to the authors.

The authors suggest this coupling may have helped create SGD's reputation for sensitivity to hyperparameters.

That kind of single-knob tuning does not work with L2 regularization in SGD.

For Adam with L2, the best non-zero L2 factors did no better than setting the factor to zero. Adam's best settings also trailed SGD's best settings. AdamW largely decouples weight decay from the learning rate, and its best settings rivaled those of SGD and SGDW.

Generalization over 1800 epochs

The authors then ran much longer training, 1800 epochs, to test generalization. The initial learning rate was fixed at 0.001, and the comparison used 12 L2 settings for Adam against 7 normalized weight decay settings for AdamW. Normalized weight decay is a rescaling by a factor that depends on the number of batch passes, so the setting depends on the run's total budget.

The authors' experiments suggest that longer runs call for smaller weight decay.

AdamW then often achieved lower training loss and lower test error. L2 weight decay in Adam did not give results as good as decoupled decay.

The question is whether AdamW's gain is just faster convergence. For the best settings, AdamW also had better test error at similar training loss values, which the authors read as better generalization. ImageNet32x32 gave the same conclusion, according to the authors.

Warm restarts and anytime performance

Warm restarts were the authors' earlier tool for SGD, and here they are added to the decoupled variants. This gives SGDWR and AdamWR, which are meant to improve anytime performance.

AdamWR sped AdamW up by up to a factor of 10 at the first restart on CIFAR-10 and ImageNet32x32. At the default learning rate of 0.001, AdamW had a 15% relative improvement in test error over Adam on both datasets. The authors say AdamWR kept that gain with much better anytime performance. On CIFAR-10 this closed most of the gap to SGDWR, and the authors also report comparable performance on ImageNet32x32.

Use in other experiments

Several groups have used AdamW in their own work, which the authors cite as evidence of adoption. Wang et al. (2018) used it for a face detection network on WIDER FACE, reporting almost 10x faster predictions than earlier methods at comparable performance.

Völker et al. (2018) used AdamW with cosine annealing for EEG error detection networks. With the same hyperparameters, AdamW scored 73.68% on Deep4Net, compared to 71.37% for Adam. On the ResNet variant it scored 72.04%, compared to 61.34% for Adam, and the authors call that gap statistically significant. The EEG paper itself had no Adam comparison, so these numbers come from the EEG authors' own runs.

Zhang et al. (2018) also compared L2 regularization and weight decay on CIFAR with ResNet and VGG, and found decoupled decay consistently better where the two differ.

Limits of the evidence

The image classification results rest on CIFAR-10 and ImageNet32x32, and the authors say they must be verified on a wider range of tasks. They single out tasks where regularization is expected to matter most.

The analysis centers on Adam, and the authors expect similar results for AdaGrad and AMSGrad without testing them. The EEG results are the EEG authors' own comparison, so the paper did not run that experiment itself.

Paper info

Authors
Ilya Loshchilov, Frank Hutter
Venue
arXiv · Preprint
First published
2017-11-14
Added
2026-11-6
Updated
2019-1-4
Version
v3
arXiv
1711.05101
Category
cs.LG · cs.NE · math.OC
Original paper terms
arXiv non-exclusive 1.0
What we show
Paper info and commentary

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

Quote from the paper

Ilya Loshchilov, Frank Hutter (2017). Decoupled Weight Decay Regularization. arXiv:1711.05101v3. https://arxiv.org/abs/1711.05101v3

BibTeX
@misc{loshchilov2017decoupled,
  title = {{Decoupled Weight Decay Regularization}},
  author = {Ilya Loshchilov and Frank Hutter},
  year = {2017},
  eprint = {1711.05101},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1711.05101v3}
}

See related papersBrowse other papers

Paper preview
Account security

Connect Google account

If you connect a Google account, you can sign in with it too.

Refivu

Delete account

Refivu
Refivu

Sign up