WorksComputer Science
One Size Does Not Fit All: Curvature-Aware Adaptive Perturbation for SAM
Abstract
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.
Introduction
Despite the remarkable success of deep neural networks in a wide range of tasks He et al. [12]; Samuel [27]; Krizhevsky et al. [20]; Vaswani et al. [29], their ability to generalise to unseen data remains a persistent challenge in modern deep learning Zhang et al. [33]; Hendrycks et al. [13]. Recent work suggests that the geometry of the loss landscape plays a central role in model generalisation Hochreiter and Schmidhuber [14]; Jiang et al. [16]; Neyshabur et al. [25]. Flat minima have long been associated with better generalisation Dinh et al. [8]; Andriushchenko et al. [1]; Hochreiter and Schmidhuber [15], and it has been observed that sharp minima, regions of high curvature where small perturbations cause large increases in loss, generalise poorly to unseen data Chaudhari et al. [4].
This led to Sharpness-Aware Minimization (SAM) Foret et al. [10] which minimises the maximum loss within a neighbourhood of the current parameters, enabling it to identify flat minima associated with improved generalisation performance. When the model reaches a sharp region, the perturbation step helps it escape the sharp minimum and move toward flatter areas of the loss landscape Keskar et al. [17].
The perturbation radius is among SAM’s most critical hyperparameters: its value strongly affects the solution quality, and it must be carefully tuned for each dataset and architecture. A key limitation of current formulations is that is fixed throughout training, so a single value must serve regions of different curvature. It may be insufficient to escape very sharp regions, leaving the optimizer trapped in poor minima, or perturb too aggressively in flat regions, pushing the optimizer away from a good solution. This motivates a new treatment of ; rather than a static hyperparameter, we approach it as a dynamic quantity that should adapt to the local geometry of the loss landscape.
The contributions of this paper can be summarized as follows:
We provide a new interpretation of the perturbation radius in SAM, revealing its limitations, and proposing CAP-SAM, which adapts its radius to local sharpness.
We prove that CAP-SAM converges at the same rate as SAM, i.e., . We further show that SAM’s perturbation becomes geometry-blind near stationary points and that our approach mitigates this.
We validate CAP-SAM on several baselines and datasets (CIFAR-10/100 and ImageNet), demonstrating improvements in accuracy and generalisation over SAM and its variants.
Methodology
We introduce a dynamically adaptive perturbation radius that addresses the fundamental limitations of the standard SAM formulation, based on a novel reinterpretation of the perturbation radius as the magnitude of the perturbation signal applied to the parameter vector. Vanilla SAM Foret et al. [10] employs a fixed perturbation which remains constant throughout the optimization procedure. In contrast, our formulation modulates this intensity at each step in response to the local sharpness changes observed during training. The method is seamlessly incorporated into any SAM variant, augmenting its capabilities at negligible additional computational cost.
Sharpness-Aware Minimization
SAM is an optimization approach focusing on robust learning to enhance the generalisation ability of deep neural networks by solving the min-max problem
where denotes the perturbation applied to the weights , is the fixed perturbation radius that controls the size of the adversarial neighborhood.
The perturbation at iteration is computed as
SAM minimises the local worst-case loss by perturbing the parameter space, encouraging convergence to flat minima.
Interpretation of SAM. Notice that SAM formulates the perturbation as Foret et al. [10] where denotes the radius of the perturbation neighborhood and is the direction of steepest ascent. However, we observe that can equivalently be interpreted as a multiplicative scalar controlling the magnitude of the ascent step, i.e., how far the parameters are displaced along the steepest ascent direction. This perspective exposes a formal limitation of using a fixed radius, which constrains the perturbation to a fixed magnitude regardless of the local sharpness of the loss landscape. In very sharp regions, a fixed may be insufficient to escape the basin, while in flat regions the same may applies an unnecessary perturbation.
Dynamic Radius Formulation
The proposed method modifies the ascent step of SAM by introducing a dynamically adaptive perturbation radius , adjusted at each optimization step based on local sharpness changes observed during training. The core of our strategy is centred around the sharpness ratio, defined as
capturing the relative change in local sharpness between consecutive optimization steps (Appendix § 9.§ 1 for a theoretical explanation). The perturbation radius is then updated according to
When the optimization has moved into a sharper region of the loss surface and grows geometrically by a factor of , until it is large enough to expose the optimizer to flatter regions. On the other hand, when the optimizer has entered a flatter region and contracts by the same factor, preserving the quality of the minimum found and preventing over perturbation. The bounds and constrains the range of to .
Figure 1 depicts the resulting radius dynamics across different regions of the loss surface. Our method treats as a quantity that stretches and shrinks in response to the local geometry of the loss landscape.
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 evolves: when in a sharp region, expands by a factor of to look further ahead and escape the sharp basin; when in a flat region, contracts by the same factor, so the optimizer stops perturbing aggressively and settles into the local minimum.
Theoretical Analysis
Convergence analysis
In this section, we analyze the convergence properties of CAP-SAM in nonconvex settings. Based on standard assumptions in nonconvex stochastic optimization (stated formally in Appendix § 9.§ 2), we can now define Theorem 1.
Theorem 1 Suppose that Assumptions 1, 2, and 3 hold, and that the perturbation radius satisfies the D.2, e.g., (Appendix § 9.§ 2). Let . For and , we have:
where , .
For non-convex stochastic optimization, Theorem 1 implies that the dynamic radius formulation has the same convergence rate as SAM, i.e., . Detailed proofs are in Appendix § 9.§ 3.
CAP-SAM reduces noise impact around the optimum
Given the stochastic gradient decomposition , in the near-optimal regime where , the gradient becomes dominated by noise, i.e., . The SAM perturbation thus collapses to: . For Gaussian noise, is uniformly distributed on the sphere , no longer reflecting directions of high curvature or sharpness, affecting the ability of SAM to accurately estimate local flatness. The dynamic mitigates the effect of directional misalignment. By construction, tends to increase in sharp regions where is large, and reduce in flat regions where , naturally scaling the magnitude of the perturbation to the local geometry, limiting the influence of non-informative, noise-driven perturbations, as illustrated in Figure 2. A formal geometric analysis of the gradient misalignment and its implications are provided in Appendix § 7.

