Papers › Decoupled Weight Decay Regularization

Decoupled Weight Decay Regularization

14 Nov 2017ICLR 2019 5arXiv:1711.05101archive 2025-07-28

Ilya Loshchilov, Frank Hutter

L₂ 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₂ 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

PaperPDFConference PDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="1711.05101")

Code

Syntology Ran 10 of 23 code samples harvested from 9 repositories linked to this paper; 13 have no recorded run. Of those that ran: 3 ran · honoured contract; 7 ran with no contract checked.

By repository: community (archive-listed): 23 samples from 9 repositories, 10 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

23 repositories listed; official and paper-mentioned ones first.

GLambard/AdamW_Keras officialmentioned in papermentioned on GitHubtf report
Yagami123/Caffe-AdamW-AdamWR officialmentioned in papermentioned on GitHubMIT report
loshchil/AdamW-and-SGDW officialmentioned in papermentioned on GitHubtorchBSD-3-Clause report
DeadAt0m/adafactor-pytorch mentioned on GitHubpytorch report
GPUPhobia/vocal-mask mentioned on GitHubpytorch report
JakobHavtorn/nn mentioned on GitHubpytorch report
ShikamaruZhang/AdamW mentioned on GitHubtf report
albertopolito/CarSNN mentioned on GitHubpytorch report
bojone/tiger mentioned on GitHubtfMIT report
facebookresearch/ClassyVision mentioned on GitHubpytorch report
kayuksel/pytorch-adamaio mentioned on GitHubpytorch report
mikeedjones/denoising mentioned on GitHubpytorch report
mpyrozhok/adamwr mentioned on GitHubpytorch report
pityka/lamp mentioned on GitHubpytorchNOASSERTION report
sajadn/AdamW mentioned on GitHub report
sayakpaul/FunMatch-Distillation mentioned on GitHubtf report
txping/AEGD mentioned on GitHubpytorchBSD-3-Clause report
warner-benjamin/optimi mentioned on GitHubpytorchMIT report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

23 samples harvested; 10 ran; 3 honoured the contract we drafted; 13 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

3ran · honoured contract
7ran
13unverified

Licence: 5 of the 23 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 9 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

AdaFactor DeadAt0m/adafactor-pytorch/adafactor.py community (archive-listed) ran no licence file found · pointer only · 7b180121ac155bb6 · report
AdamAIO kayuksel/pytorch-adamaio/AdamAIO.py community (archive-listed) ran GPL-3.0 (copyleft) · pointer only · 6648843cdfb2e00f · report
AdamLearningRuleWithWeightDecay ceballots/Adam-with-cosine-scheduler-implementation/mlp/learning_rules.py community (archive-listed) ran no licence file found · pointer only · 3e79240a1f942f4f · report
AdamW mpyrozhok/adamwr/adamw.py community (archive-listed) ran MIT (permissive) · faa061fd5685d74b · report
AdamW GPUPhobia/vocal-mask/adamW.py community (archive-listed) ran · metamorphic tier: deterministic no licence file found · pointer only · 6fc00b833d205b4a · report
GradientDescentLearningRule ceballots/Adam-with-cosine-scheduler-implementation/mlp/learning_rules.py community (archive-listed) ran no licence file found · pointer only · 9749c3fc16a64488 · report
OpenAIAdam huggingface/pytorch-openai-transformer-lm/opt.py community (archive-listed) ran · metamorphic tier: deterministic MIT (permissive) · 128b0ca0cc3fcfa7 · report
warmup_constant huggingface/pytorch-openai-transformer-lm/opt.py community (archive-listed) ran · honoured contract fingerprinted MIT (permissive) · 3e3a777867228513 · report
warmup_cosine huggingface/pytorch-openai-transformer-lm/opt.py community (archive-listed) ran · honoured contract fingerprinted MIT (permissive) · 88472ac3b24f5c40 · report
warmup_linear huggingface/pytorch-openai-transformer-lm/opt.py community (archive-listed) ran · honoured contract fingerprinted MIT (permissive) · db7025fa144619f4 · report
Adam JakobHavtorn/nn/optim/adam.py community (archive-listed) unverified MIT (permissive) · ba570ad7fc7fc941 · report
Optimizer JakobHavtorn/nn/optim/adam.py community (archive-listed) unverified MIT (permissive) · 921eeee14c254068 · report
build_dataset txping/AEGD/cifar.py community (archive-listed) unverified BSD-3-Clause (permissive) · 4a2deb333c7b2ffc · report
densenet_BC_cifar txping/AEGD/models/densenet.py community (archive-listed) unverified BSD-3-Clause (permissive) · 82c4a089e2b7e391 · report
g txping/AEGD/kmeans.py community (archive-listed) unverified BSD-3-Clause (permissive) · f20b24ac49219c59 · report
get_ckpt_name txping/AEGD/cifar.py community (archive-listed) unverified BSD-3-Clause (permissive) · aceb14a284cee511 · report
knn_grad txping/AEGD/kmeans.py community (archive-listed) unverified BSD-3-Clause (permissive) · 66566899efdb28f6 · report
knn_loss txping/AEGD/kmeans.py community (archive-listed) unverified BSD-3-Clause (permissive) · 88df672e7dff6e46 · report
load_checkpoint txping/AEGD/cifar.py community (archive-listed) unverified BSD-3-Clause (permissive) · c43443043827f5d7 · report
quad txping/AEGD/testfuncs.py community (archive-listed) unverified BSD-3-Clause (permissive) · b2b4236bed8e9191 · report
rosen txping/AEGD/testfuncs.py community (archive-listed) unverified BSD-3-Clause (permissive) · 48924d708c94ad1e · report
sample_bernoulli ethancaballero/Restricted_Boltzmann_Machine__RBM/dist_util.py community (archive-listed) unverified MIT (permissive) · 9187f52a3b57c15e · report
squeezenet txping/AEGD/models/squeezenet.py community (archive-listed) unverified BSD-3-Clause (permissive) · 08bbda72259c9385 · report

Tasks

Image Classificationimage-classification

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Introduced by this paper: AdamW

AdamAdamWSGDSGD with MomentumSGDWWeight Decay

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections