Papers › Sharpness-Aware Minimization for Efficiently Improving Generalization

Sharpness-Aware Minimization for Efficiently Improving Generalization

3 Oct 2020ICLR 2021 1arXiv:2010.01412archive 2025-07-28

Pierre Foret, Ariel Kleiner, Hossein Mobahi, Behnam Neyshabur

In today's heavily overparameterized models, the value of the training loss provides few guarantees on model generalization ability. Indeed, optimizing only the training loss value, as is commonly done, can easily lead to suboptimal model quality. Motivated by prior work connecting the geometry of the loss landscape and generalization, we introduce a novel, effective procedure for instead simultaneously minimizing loss value and loss sharpness. In particular, our procedure, Sharpness-Aware Minimization (SAM), seeks parameters that lie in neighborhoods having uniformly low loss; this formulation results in a min-max optimization problem on which gradient descent can be performed efficiently. We present empirical results showing that SAM improves model generalization across a variety of benchmark datasets (e.g., CIFAR-10, CIFAR-100, ImageNet, finetuning tasks) and models, yielding novel state-of-the-art performance for several. Additionally, we find that SAM natively provides robustness to label noise on par with that provided by state-of-the-art procedures that specifically target learning with noisy labels. We open source our code at \url{https://github.com/google-research/sam}.

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

Code

Syntology Ran 8 of 20 code samples harvested from 10 repositories linked to this paper; 12 have no recorded run. Of those that ran: 1 ran · our draft was wrong; 1 ran · fixture could not drive it; 6 ran with no contract checked.

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

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

google-research/sam officialmentioned in paperjaxApache-2.0 report
Jannoshh/simple-sam mentioned on GitHubtf report
Janus-Shiau/SAM-tf2 mentioned on GitHubtf report
NiMlr/pynlqn mentioned on GitHub report
Yuheon/Sharp-Aware-Minimization mentioned on GitHubpytorch report
borealisai/perturbed-forgetting mentioned on GitHubpytorch report
davda54/sam mentioned on GitHubpytorchMIT report
denizyuret/playground mentioned on GitHubpytorch report
mhassann22/GCSAM mentioned on GitHubpytorch report
moskomule/sam.pytorch mentioned on GitHubpytorch report
rollovd/LookSAM mentioned on GitHubpytorch report
simon20010923/DDAMFN mentioned on GitHubpytorch 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

20 samples harvested; 8 ran; 0 honoured the contract we drafted; 12 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.

1ran · our draft was wrong
1ran · fixture could not drive it
6ran
12unverified

Licence: 6 of the 20 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 10 repositories linked to this paper, official or community; each sample names its own and says which. Some samples are identical code Syntology first harvested from another repository; for those, this paper's copy is not located and its licence is not recorded. “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.

