Sharpness-Aware Minimization (SAM) trains a network to sit in wide, flat valleys of the loss rather than narrow ravines. At each step it first nudges the weights in the direction that most increases the loss, then updates using the gradient taken at that nudged point. The method generalizes better, but it needs two full forward-backward passes per update and so roughly doubles training cost. Most cheaper variants drop part of the perturbation. Some perturb only a few layers, some perturb a random subset of weights, and some refresh the perturbation only every few steps. Whether dropping part of the perturbation is safe depends on something nobody measures: how strongly perturbing one layer changes the sharpness that other layers, near or far in depth, experience.
Statistical physics has a precise version of this question. In spin models whose couplings decay as a power of distance, the decay exponent decides whether the system behaves locally or globally. Truncating the slowly decaying tail with a cutoff does not just add a small error. It silently moves the system into the wrong behavioral class. We propose to treat a network's layers as a one-dimensional chain and measure how cross-layer curvature coupling decays with depth separation. We then test a single claim. The fitted decay exponent predicts, before any expensive run, whether layer-truncated SAM will match full SAM. It also predicts how wide a window of layers must be perturbed exactly, and when the remaining layers can safely receive a cheap, stale perturbation.
Core Claim
Write $\epsilon_j$ for the SAM perturbation restricted to layer $j$, and $L$ for the minibatch loss. We define the depth coupling between layers $i$ and $j$ as the part of the loss increase that only appears when both layers are perturbed together:
$$C(i,j) = \left| L(w+\epsilon_i+\epsilon_j) - L(w+\epsilon_i) - L(w+\epsilon_j) + L(w) \right|.$$
To second order, this equals the cross-layer Hessian term $|\epsilon_i^\top H_{ij}\,\epsilon_j|$. We then fit an average decay law $\bar C(r) \propto r^{-(1+\sigma)}$, where $r=|i-j|$ is the depth separation and $\sigma$ is an effective range exponent. The power-law form is a hypothesis to be tested against exponential and two-regime fits, not an assumption.
The claim has two parts. First, when $\sigma$ is large (short-range coupling), perturbing a contiguous window of layers exactly and leaving the rest alone recovers full-SAM test accuracy at a fraction of the ascent cost. Second, when $\sigma$ is small, the same truncation loses most of SAM's benefit, much as a cutoff distorts the long-range Ising model. In that regime, a stale far-field perturbation restores the benefit cheaply. Existing efficient-SAM methods choose layers by each layer's own sharpness, or by random sampling, or by a fixed period. None of them measures the off-diagonal coupling, so none can say when truncation is safe.
Where This Sits
The physics supplies the analogy, the warning, and the computational pattern.
Phase ordering kinetics of the long-range Ising model shows that the decay exponent sets the dynamics. Domain growth follows $t^{1/(1+\sigma)}$ for $\sigma<1$, has logarithmic corrections at $\sigma=1$, and reverts to nearest-neighbor behavior for $\sigma>1$. That crossover is the shape we look for in networks. The same work stores a cached "effective field" for each spin and refreshes it only when something changes. Our stale far-field perturbation reuses this pattern. The near-field/far-field splitting described in Near-Field and Far-Field Decomposition for Long-Range Interactions supplies the decomposition: compute local interactions exactly and approximate the smooth remote part cheaply.
Coarsening in the long-range Ising model: Metropolis versus Glauber criterion plays a constraining role. Truncating the tail produces spurious short-range behavior. We take this as the hypothesis that layer truncation is not a neutral approximation.
Two further papers suggest that the range matters for global behavior in one dimension, though the analogy is heuristic. Synchronization of oscillators with long-range power law interactions finds a sharp threshold for global synchronization in one dimension, at $\alpha<1.5$. Analysis of evolutionary algorithms on the one-dimensional spin glass with power-law interactions finds that optimizers which exploit locality only succeed when interactions are short-range.
On the optimization side, three methods motivate the gap, and each is a truncation of a different kind:
- SAFER applies SAM only to the roughly 5% of vision-transformer layers with the highest individual sharpness, which is a selection on the diagonal.
- ESAM perturbs a random subset of weights.
- LookSAM recomputes the ascent every $k$ steps, because the flatness-seeking component of the gradient changes slowly.
Our proposal differs from all three in two ways: it measures cross-layer coupling, and it makes reuse layer-dependent rather than uniform. Sharpness-Aware Training for Free avoids the ascent pass entirely and is a competitor rather than a component.
Towards Understanding Sharpness-Aware Minimization constrains us in a different way. Full-batch SAM reaches very flat minima that do not generalize, so we judge every variant by test accuracy and never by flatness alone. Exploring Loss Landscapes through the Lens of Spin Glass Theory is the closest bridge between the two fields. It analyzes the minima of one-hidden-layer networks with spin-glass tools, but it defines no interaction range and studies no optimizer cost.
Research Program
Measurement. We estimate $C(i,j)$ at checkpoints throughout training using Hessian-vector products along the actual SAM direction, averaged over minibatches. We do this for three model families: ResNet-34 and PyramidNet on CIFAR-100, ResNet-50 on ImageNet, and ViT-B/16 on ImageNet. We fit $\sigma$ per model and per training phase. We also check whether a single exponent describes the data at all, since attention layers may couple globally while convolutional stages couple locally. The measurement costs a few extra passes per checkpoint and is reported separately from training cost.
Method. The method, which we call windowed SAM, has two parts.
- Near field. At each step a contiguous window of $W$ layers, chosen to contain a fixed fraction of the measured coupling mass, receives a freshly computed perturbation. The window cycles through depth.
- Far field. All other layers receive their cached perturbation from the last time they were inside the window, rescaled to radius $\rho$.
Cost savings come from two places. First, the ascent backward pass stops at the bottom of the window. Second, refreshes are less frequent for layers whose coupling is short-range. Savings therefore depend on where the window sits. Windows near the input save little, so we report measured wall-clock time rather than modeled FLOPs.
Prediction test. The central test asks whether $\sigma$, measured early in training, predicts the accuracy gap between pure truncation and full SAM across models. If it does, the exponent becomes a cheap pre-training diagnostic that decides which efficient-SAM variant to use.
Baselines
Plain SGD. This is the naive reference point, giving the accuracy and throughput floor. On ImageNet ResNet-50, SAF reports 76.0% top-1 for SGD. On CIFAR-100 PyramidNet, ESAM reports 81.89%.
Full SAM. SAM defines the accuracy target. Reported figures are 84.46% on CIFAR-100 PyramidNet and 76.70% on ImageNet ResNet-50, both from ESAM's experiments, at 654 images/sec.
ESAM. This is the strongest perturbation-subsampling method. It reports 77.05% on ResNet-50 at 846 images/sec and 85.56% on CIFAR-100 PyramidNet.
SAF. This is the strongest cost competitor overall, at 77.8% on ResNet-50 while keeping 99.1% of SGD speed.
LookSAM-5. This is the reuse competitor, reaching 79.8% on ViT-B/16.
SAFER-style selection. Here the top layers are chosen by individual sharpness. It is about 3% slower than SGD, but no ImageNet clean-accuracy number for it was found on Lacuna.
Fairness. All methods use identical data, augmentation, epochs and GPU type. Each gets the same hyperparameter search budget: $\rho$ for every method, plus each method's own knobs ($k$, $\beta$, $\gamma$, $W$, layer fraction, EMA decay). Results are averaged over three seeds.
Ablations. Three ablations isolate the key ingredient:
- windowed SAM with the far-field cache removed, which is pure cutoff truncation;
- a window of the same size but placed at random;
- a window chosen by SAFER's diagonal criterion rather than by coupling mass.
What counts as winning. Windowed SAM beats the field if, at matched wall-clock time, it matches full SAM's accuracy within seed noise while running faster than ESAM. It must also do this on the models where measured $\sigma$ is small, which are exactly the models where truncation-based methods should fail. If SAF dominates at equal cost everywhere, the method claim fails, and the diagnostic claim must stand on its own.
Why not just…?
Why not just switch to SAM for the last 10% of training? Towards Understanding SAM shows that late switching recovers much of SAM's gain at about 10% extra cost. This is a real threat to the method claim. The two ideas are complementary, though: the range exponent says which layers to perturb during those final epochs. We will run late-switch SAM both alone and combined with windowing. Windowing is only worth having if it adds to late switching at equal cost.
Why not just use SAF and skip the ascent pass? SAF's ImageNet result is stronger than SAM's at nearly no cost. Its memory-light variant MESA, however, gives back about 15% overhead, and its trajectory penalty says nothing about which layers matter. If SAF wins at every cost level, we will report it as the practical choice. The coupling diagnostic would then remain useful for explaining when perturbation-based shortcuts fail.
Why not just use LookSAM's uniform reuse? LookSAM assumes that every layer's flatness direction drifts equally slowly. Our measurement tests that assumption directly. If refresh rates fitted per layer collapse to a single value, LookSAM is already optimal and our method reduces to it. The ablation that uses uniform reuse with the same window settles this question.
Why not just pick layers by their own sharpness, as SAFER does? SAFER's criterion looks only at each layer by itself. The diagonal-selection ablation tests whether off-diagonal coupling adds predictive power. If it does not, the depth-range idea is unnecessary.
Decisive Checks
The first check is whether cross-layer coupling decays in a way that a single exponent captures, at least within each architecture. If it does not, we report the measured coupling structure and drop the exponent framing.
The second check is whether, across the three model families, the truncation-minus-full-SAM accuracy gap rises as measured $\sigma$ falls. A flat relationship would falsify the core claim.
The third check is whether the far-field cache recovers the gap specifically in the small-$\sigma$ models, at lower wall-clock cost than ESAM and with accuracy statistically indistinguishable from full SAM.
All three checks use CIFAR-100, ImageNet ResNet-50 and ImageNet ViT-B/16 at the baseline settings above. CIFAR-10 with label noise serves as a secondary robustness setting, where SAM's reported reference is 79.9% at 80% noise.
References
- Phase ordering kinetics of the long-range Ising model
- Coarsening in the long-range Ising model: Metropolis versus Glauber criterion
- Synchronization of oscillators with long-range power law interactions
- Analysis of evolutionary algorithms on the one-dimensional spin glass with power-law interactions
- SAFER: Sharpness Aware layer-selective Finetuning for Enhanced Robustness in vision transformers
- Efficient Sharpness-aware Minimization for Improved Training of Neural Networks
- Towards Efficient and Scalable Sharpness-Aware Minimization
- Sharpness-Aware Training for Free
- Towards Understanding Sharpness-Aware Minimization
- Exploring Loss Landscapes through the Lens of Spin Glass Theory
- Sharpness-aware Minimization for Efficiently Improving Generalization