Papers / Foundations
AdamW (2017)
Decoupled Weight Decay Regularization
Shows that L2 regularization and weight decay differ in Adam, and that decaying weights directly makes Adam generalize nearly as well as SGD.
Why it matters
Adam had a reputation for training fast but generalizing worse than SGD; a large part of that turned out to be a regularization bug copied into every library. With the fix, AdamW and a cosine schedule became the standard recipe for Transformers, from GPT and BERT to today's large language models.
- Year
- 2017
- Authors
- Ilya Loshchilov, Frank Hutter
- Venue
- ICLR 2019
- Data
- CIFAR-10, ImageNet (ILSVRC)
The idea
With plain SGD, adding an L2 penalty to the loss is the same as shrinking every weight a little at each step. In Adam it is not: the penalty's gradient gets divided by each weight's running gradient size, so the weights with the largest gradients are barely regularized. AdamW takes the decay out of the gradient and shrinks the weights directly, separately from Adam's update. That also makes the best weight decay independent of the learning rate.
The result
On CIFAR-10 and a 32×32-pixel version of ImageNet, AdamW cut Adam's test error by about 15% relative, closing most of the gap to SGD with momentum. The best learning rate and weight decay could be tuned one at a time, and a cosine learning-rate schedule helped Adam much more than expected.