cutout google-research/sam/sam_jax/datasets/augmentation.py official repository unverified Apache-2.0 (permissive) · 33f3bcef5a763ff8 · report
dense_layer_init_fn google-research/sam/sam_jax/models/utils.py official repository unverified Apache-2.0 (permissive) · be4a2c63cc33ff44 · report
name_to_image_size google-research/sam/sam_jax/efficientnet/efficientnet.py official repository unverified Apache-2.0 (permissive) · cb2821198470712c · report
normalize_image google-research/sam/sam_jax/datasets/dataset_source_imagenet.py official repository unverified Apache-2.0 (permissive) · 245dfb545218b755 · report
preprocess_for_eval google-research/sam/sam_jax/datasets/dataset_source_imagenet.py official repository unverified Apache-2.0 (permissive) · db053b3b48a12365 · report
round_filters google-research/sam/sam_jax/efficientnet/efficientnet.py official repository unverified Apache-2.0 (permissive) · 2c7d0d794dc5a73c · report
round_repeats google-research/sam/sam_jax/efficientnet/efficientnet.py official repository unverified Apache-2.0 (permissive) · 61a40ee8921487b9 · report
shake_shake_train google-research/sam/sam_jax/models/utils.py official repository unverified Apache-2.0 (permissive) · 16e98d61f39aa54e · report
weak_image_augmentation google-research/sam/sam_jax/datasets/augmentation.py official repository unverified Apache-2.0 (permissive) · 967ecdba90ad4784 · report
AssignLR wangermeng2021/Scaled-YOLOv4-tensorflow2/utils/sam.py community (archive-listed) ran Apache-2.0 (permissive) · 6b43b1c7e8d505da · report
SAM simon20010923/DDAMFN/DDAMFN++/sam.py community (archive-listed) ran no licence file found · pointer only · f04e7b9eb0136335 · report
SAM Jannoshh/simple-sam/sam.py community (archive-listed) ran MIT (permissive) · 954d13e2c6b31007 · report
SAMOptimizer wangermeng2021/Scaled-YOLOv4-tensorflow2/utils/sam.py community (archive-listed) ran Apache-2.0 (permissive) · dfc916dc5ccaee4e · report
SAMSGD moskomule/sam.pytorch/sam.py community (archive-listed) ran MIT (permissive) · 5583e2f7e9e49a0c · report
SAM_optimizer ys-zong/medfair/models/SAM/utils.py community (archive-listed) ran no licence file found · pointer only · 46c3f10ab0f4669c · report
sam NiMlr/pynlqn/pynlqn/algorithms.py community (archive-listed) ran · our draft was wrong MIT (permissive) · 23710a8851b7ec81 · report
GCSAM mhassann22/GCSAM/cifar10_gcsam_resnet50.py community (archive-listed) unverified no licence file found · pointer only · 90e63eaa2117ba4e · report
LookSAM rollovd/LookSAM/looksam.py community (archive-listed) unverified no licence file found · pointer only · 2debef19d3a36af7 · report
SAMWarpper Janus-Shiau/SAM-tf2/lib/optimizers/sam.py community (archive-listed) unverified no licence file found · pointer only · b2eabc22e2ca9282 · report
centralized_gradient identical code first harvested elsewhere ran · fixture could not drive it fingerprinted licence of this copy not recorded · 27a3d56a09e0e7cf · report

Tasks

Fine-Grained Image ClassificationImage ClassificationLearning with noisy labels

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Fine-Grained Image Classification Birdsnap EffNet-L2 (SAM) Accuracy 90.07% #1 of 5 Archive leaderboard report
Fine-Grained Image Classification FGVC Aircraft EffNet-L2 (SAM) Top-1 Error Rate 4.82 #56 of 57 Archive leaderboard report
Fine-Grained Image Classification Food-101 EffNet-L2 (SAM) Accuracy 96.18 #2 of 15 Archive leaderboard report
Fine-Grained Image Classification Oxford-IIIT Pets EffNet-L2 (SAM) Accuracy 97.10 #1 of 19 Archive leaderboard report
Fine-Grained Image Classification Oxford-IIIT Pets EffNet-L2 (SAM) Top-1 Error Rate 2.90% #1 of 19 Archive leaderboard report
Fine-Grained Image Classification Stanford Cars EffNet-L2 (SAM) Accuracy 95.96% #8 of 83 Archive leaderboard report
Image Classification CIFAR-100 EffNet-L2 (SAM) Percentage correct 96.08 #1 of 211 Archive leaderboard report
Image Classification CIFAR-100 PyramidNet (SAM) Percentage correct 89.7 #27 of 211 Archive leaderboard report
Image Classification CIFAR-100 CNN39 Percentage correct 42.64 #205 of 211 Archive leaderboard report
Image Classification CIFAR-100 CNN36 Percentage correct 36.07 #206 of 211 Archive leaderboard report
Image Classification Flowers-102 EffNet-L2 (SAM) Accuracy 99.65% #6 of 52 Archive leaderboard report
Image Classification ImageNet EfficientNet-L2-475 (SAM) Number of params 480M #35 of 1060 Archive leaderboard report
Image Classification ImageNet EfficientNet-L2-475 (SAM) Top 1 Accuracy 88.61% #35 of 1060 Archive leaderboard report
Image Classification ImageNet ResNet-152 (SAM) Top 1 Accuracy 81.6% #621 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: Sharpness-Aware Minimization

Sharpness-Aware Minimization

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