Figure 2. Illustration of SAM perturbation directions in flat and sharp regions of the loss landscape.
Experimental Results
We evaluate the proposed CAP-SAM through extensive experiments on standard benchmark datasets across diverse model architectures. We compare each method in two configurations: using a fixed perturbation radius and using our proposed dynamic .
Experimental Settings. We adopt CIFAR-10 Krizhevsky et al. [20], CIFAR-100 Krizhevsky et al. [20] and ImageNet-1K Deng et al. [6] as benchmark datasets to evaluate the proposed method. For CIFAR-10 and CIFAR-100, we compare against SAM and three of its variants: ASAM Kwon et al. [21], Fisher SAM Kim et al. [19], and VASSO Li and Giannakis [22], across four neural network architectures: VGG-11 Simonyan and Zisserman [28], ResNet-18 He et al. [12], WRN-28-10 Zagoruyko and Komodakis [32] and PyramidNet-110 Han et al. [11]. For ImageNet-1K Deng et al. [6], we train ResNet-50 from scratch and evaluate on the ImageNet validation set as well as four additional out-of-distribution test sets: ImageNet-Real/V2/R/Sketch Beyer et al. [2]; Recht et al. [26]; Hendrycks et al. [13]; Wang et al. [30]. We evaluate the proposed dynamic formulation applied to SAM, ASAM Kwon et al. [21], and GSAM Zhuang et al. [35]. A comprehensive description of the experimental setup, including hyperparameters and a detailed description of the statistical tests, is provided in the Appendix E.
Results. Table 1 and Table 2 report the results of our method across CIFAR-10 and CIFAR-100, respectively. For CIFAR-10 our approach improves over the fixed radius baselines in 15 of 16 combinations. Gains are consistently more prominent for CIFAR-100 (Table 2), where even for VASSO, the strongest fixed-radius baseline on PyramidNet-110, we outperform the baselines. The mean gains observed for the dynamic over the constant radius are statistically significant at the 95% level (CIFAR10: , ; CIFAR100: , ).
| Model | SAM | ASAM | Fisher SAM | VaSSO | ||||
| Const. | Dynam. | Const. | Dynam. | Const. | Dynam. | Const. | Dynam. | |
| VGG-11-BN | ||||||||
| ResNet-18 | ||||||||
| WRN-28-10 | ||||||||
| PyramidNet-110 |
Table 1. Top-1 test accuracy (%) on CIFAR-10 with Cutout augmentation.
| Model | SAM Const. | SAM Dynam. | ASAM Const. | ASAM Dynam. | Fisher SAM Const. | Fisher SAM Dynam. | VaSSO Const. | VaSSO Dynam. |
| VGG-11-BN | ||||||||
| ResNet-18 | ||||||||
| WRN-28-10 | ||||||||
| PyramidNet-110 |
Table 2. Top-1 test accuracy (%) on CIFAR-100 with Cutout augmentation.
Table 3 reports results on ImageNet-1K and four out-of-distribution test sets. On ImageNet we significantly outperform the fixed-radius baselines (, ), with positive gains observed in 14 of 15 combinations, the sole exception being SAM on ImageNet-Sketch. All configurations surpass the vanilla SGD baseline (MHT-corrected in all cases), confirming that curvature-aware adaptation is additive to the general benefit of sharpness-aware training rather than a substitute for it.
| Method | IMAGENET-1K | Real | V2 | R | Sketch | |
| SGD | — | |||||
| SAM | Const. | |||||
| Dynam. | ||||||
| GSAM | Const. | |||||
| Dynam. | ||||||
| ASAM | Const. | |||||
| Dynam. |
Table 3. Top-1 accuracy (%) on ImageNet and robustness datasets for ResNet-50.
Generalisation Effect. Figure 3 shows that CAP-SAM achieves a lower training loss than SAM while reaching better test accuracy than both baselines. SGD prioritises data fitting at the cost of overfitting, SAM prioritises robustness but may under-fit, and CAP-SAM balances the two, fitting the data effectively without sacrificing generalisation, converging to flatter minima with stronger generalisation properties, a pattern consistent with Keskar et al. [17]; Neyshabur et al. [25].

