Papers › Averaging Weights Leads to Wider Optima and Better Generalization

Averaging Weights Leads to Wider Optima and Better Generalization

14 Mar 2018arXiv:1803.05407archive 2025-07-28

Pavel Izmailov, Dmitrii Podoprikhin, Timur Garipov, Dmitry Vetrov, Andrew Gordon Wilson

Deep neural networks are typically trained by optimizing a loss function with an SGD variant, in conjunction with a decaying learning rate, until convergence. We show that simple averaging of multiple points along the trajectory of SGD, with a cyclical or constant learning rate, leads to better generalization than conventional training. We also show that this Stochastic Weight Averaging (SWA) procedure finds much flatter solutions than SGD, and approximates the recent Fast Geometric Ensembling (FGE) approach with a single model. Using SWA we achieve notable improvement in test accuracy over conventional SGD training on a range of state-of-the-art residual networks, PyramidNets, DenseNets, and Shake-Shake networks on CIFAR-10, CIFAR-100, and ImageNet. In short, SWA is extremely easy to implement, improves generalization, and has almost no computational overhead.

PaperPDFCodeCode Syntology ran

In Syntology View this paper on Syntology: its repositories, every harvested function with whether it ran, its licence and the call to fetch it.

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="1803.05407")

Code

Syntology Ran 5 of 9 code samples harvested from 3 repositories linked to this paper; 4 have no recorded run. Of those that ran: 1 ran · honoured contract; 1 ran · violated contract; 2 ran · our draft was wrong; 1 ran with no contract checked.

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

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

timgaripov/swa officialmentioned in papermentioned on GitHubpytorchBSD-2-Clause report
GeorgOhneH/WerbeSkip mentioned on GitHub report
NajibYavari/DD2412 mentioned on GitHubtf report
benathi/fastswa-semi-sup mentioned on GitHubpytorch report
cmu-enyac/Renofeation mentioned on GitHubpytorch report
dice-group/aswa mentioned on GitHubpytorchBSD-2-Clause report
greyhound101/IEEE-CIS-Fraud mentioned on GitHubMIT report
izmailovpavel/contrib_swa_examples mentioned on GitHubpytorch report
izmailovpavel/torch_swa_examples mentioned on GitHubpytorch report
julianfaraone/SWA mentioned on GitHubpytorchBSD-2-Clause report
pycroscopy/atomai mentioned on GitHubpytorchMIT report
simon-larsson/keras-swa mentioned on GitHubtf report
wjmaddox/swa_gaussian mentioned on GitHubpytorchBSD-2-Clause report
zlwangustc/SWA_paddle mentioned on GitHubpaddleBSD-2-Clause 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

9 samples harvested; 5 ran; 1 honoured the contract we drafted; 4 have no recorded run. Read from Syntology's graph 2026-09-25; that is when this build read the record, not when the samples ran.

1ran · honoured contract
1ran · violated contract
2ran · our draft was wrong
1ran
4unverified

Licence: 0 of the 9 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 3 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.

conv3x3 timgaripov/swa/models/wide_resnet.py official repository ran · our draft was wrong BSD-2-Clause (permissive) · 00e569acd6b45ef0 · report
conv3x3 timgaripov/swa/models/preresnet.py official repository ran · our draft was wrong BSD-2-Clause (permissive) · 583f9780bdd00a45 · report
adjust_learning_rate dice-group/aswa/utils.py community (archive-listed) ran · honoured contract BSD-2-Clause (permissive) · 14ebf34e2f003912 · report
check_bn dice-group/aswa/utils.py community (archive-listed) ran · violated contract BSD-2-Clause (permissive) · 6e59364a7cf6008f · report
make_layers dice-group/aswa/models/vgg.py community (archive-listed) ran BSD-2-Clause (permissive) · 4a29d37fffcfd8b1 · report
adjust_learning_rate zlwangustc/SWA_paddle/utils.py community (archive-listed) unverified BSD-2-Clause (permissive) · 8d543b4110270e15 · report
eval dice-group/aswa/utils.py community (archive-listed) unverified BSD-2-Clause (permissive) · ff618422d0032e4e · report
schedule dice-group/aswa/ddp_train.py community (archive-listed) unverified BSD-2-Clause (permissive) · 24584656ffcaea3e · report
selected_epochs dice-group/aswa/analysis.py community (archive-listed) unverified BSD-2-Clause (permissive) · fd2f0d7779c8d75b · report

Tasks

Image ClassificationStochastic Optimization

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Image Classification CIFAR-10 ShakeShake-2x64d + SWA Percentage correct 97.12 #91 of 265 Archive leaderboard report
Image Classification CIFAR-10 WRN-28-10 + SWA Percentage correct 96.79 #100 of 265 Archive leaderboard report
Image Classification CIFAR-100 PyramidNet-272 + SWA Percentage correct 84.16 #78 of 211 Archive leaderboard report
Image Classification CIFAR-100 WRN+SWA Percentage correct 82.15 #110 of 211 Archive leaderboard report
Image Classification ImageNet ResNet-152 + SWA Top 1 Accuracy 78.94% #797 of 1060 Archive leaderboard report
Image Classification ImageNet DenseNet-161 + SWA Top 1 Accuracy 78.44% #832 of 1060 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

Introduced by this paper: Stochastic Weight Averaging

1x1 ConvolutionAverage PoolingBatch NormalizationBottleneck Residual BlockConcatenated Skip ConnectionConvolutionCosine AnnealingDense BlockDense ConnectionsDropoutGlobal Average PoolingKaiming InitializationMax PoolingPyramidNetPyramidal Bottleneck Residual UnitPyramidal Residual UnitReLUResidual BlockResidual ConnectionSGDShake-Shake RegularizationSoftmaxStochastic Weight AveragingWeight DecayWide Residual BlockWideResNetZero-padded Shortcut Connection

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