SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2403.12350 · CVPR · 2024

Friendly Sharpness-Aware Minimization

Xiaolin Huang, Pan Zhou, Tao Li, Xinwen Cheng, Zhengbao He

arXiv · PDF · Open in the Atlas

Code that ran

3 of 4 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 3 failures of our instrument; 1 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2403.12350.json · badge: /api/ran/2403.12350.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
nblt/F-SAM canonical (classifier label)
classifier basis: plan_row
3 ran · 1 no recorded run
FunctionStatusWhere it lives
conv3x3 Ran
ran; our contract draft was wrong, not the code
nblt/F-SAM/models/pyramidnet.py
pointer only (licence: NONE); the stored copy get_code serves, from lixiaotong97/DSU, is pointer only (licence: NONE) · get_code("fac5364e2f53c6db")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, nblt/F-SAM when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

make_layers Ran
ran; our contract draft was wrong, not the code
nblt/F-SAM/models/vgg.py
pointer only (licence: NONE); the stored copy get_code serves, from nblt/marwp, is pointer only (licence: NONE) · get_code("4a29d37fffcfd8b1")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, nblt/F-SAM when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

unpickle Ran
ran; our contract draft was wrong, not the code
nblt/F-SAM/utils.py
pointer only (licence: NONE) · get_code("ef49e82a7403eee1")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, nblt/F-SAM when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_datasets_cutout Not yet run
unverified (harvested, no recorded run)
nblt/F-SAM/utils.py
pointer only (licence: NONE) · get_code("327647e16ca8427b")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, nblt/F-SAM when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

Also present in other papers' code

Of 4 samples lifted from this paper's linked repositories, 4 carry a function identity and 0 do not. Of the 4 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 1 the same month, 3 later) and 1 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
conv3x3 686 other papers
562 dated earlier, 15 the same month, 92 later, 17 same year, order not determinable · 31 only as an assembly brick
1406.2661 (2014-06)
Generative Adversarial Networks
1409.0575 (2014-09)
ImageNet Large Scale Visual Recognition Challenge
1412.6572 (2014-12)
Explaining and Harnessing Adversarial Examples
and 683 more not named here
unpickle 7 other papers
5 dated earlier, 2 later
2105.14083 (2021-05)
Rethinking Noisy Label Models: Labeler-Dependent Noise with Adversarial Awareness
2203.14542 (2022-03)
UNICON: Combating Label Noise Through Uniform Selection and Contrastive Learning
2207.14476 (2022-07)
Centrality and Consistency: Two-Stage Clean Samples Identification for Learning with Instance-Dependent Noisy Labels
and 4 more not named here
make_layers 3 other papers
2 dated earlier, 1 later
1803.05407 (2018-03)
Averaging Weights Leads to Wider Optima and Better Generalization
2312.02517 (2023-12)
Simplifying Neural Network Training Under Class Imbalance
2404.00357 (2024-04)
Revisiting Random Weight Perturbation for Efficiently Improving Generalization

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Sharpness-Aware Minimization (SAM) has been instrumental in improving deep neural network training by minimizing both training loss and loss sharpness. Despite the practical success, the mechanisms behind SAM's generalization enhancements remain elusive, limiting its progress in deep learning optimization. In this work, we investigate SAM's core components for generalization improvement and introduce "Friendly-SAM" (F-SAM) to further enhance SAM's generalization. Our investigation reveals the key role of batch-specific stochastic gradient noise within the adversarial perturbation, i.e., the current minibatch gradient, which significantly influences SAM's generalization performance. By decomposing the adversarial perturbation in SAM into full gradient and stochastic gradient noise components, we discover that relying solely on the full gradient component degrades generalization while excluding it leads to improved performance. The possible reason lies in the full gradient component's increase in sharpness loss for the entire dataset, creating inconsistencies with the subsequent sharpness minimization step solely on the current minibatch data. Inspired by these insights, F-SAM aims to mitigate the negative effects of the full gradient component. It removes the full gradient estimated by an exponentially moving average (EMA) of historical stochastic gradients, and then leverages stochastic gradient noise for improved generalization. Moreover, we provide theoretical validation for the EMA approximation and prove the convergence of F-SAM on non-convex problems. Extensive experiments demonstrate the superior generalization performance and robustness of F-SAM over vanilla SAM. Code is available at https://github.com/nblt/F-SAM .

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2403.12350")
get_code_for_paper("2403.12350")
have("2403.12350")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2403.12350.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2403.12350.svg)](https://syntology.ai/paper/2403.12350)

Connect an agent — have() is free.