Figure 3. PyramidNet-110 on CIFAR-100. (a) Training loss and (b) test accuracy (top-1) for CAP-SAM, SAM, and SGD.
Keskar et al. [17]; Neyshabur et al. [25]. CAP-SAM also exhibits faster convergence than SAM and SGD (Figure 3 (b)), suggesting a more efficient progress along the optimization trajectory.
Hyperparameter sensitivity. We analyze the impact of the hyperparameters of CAP-SAM.
As shown in Figure 4, the parameters that meaningfully influence performance are the initial radius and the growth factor , which benefit from light tuning, consistent with standard practice for SAM and its variants. The lower and upper bounds, and , have negligible impact on performance (Figure 7 (c) and (Figure 7d) in Appendix § 11), as they serve primarily to clip the updated radius within a safe interval.

Figure 4. Effect of hyperparameters with ResNet-18 on CIFAR-10.

Figure 7. Effect of hyperparameters on top-1 accuracy of CAP-SAM with ResNet-18 on CIFAR-10.
Conclusion
In this paper, we investigated SAM and provided a new interpretation of the perturbation radius as a signal of the perturbation magnitude. Based on this finding, we proposed CAP-SAM, which modifies the ascent step of SAM by adjusting the perturbation radius based on local sharpness estimates across steps. We theoretically investigated the impact of stochastic gradient noise on SAM’s perturbation direction, showing that it becomes increasingly uninformative about local curvature near convergence, and demonstrated that CAP-SAM mitigates this undesirable effect. We validated CAP-SAM across several baselines as a plug-in for SAM and its variants, achieving consistent improvements in accuracy.
Related Works
Several works have investigated the correlation between the generalization ability of a model and the sharpness of the minimum it converges to Dinh et al. [8]; Keskar et al. [17]; Wang et al. [31].
Following this line of work, subsequent studies have examined the connection between batch size and generalization, showing that the choice of batch size influences the tendency of a model to converge to a sharp or flat minimum Keskar et al. [17]. Different measures have also been proposed to evaluate the geometric characteristics of the loss landscape and their connection to sharpness Jiang et al. [16]; Kim et al. [18]; Zhuang et al. [35]. These works justify the goal of seeking flatter valleys in the loss landscape to enhance generalization. Inspired by this, Sharpness-Aware Minimization (SAM) Foret et al. [10] was proposed as a strategy that targets flatter minima by minimizing the worst-case loss within a local neighborhood. SAM has been shown to achieve generalization improvements across a variety of tasks and benchmarks Caldarola et al. [3]; Kwon et al. [21]; Zheng et al. [34].
A series of SAM variants have since been proposed, addressing SAM’s limitations from different perspectives. From the perspective of the neighborhood’s geometric measure, ASAM Kwon et al. [21] introduce scale invariance to address SAM’s sensitivity to weight re-scaling, while Fisher SAM Kim et al. [19] replace SAM’s Euclidean balls with ellipsoids induced by the Fisher information metric. From the perspective of the optimization stability, GSAM Zhuang et al. [35] jointly minimizes the perturbed loss and a surrogate gap, while the friendly-adversary approach of VaSSO Li and Giannakis [22] stabilizes the adversarial perturbation through variance suppression. To reduce computational cost, a further line of work seeks to alleviate SAM’s characteristic doubling of forward–backward passes. For instance, ESAM Du et al. [9] reduces this overhead through stochastic weight perturbation and sharpness-sensitive data selection, and Sparse SAM Mi et al. [24] perturbs only a sparse subset of parameters via a learned binary mask.
Despite their improvements over the vanilla formulation, these variants all operate within the original min-max framework, refining either the perturbation direction or the regularization term while treating the radius as a fixed hyperparameter shared across all iterations and regions of the landscape. The strategy proposed in this work, CAP-SAM, instead adapts the size of the perturbation radius itself based on local sharpness estimates, bridging the geometric and stability perspectives in a direction largely unexplored by existing SAM variants.
Gradient misalignment
We analyze the behavior of the SAM perturbation near convergence by decomposing the stochastic gradient on a mini-batch as:
where is a zero-mean Gaussian random variable representing the batch-specific noise. Assuming is an unbiased estimator of the full gradient, we have . Moreover, as is deterministic with respect to batch sampling,
Consequently, the stochastic noise has zero mean and zero expected projection onto the true gradient: on average it carries no systematic descent or curvature information. Figure 5(a) illustrates this expected decomposition, where the stochastic gradient is expressed as the sum of the deterministic gradient and a zero-mean noise component.
Figure 5. Investigation of the SAM perturbation direction near convergence. (a) Away from convergence, dominates and the perturbation remains reasonably aligned with the true gradient direction. (b) Near a stationary point, and , the perturbation direction becomes increasingly dominated by stochastic gradient noise making the perturbation uninformative about the local loss curvature [23].
The SAM perturbation at step is
As optimization approaches minimum, where , the deterministic gradient is dominated by the noise and the perturbation collapses to
The perturbation direction becomes increasingly governed by stochastic gradient noise rather than by the deterministic descent direction, making the perturbation uninformative about the loss curvature .
Geometric characterization of the misalignment
To quantify this behavior, we measure the alignment between and the noise direction . The alignment angle is given as the inverse cosine of
where indicates , i.e., perfect alignment. Near a minimum, , so the gradient component vanishes and the expression simplifies to
Therefore, the stochastic gradient becomes increasingly aligned with the noise component, causing the SAM perturbation to converge to the normalized noise direction. Consequently, the ascent step is driven primarily by stochastic fluctuations rather than by the underlying loss geometry, reducing its effectiveness as an estimator of local sharpness, as illustrated in Figure 5 (b).
Algorithm
Algorithm 1 CAP-SAM
Input: Training set , loss , learning rate , growth factor , bounds , initial radius .
Initialise weights
Initialise perturbation radius
while not converged do
Sample a mini-batch data form
Compute stochastic gradient
Compute
Compute
Compute
Update weights
end while
Return ,
Theoretical Analysis
as a measure of local sharpness
We provide a formal justification for as a principled measure of how local sharpness evolves along the optimization trajectory. Following Zhuang et al. [35], we define the surrogate gap at a point as:
The surrogate gap measures the difference between the maximum loss within the neighborhood and the loss at the center point.
Theorem 2. Let be a local minimum of , and let denote the dominant eigenvalue of the Hessian as a measure of sharpness. Assuming the iterates and lie near , the ratio defined in Eq. (3) approximates the change in sharpness between consecutive steps: where is the ratio of perturbation radii between iterations.
Proof. We follow the argument of Zhuang et al. [35], adapting it to the ratio of surrogate gaps at consecutive iterates. Since is small, consider the second-order Taylor expansion of around :
where is the Hessian at , assumed to be positive semidefinite near local minima. Since lies near the local minimum, the gradient can be assumed to be negligible, , so the first-order term vanishes. Normalizing such that , we obtain
where is the largest eigenvalue of the Hessian . Applying the same expansion at step and substituting into :
Defining and rearranging gives .
Remark 3 (First-order interpretation and computational cost) The Theorem above establishes as a sharpness measure via a second-order argument. Under the adaptive update rule, however, also admits a simpler interpretation that makes it cheap to compute in practice. Using a first-order Taylor expansion
where and the SAM perturbation is . Therefore:
Since the adaptive update rule adjusts by a factor of , consecutive radii satisfy , and thus:
Hence is well approximated by the ratio of consecutive gradient norms Zou et al. [36], a quantity already available during training at no additional computational cost.
Assumptions
Our analysis relies on the following assumptions, which are standard in nonconvex stochastic optimization.
Assumption 1 (Bounded Gradient) such that .
Assumption 2 (Bounded Variance) such that .
Assumption 3 (L-smoothness) such that , .
Decaying-radius assumption. Following existing convergence analyses of SAM and its variants Zhuang et al. [35]; Mi et al. [24], we assume that the perturbation radius vanishes asymptotically, i.e., . As in prior work, the assumption is made for analytical tractability and does not reflect how the method is used in practice. In our experiments (§ 4), follows Eq. (3) within the fixed interval and is not forced to decay.
Proof of Theorem 1
We adapt the standard SAM convergence proof Foret et al. [10] to the CAP-SAM formulation. We can write the algorithm 1:
where for SAM and for CAP-SAM with as defined in Eq. (3).
We first present useful lemmas that will be used to support the proof of the main result.
Lemma 4 For any , , and differentiable function , we have:
Proof. Adding and subtracting inside the inner product and factoring out :
Applying the bounded gradient Assumption 1
Lemma 5. For , , the iteration 4 satisfies the following inequality:
Proof. We denote the deterministic value of as defined in 4. Adding and subtracting decomposes the inner product into two terms:
Bounding Term I from below by applying Young’s inequality, followed by -smoothness:
For the second term applying Lemma 4 directly, we have
Combining the two terms:
Lemma 6. For , the iteration satisfies for all :
Proof. By the -smoothness of and the update rule :
Substituting the identity into 8 and rearranging:
Taking expectation and applying Lemma 5:
Collecting terms in and yields:
which completes the proof.
Proposition 7. Let and perturbation amplitude decay with the square root of , e.g., . For and , we have:
where
Proof. Under the decaying-radius assumption D.2, . Since all three lemmas hold for any , they apply with replaced by at each step. As for all , we set , corresponding to the worst case in which always attains its upper bound. Replacing and into Lemma 6:
Summing the per-step inequality from to and rearranging, the left-hand side telescopes to :
Drop the last term using
With
where replacing yields:
Finally, we archive the result:
This shows that, under the decaying-radius assumption standard in SAM analyses, CAP-SAM converges at the rate of .
Experimental setup
We report the averaged results and standard deviation results over 3 independent runs.
CIFAR
For CIFAR-10 and CIFAR-100 Krizhevsky et al. [20], we compare test accuracy against SAM and three variants ASAM Kwon et al. [21], Fisher SAM Kim et al. [19], and VASSO Li and Giannakis [22] across four neural network architectures VGG-11 Simonyan and Zisserman [28], ResNet-18 He et al. [12], WRN-28-10 Zagoruyko and Komodakis [32] and PyramidNet-110 Han et al. [11]. Standard data augmentation is applied, including random crop, random horizontal flip, normalization, and Cutout Devries and Taylor [7]. The first three models are trained for 200 epochs with a batchsize of 128, and PyramidNet-110 is trained for 300 epochs. A cosine learning rate schedule is used across all settings, with an initial learning rate of 0.05 and weight decay of 0.001. For CIFAR-10, we set for SAM, Fisher SAM, and VASSO, and for ASAM, following the original papers. For our adaptive formulation, we use a initial radius across all architectures, with the exception of ResNet-18 where , and growth factor . For CIFAR-100,we set for SAM, Fisher SAM, and VASSO, and for ASAM. For our adaptive formulation, we use a initial radius across all architectures, and growth factor .
ImageNet
For ImageNet-1K, we train ResNet-50 from scratch and evaluate on the ImageNet validation set as well as four additional out-of-distribution test sets: ImageNet-Real Beyer et al. [2], ImageNet-V2 Recht et al. [26], ImageNet-R Hendrycks et al. [13], and ImageNet-Sketch Wang et al. [30]. Following the setup of GSAM Zhuang et al. [35] and Chen et al. [5], without strong data augmentation. Models are trained with a global batch size of 4096, a perturbation batch size of . A linear learning rate schedule with warmup is used, with an initial learning rate of 0.016 and weight decay of 0.001. We evaluate the proposed CAP-SAM formulation applied to SAM, ASAM Kwon et al. [21], and GSAM Zhuang et al. [35]. Following hyperparameter tuning, we set for SAM, for GSAM and for ASAM. The same values are used as the initial radius for the corresponding adaptive formulations, with growth factor .
Statistical analysis
Statistical analysis for each test case (CIFAR-10, CIFAR-100 and ImageNet) was performed using an analysis of variance (ANOVA) model, with the perturbation type (constant , dynamic ) as the experimental factor of interest. In the case of CIFAR-10 and CIFAR-100, the Method (SAM, ASAM, FSAM, VASSO) and the Model (VGG-11-BN, ResNet-18, WRN-28-10, PyramidNet-110) were used as blocking variables, so that the marginal effects on the accuracy are accounted for when estimating the effect of deploying the dynamic perturbation. For ImageNet, two comparisons were performed: the first used the Method (SAM, GSAM and ASAM) and the ImageNet Version (1K, Real, V2, R, Sketch) as blocking variables, to directly estimate the effects of the dynamic . The second compared all combinations of method + perturbation strategy directly against the SGD baseline, with Version as a blocking variable.
All statistical analyses were performed in R version 4.6.0. The p-values for the comparisons between constant and dynamic were estimated using function aov. Post-ANOVA tests used Tukey contrasts as implemented in function glht from package multcomp. Effect size and confidence interval estimation were obtained applying function confint to the Tukey comparison models. The ANOVA tables for the three comparisons are presented below.
| Factor | degrees-of-freedom | F-value | p-value | Mean acc. gain (%) (dynam. - const.) | |
| Variant | 1 | 19.51 | 1.83 × | 0.23 | [0.12, 0.33] |
| Method | 3 | 0.451 | 0.72 | — | — |
| Model | 3 | 1107.6 | 7.42 × | — | — |
| Residuals | 24 | — | — | — | — |
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 (%) (dynam. - const.) | |
| Variant | 1 | 13.32 | 1.27 × | 1.14 | [0.50, 1.78] |
| Method | 3 | 4.38 | 0.013 | — | — |
| Model | 3 | 335.3 | 1.02 × | — | — |
| Residuals | 24 | — | — | — | — |
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 (%) (dynam. - const.) | |
| Variant | 1 | 13.72 | 1.24 × | 0.31 | [0.14, 0.48] |
| Method | 2 | 1.41 | 0.27 | — | — |
| Version | 4 | 1.1 × | 7.76 × | — | — |
| Residuals | 24 | — | — | — | — |
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.
Ablation Study
Figure 7 reports the sensitivity/top-1 accuracy of CAP-SAM to its four hyperparameters, varying one at a time while holding the remaining three at their default values. Panels (a) and (b) report the initial radius and the growth factor ; panels (c) and (d) report the bounds and .
CAP-SAM is therefore robust to and , which serve only to clip the updated radius within a safe interval and have no effect unless the clip becomes active. In contrast, and meaningfully influence performance and benefit from light tuning, as they act throughout training and shape how the radius changes.
Additional Convergence Results
Figure 8 shows convergence of CAP-SAM training loss on the CIFAR-10 and CIFAR-100 datasets. Figure 9 and 10 shows the training loss and Test top-1 accuracy as a function of the number of epochs for CAP-SAM, SAM, and SGD on CIFAR-100 across all network architectures. CAP-SAM consistently converges faster than both SAM and SGD.

