HackerPapers

arXiv:1711.05101cs.LG

Decoupled Weight Decay Regularization

Ilya Loshchilov, Frank Hutter

Abstract

L$_2$ regularization and weight decay regularization are equivalent for standard stochastic gradient descent (when rescaled by the learning rate), but as we demonstrate this is \emph{not} the case for adaptive gradient algorithms, such as Adam. While common implementations of these algorithms employ L$_2$ regularization (often calling it "weight decay" in what may be misleading due to the inequivalence we expose), we propose a simple modification to recover the original formulation of weight decay regularization by \emph{decoupling} the weight decay from the optimization steps taken w.r.t. the loss function. We provide empirical evidence that our proposed modification (i) decouples the optimal choice of weight decay factor from the setting of the learning rate for both standard SGD and Adam and (ii) substantially improves Adam's generalization performance, allowing it to compete with SGD with momentum on image classification datasets (on which it was previously typically outperformed by the latter). Our proposed decoupled weight decay has already been adopted by many researchers, and the community has implemented it in TensorFlow and PyTorch; the complete source code for our experiments is available at https://github.com/loshchil/AdamW-and-SGDW

arXiv comments
Published as a conference paper at ICLR 2019
Journal reference
DOI
Subjects
cs.LGMachine Learning cs.NENeural and Evolutionary Computing math.OCOptimization and Control

On Hacker News

Linked by 3 identifiable commenters in 3 comments across 2 threads, from Jan 2019 to Jul 2020. Found in 1 HN submission from Nov 2017 to Nov 2017. Open submission discussions.

Comments linking this paper, per year.

Discussed in comments2 threads

    • > Consider the standard MSE loss in x-space with the popular l2-regularization on the weights (aka weight decay)... Am I missing something? I thought weight decay and l2 regularization could be equivalent when using SGD[1], but are not in adaptive gradient scenarios(the paper…

      aaron-santosView on HNParent context

    • This doesn't seem like a very informative benchmark to me. They don't mention how/whether they tuned the learning rates and batch sizes to optimize for each different device. Like they mention, they also use a very small network that isn't something you need the power of a TPU…

      trishumeView on HNParent context

    • > They don't mention how/whether they tuned the learning rates and batch sizes to optimize for each different device. All networks were trained with the same hyperparameters. Only the batch size was increased with the amount of parallelization used (so increased 8-fold for TPU…

      bigdatarepublicView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.