Poor generalisation in deep neural networks is frequently associated with convergence to sharp minima. Sharpness-Aware Minimisation (SAM) improves generalisation of deep neural networks by minimising a combination of the training loss and the local sharpness of the loss landscape, biasing convergence towards flat minima. However, SAM relies on a fixed perturbation radius ρ that ignores local curvature, leading to inefficient behaviour: the perturbation may be too small to escape poor basins defined by sharp local minima, or too large to allow convergence to solutions with good loss-sharpness tradeoff. We reinterpret ρ as the intensity of the perturbation signal and propose Curvature-Aware Adaptive Perturbation for SAM (CAP-SAM), a geometry-aware method that modulates the perturbation radius based on a sharpness ratio, enabling a more effective search for robust minima on the loss landscape. We prove that CAP-SAM preserves the same convergence rate as standard SAM in non-convex stochastic settings. Extensive experiments indicate that our approach consistently outperforms SAM and its most prominent variants across diverse network architectures on CIFAR-10, CIFAR-100, and ImageNet.
Figures & tables
Figure 1: Curvature-aware perturbation radius scheduling. The top panel illustrates how our method adjusts the perturbation radius based on the sharpness characteristics of the loss landscape. The bottom panel shows how ρt evolves: when in a sharp region, ρt expands by a factor of γ to look further ahead and escape the sharp basin; when in a flat region, ρt contracts by the same factor, so the optimizer stops perturbing aggressively and settles into the local minimum.
Figure 2: Illustration of SAM perturbation directions in flat and sharp regions of the loss landscape.
Figure 3: PyramidNet-110 on CIFAR-100. (a) Training loss L(D;wt) and (b) test accuracy (top-1) for CAP-SAM, SAM, and SGD.
SAM
ASAM
Fisher SAM
VaSSO
Model
Const.
Dynam.
Const.
Dynam.
Const.
Dynam.
Const.
Dynam.
VGG-11-BN
93.82±0.05
94.14±0.09
93.47±0.04
94.13±0.27
93.60±0.09
94.14±0.15
93.93±0.13
94.17±0.14
ResNet-18
96.58±0.10
96.66±0.03
96.33±0.09
96.91±0.08
96.62±0.07
96.79±0.06
96.60±0.08
96.74±0.23
WRN-28-10
97.32±0.11
97.47±0.06
97.15±0.05
97.56±0.07
97.46±0.06
97.48±0.10
97.46±0.09
97.16±0.08
PyramidNet-110
97.58±0.02
97.70±0.05
97.56±0.11
97.76±0.03
97.59±0.07
97.77±0.06
97.64±0.09
97.76±0.05
Table 1: Top-1 test accuracy (%) on CIFAR-10 with Cutout augmentation.
Figure 4: Effect of hyperparameters with ResNet-18 on CIFAR-10.
SAM
ASAM
Fisher SAM
VaSSO
Model
Const.
Dynam.
Const.
Dynam.
Const.
Dynam.
Const.
Dynam.
VGG-11-BN
73.59±0.10
74.15±0.14
68.53±0.15
73.46±0.09
73.82±0.31
74.38±0.13
74.02±0.07
74.23±0.19
ResNet-18
80.52±0.37
81.10±0.08
78.91±0.27
81.03±0.12
80.82±0.14
81.12±0.14
80.70±0.21
81.29±0.24
WRN-28-10
84.64±0.10
85.10±0.16
83.88±0.27
85.03±0.21
84.47±0.06
84.94±0.16
84.77±0.07
84.87±0.28
PyramidNet-110
85.60±0.11
86.49±0.11
83.72±0.09
86.90±0.18
85.55±0.14
86.64±0.23
85.85±0.09
86.89±0.35
Table 2: Top-1 test accuracy (%) on CIFAR-100 with Cutout augmentation.
Method
IMAGENET-
1K
Real
V2
R
Sketch
SGD
—
76.72±0.09
83.02±0.02
64.40±0.07
19.95±0.12
20.56±0.20
SAM
Const.
77.45±0.088
83.84±0.08
65.34±0.16
20.81±0.34
22.12±0.17
Dynam.
77.65±0.11
84.03±0.07
65.53±0.18
20.95±0.07
21.90±0.18
GSAM
Const.
77.37±0.07
83.83±0.07
65.42±0.18
20.93±0.25
21.26±0.51
Dynam.
77.65±0.15
83.98±0.09
65.54±0.22
21.14±0.09
22.24±0.16
Table 3: Top-1 accuracy (%) on ImageNet and robustness datasets for ResNet-50.
Appendix figures & tables9 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 5: Investigation of the SAM perturbation direction near convergence. (a) Away from convergence, ∇f(wt) dominates and the perturbation εSAM remains reasonably aligned with the true gradient direction. (b) Near a stationary point, ∇f(wt)≈0 and gt(wt)≈ξ , the perturbation direction becomes increasingly dominated by stochastic gradient noise making the perturbation uninformative about the local loss curvature Li et al. (2024) .
Factor
degrees-of-freedom
F-value
p-value
Mean acc. gain ( % )
CI95
(dynam. - const.)
Variant
1
19.51
1.83×10−4
0.23
[0.12,0.33]
Method
3
0.451
0.72
—
—
Model
3
1107.6
7.42×10−26
—
—
Residuals
24
—
—
—
—
Appendix
Table 4: ANOVA table and effect size estimation for the CIFAR-10 test. Statistically significant effects at the 95% confidence level are shown in boldface
Factor
degrees-of-freedom
F-value
p-value
Mean acc. gain ( % )
CI95
(dynam. - const.)
Variant
1
13.32
1.27×10−3
1.14
[0.50,1.78]
Method
3
4.38
0.013
—
—
Model
3
335.3
1.02×10−19
—
—
Residuals
24
—
—
—
—
Appendix
Table 5: ANOVA table and effect size estimation for the CIFAR-100 test. Statistically significant effects at the 95% confidence level are shown in boldface
Factor
degrees-of-freedom
F-value
p-value
Mean acc. gain ( % )
CI95
(dynam. - const.)
Variant
1
13.72
1.24×10−3
0.31
[0.14,0.48]
Method
2
1.41
0.27
—
—
Version
4
1.1×105
7.76×10−47
—
—
Residuals
24
—
—
—
—
Appendix
Table 6: ANOVA table and effect size estimation for the first ImageNet test (Variant × Method × Version). Statistically significant effects at the 95% confidence level are shown in boldface
Figure 6: Mean accuracy gains of different Method-variant combinations against the SGD baseline, after removing the dataset Version effects. Using SAM-based approaches result in gains over the SGD baseline in all cases. Moreover, dynamic ρ results in higher gains when compared to constant ρ across all three methods tested.
Figure 7: Effect of hyperparameters on top-1 accuracy of CAP-SAM with ResNet-18 on CIFAR-10.
Figure 8: Training loss L(D;wt) of CAP-SAM as a function of the number of epochs, comparing CIFAR-10 and CIFAR-100 across four architectures: (a) ResNet-18,(b)WRN-28-10,(c) VGG-11-BN and (d) PyramidNet-110.
Figure 9: Training loss L(D;wt) as a function of the number of epochs on CIFAR-100, comparing CAP-SAM, SAM, and SGD across four architectures: (a) ResNet-18, (b) WRN-28-10, (c) VGG-11-BN and (d) PyramidNet-110.
Figure 10: Test top-1 accuracy as a function of the number of epochs on CIFAR-100, comparing CAP-SAM, SAM, and SGD across four architectures: (a) ResNet-18, (b) WRN-28-10, (c) VGG-11-BN and (d) PyramidNet-110.
Sharpness-Aware Minimization (SAM) improves generalization by minimizing the worst-case loss within a fixed parameter-space radius neighborhood. SAM and its variants mainly rely on a first-order linearized surrogate, while flat minima are inherently a second-order (curvature) notion.We revisit this mismatch and propose Loss-Equated SAM (LE-SAM), which inverts the traditional SAM mechanism that fixed perturbation radius with a fixed loss-space budget,effectively removing gradient-norm-dominated learning signals and shifting optimization toward curvature-dominated terms. Extensive experiments across diverse benchmarks and tasks demonstrate the strong generalization ability of LESAM that consistently outperforms SAM and even its variants, achieving the state-of-the-art performance.
Jinping Wang, Qinhan Liu, Zhiwu Xie +1
Wenzhou-Kean University · International Frontier Interdisciplinary Research Institute, Wenzhou-Kean University
The sharpness-aware minimization (SAM) algorithm and its variants, including gap guided SAM (GSAM), have been successful at improving the generalization capability of deep neural network models by finding flat local minima of the empirical loss in training. Meanwhile, it has been shown theoretically and practically that increasing the batch size or decaying the learning rate avoids sharp local minima of the empirical loss. In this paper, we consider the GSAM algorithm with increasing batch sizes or decaying learning rates, such as cosine annealing or linear learning rate, and theoretically show its convergence. Moreover, we numerically compare SAM (GSAM) with and without an increasing batch size and conclude that using an increasing batch size { achieves a lower worst-case ℓ∞ adaptive sharpness} than compared with using a constant batch size and learning rate.
Sharpness-Aware Minimization (SAM) improves generalization by seeking parameters whose loss is robust to local adversarial perturbations, but the quantitative mechanism underlying its implicit bias toward flat minima remains unclear. In particular, the perturbation radius ρ is typically treated as an isolated tuning parameter, despite defining the neighborhood in which SAM measures sharpness. We analyze mini-batch SAM near an interpolating minimum through linear stability. Under local linearization and gradient-noise alignment assumptions, we prove that every linearly stable minimum satisfies λmax≤3bΓ/(2ρη2), where λmax is the largest Hessian eigenvalue, b is the batch size, η is the learning rate, and Γ bounds the gradient norm. The bound quantitatively characterizes SAM's implicit flatness bias: holding the other quantities fixed, a smaller batch size, a larger learning rate, or a larger radius restricts linearly stable SAM to flatter minima. It also exposes a necessary trade-off: ρ should be large enough to promote flatness, yet remain local enough to preserve the approximation and stable training. We validate this prediction in a controlled study of 900 models on CIFAR-100 with ResNet-18 and VGG-19, where increasing ρ is consistently associated with a smaller largest Hessian eigenvalue across batch-size and learning-rate settings. Finally, we instantiate the analysis in Taylor-Locality Controlled SAM (TLC-SAM), which adjusts ρ using the observed Taylor-approximation error and further reduces the top Hessian eigenvalue relative to fixed-radius SAM. Our results provide quantitative hyperparameter bounds and a stability--locality perspective for analyzing and designing SAM variants.