Figure 8. Training loss 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 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.
CAP-SAM attains a consistently lower training loss than SAM while remaining above SGD, and reaches higher test accuracy than both baselines throughout training. This phenomenon clearly shows how SGD descends fastest on the training objective but generalises worst, SAM sacrifices training progress for robustness, and CAP-SAM, by perturbing only as much as the local curvature requires, is able to fit the data quickly while exceeding SAM’s generalisation ability.

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.
References
- [1]Maksym Andriushchenko, Francesco Croce, Maximilian Müller, Matthias Hein, and Nicolas Flammarion. A modern look at the relationship between sharpness and generalization. arXiv preprint arXiv:2302.07011, 2023.arxiv.org/abs/2302.07011
- [2]Lucas Beyer, Olivier J Hénaff, Alexander Kolesnikov, Xiaohua Zhai, and Aäron van den Oord. Are we done with imagenet? arXiv preprint arXiv:2006.07159, 2020.arxiv.org/abs/2006.07159
- [3]Debora Caldarola, Pietro Cagnasso, Barbara Caputo, and Marco Ciccone. Beyond local sharpness: Communication-efficient global sharpness-aware minimization for federated learning. In CVPR, 2025.arxiv.org/abs/2412.03752
- [4]Pratik Chaudhari, Anna Choromanska, Stefano Soatto, Yann LeCun, Carlo Baldassi, Christian Borgs, Jennifer Chayes, Levent Sagun, and Riccardo Zecchina. Entropy-SGD: Biasing Gradient Descent Into Wide Valleys, April 2017. URL http://arxiv.org/abs/1611.01838. arXiv:1611.01838 [cs.LG].
- [5]Xiangning Chen, Cho-Jui Hsieh, and Boqing Gong. When vision transformers outperform resnets without pre-training or strong data augmentations. arXiv preprint arXiv:2106.01548, 2021.arxiv.org/abs/2106.01548
- [6]Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In CVPR, pages 248–255, 2009.
- [7]Terrance Devries and Graham W. Taylor. Improved regularization of convolutional neural networks with cutout. CoRR, abs/1708.04552, 2017. URL http://arxiv.org/abs/1708.04552.
- [8]Laurent Dinh, Razvan Pascanu, Samy Bengio, and Yoshua Bengio. Sharp minima can generalize for deep nets. CoRR, abs/1703.04933, 2017. URL http://arxiv.org/abs/1703.04933.
- [9]Jiawei Du, Hanshu Yan, Jiashi Feng, Joey Tianyi Zhou, Liangli Zhen, Rick Siow Mong Goh, and Vincent Y. F. Tan. Efficient sharpness-aware minimization for improved training of neural networks. CoRR, abs/2110.03141, 2021. URL https://arxiv.org/abs/2110.03141.
- [10]Pierre Foret, Ariel Kleiner, Hossein Mobahi, and Behnam Neyshabur. Sharpness-aware minimization for efficiently improving generalization. CoRR, abs/2010.01412, 2020. URL https://arxiv.org/abs/2010.01412.
- [11]Dongyoon Han, Jiwhan Kim, and Junmo Kim. Deep pyramidal residual networks. CoRR, abs/1610.02915, 2016. URL http://arxiv.org/abs/1610.02915.
- [12]Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770–778, 2016.arxiv.org/abs/1512.03385
- [13]Dan Hendrycks, Steven Basart, Norman Mu, Saurav Kadavath, Frank Wang, Evan Dorundo, Rahul Desai, Tyler Zhu, Samyak Parajuli, Mike Guo, et al. The many faces of robustness: A critical analysis of out-of-distribution generalization. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 8340–8349, 2021.
- [14]Sepp Hochreiter and Jürgen Schmidhuber. Simplifying neural nets by discovering flat minima. In Proceedings of the 8th International Conference on Neural Information Processing Systems, NIPS’94, page 529–536, Cambridge, MA, USA, 1994. MIT Press.
- [15]Sepp Hochreiter and Jürgen Schmidhuber. Flat minima. Neural Computation, 9(1):1–42, 1997. doi: 10.1162/neco.1997.9.1.1.DOI
- [16]Yiding Jiang, Behnam Neyshabur, Hossein Mobahi, Dilip Krishnan, and Samy Bengio. Fantastic generalization measures and where to find them. arXiv preprint, 12 2019. doi: 10.48550/arXiv.1912.02178.DOI
- [17]Nitish Shirish Keskar, Dheevatsa Mudigere, Jorge Nocedal, Mikhail Smelyanskiy, and Ping Tak Peter Tang. On large-batch training for deep learning: Generalization gap and sharp minima. CoRR, abs/1609.04836, 2016. URL http://arxiv.org/abs/1609.04836.
- [18]Hoki Kim, Jinseong Park, Yujin Choi, and Jaewook Lee. Fantastic robustness measures: The secrets of robust generalization. In Thirty-seventh Conference on Neural Information Processing Systems, 2023.DOI
- [19]Minyoung Kim, Da Li, Shell Xu Hu, and Timothy M. Hospedales. Fisher SAM: Information geometry and sharpness aware minimisation. In International Conference on Machine Learning, pages 11145–11161, 2022.arxiv.org/abs/2206.04920
- [20]Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. Technical report, 2009.
- [21]Jungmin Kwon, Jeongseop Kim, Hyunseo Park, and In Kwon Choi. Asam: Adaptive sharpness-aware minimization for scale-invariant learning of deep neural networks. In International Conference on Machine Learning, pages 5905–5914. PMLR, 2021.arxiv.org/abs/2102.11600
- [22]Bingcong Li and Georgios B Giannakis. Enhancing sharpness-aware optimization through variance suppression. In Proc. of Neural Information Processing Systems, 2023.arxiv.org/abs/2309.15639
- [23]Tao Li, Pan Zhou, Zhengbao He, Xinwen Cheng, and Xiaolin Huang. Friendly sharpness-aware minimization, 2024. URL https://arxiv.org/abs/2403.12350.
- [24]Peng Mi, Li Shen, Tianhe Ren, Yiyi Zhou, Xiaoshuai Sun, Rongrong Ji, and Dacheng Tao. Make sharpness-aware minimization stronger: A sparsified perturbation approach, 2022. URL https://arxiv.org/abs/2210.05177.
- [25]Behnam Neyshabur, Srinadh Bhojanapalli, David McAllester, and Nathan Srebro. Exploring generalization in deep learning. CoRR, abs/1706.08947, 2017. URL http://arxiv.org/abs/1706.08947.
- [26]Benjamin Recht, Rebecca Roelofs, Ludwig Schmidt, and Vaishaal Shankar. Do imagenet classifiers generalize to imagenet? In International conference on machine learning, pages 5389–5400. PMLR, 2019.arxiv.org/abs/1902.10811
- [27]A. L. Samuel. Some studies in machine learning using the game of checkers. IBM Journal of Research and Development, 3(3):211–229, 1959.
- [28]Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In Yoshua Bengio and Yann LeCun, editors, ICLR, 2015. URL http://arxiv.org/abs/1409.1556.
- [29]Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. Advances in neural information processing systems, 30, 2017.arxiv.org/abs/1706.03762
- [30]Haohan Wang, Songwei Ge, Zachary Lipton, and Eric P. Xing. Learning robust global representations by penalizing local predictive power. In Advances in Neural Information Processing Systems, pages 10506–10518, 2019.
- [31]Pengfei Wang, Zhaoxiang Zhang, Zhen Lei, and Lei Zhang. Sharpness-aware gradient matching for domain generalization, 2023. URL https://arxiv.org/abs/2303.10353.
- [32]Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. CoRR, abs/1605.07146, 2016. URL http://arxiv.org/abs/1605.07146.
- [33]Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. CoRR, abs/1611.03530, 2016. URL http://arxiv.org/abs/1611.03530.
- [34]Yaowei Zheng, Richong Zhang, and Yongyi Mao. Regularizing neural networks via adversarial model perturbation. CoRR, abs/2010.04925, 2020. URL https://arxiv.org/abs/2010.04925.
- [35]Juntang Zhuang, Boqing Gong, Liangzhe Yuan, Yin Cui, Hartwig Adam, Nicha Dvornek, Sekhar Tatikonda, James Duncan, and Ting Liu. Surrogate gap minimization improves sharpness-aware training. arXiv preprint arXiv:2203.08065, 2022.arxiv.org/abs/2203.08065
- [36]Jinping Zou, Xiaoge Deng, and Tao Sun. Sharpness-aware minimization with adaptive regularization for training deep neural networks, 2024. URL https://arxiv.org/abs/2412.16854.



