Papers › CR-SAM: Curvature Regularized Sharpness-Aware Minimization

CR-SAM: Curvature Regularized Sharpness-Aware Minimization

21 Dec 2023arXiv:2312.13555archive 2025-07-28

Tao Wu, Tie Luo, Donald C. Wunsch

The capacity to generalize to future unseen data stands as one of the utmost crucial attributes of deep neural networks. Sharpness-Aware Minimization (SAM) aims to enhance the generalizability by minimizing worst-case loss using one-step gradient ascent as an approximation. However, as training progresses, the non-linearity of the loss landscape increases, rendering one-step gradient ascent less effective. On the other hand, multi-step gradient ascent will incur higher training cost. In this paper, we introduce a normalized Hessian trace to accurately measure the curvature of loss landscape on {\em both} training and test sets. In particular, to counter excessive non-linearity of loss landscape, we propose Curvature Regularized SAM (CR-SAM), integrating the normalized Hessian trace as a SAM regularizer. Additionally, we present an efficient way to compute the trace via finite differences with parallelism. Our theoretical analysis based on PAC-Bayes bounds establishes the regularizer's efficacy in reducing generalization error. Empirical evaluation on CIFAR and ImageNet datasets shows that CR-SAM consistently enhances classification performance for ResNet and Vision Transformer (ViT) models across various datasets. Our code is available at https://github.com/TrustAIoT/CR-SAM.

PaperPDFCodeCode 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="2312.13555")

Code

Syntology Ran 7 of 11 code samples harvested from 1 repository linked to this paper; 4 have no recorded run. Of those that ran: 1 ran · our draft was wrong; 1 ran · fixture could not drive it; 5 ran with no contract checked.

By repository: official repository: 11 samples from 1 repository, 7 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

trustaiot/cr-sam officialmentioned in papermentioned 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

11 samples harvested; 7 ran; 0 honoured the contract we drafted; 4 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
5ran
4unverified

Licence: 11 of the 11 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 trustaiot/cr-sam. “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.

WRN28_10 trustaiot/cr-sam/models/wrn_28_10.py official repository ran no licence file found · pointer only · 1b6b90e1a60dc199 · report
grad_norm trustaiot/cr-sam/metrics/metrics.py official repository ran no licence file found · pointer only · f019eaa51fe8d809 · report
group_add trustaiot/cr-sam/metrics/hessian.py official repository ran no licence file found · pointer only · 2530e16bed546c6a · report
group_product trustaiot/cr-sam/metrics/hessian.py official repository ran no licence file found · pointer only · c35e05b48a3f5b73 · report
normalization trustaiot/cr-sam/metrics/hessian.py official repository ran no licence file found · pointer only · 0e4f4ed57a87f93d · report
shear_x trustaiot/cr-sam/utils/autoaugment.py official repository ran · fixture could not drive it no licence file found · pointer only · 53613a740588d619 · report
transform_matrix_offset_center trustaiot/cr-sam/utils/autoaugment.py official repository ran · our draft was wrong fingerprinted no licence file found · pointer only · 3e773c6c5bc796d4 · report
ResNet18 trustaiot/cr-sam/models/resnet.py official repository unverified no licence file found · pointer only · b179c6e8a69a7442 · report
ResNet34 trustaiot/cr-sam/models/resnet.py official repository unverified no licence file found · pointer only · 9e5e3e4cd9d178d9 · report
ResNet50 trustaiot/cr-sam/models/resnet.py official repository unverified no licence file found · pointer only · 49cfb2b239af503d · report
apply_policy trustaiot/cr-sam/utils/autoaugment.py official repository unverified no licence file found · pointer only · c7f01b2cafbe5f80 · report

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

1x1 ConvolutionAbsolute Position EncodingsAdamAttentionAverage PoolingBPEBatch NormalizationBottleneck Residual BlockConvolutionDense ConnectionsDropoutGlobal Average PoolingKaiming InitializationLabel SmoothingLayer NormalizationLinear LayerMax PoolingMulti-Head AttentionPosition-Wise Feed-Forward LayerReLUResidual BlockResidual ConnectionSAMSharpness-Aware MinimizationSoftmaxTransformerVision Transformer

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