NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Stabilizing Sharpness-aware Minimization Through A Simple Renormalization Strategy

Chengli Tan, Jiangshe Zhang, Junmin Liu, Yicheng Wang, Yunda HaoarXiv 2024 · DOI

Introduction

Sharpness-aware Minimization (SAM) has emerged as a powerful optimizer for deep learning, specifically designed to improve generalization by seeking "flat" minima in the loss landscape. By explicitly minimizing the maximum loss within a neighborhood of the current weights, SAM helps models avoid sharp minima that often lead to poor test performance. However, SAM faces a significant hurdle: training instability. As the perturbation radius ($\rho$) increases, SAM is increasingly prone to becoming trapped in saddle points, often requiring meticulously tuned, conservative learning rates to converge.

The Stable SAM (SSAM) Strategy

To address these stability issues, we introduce Stable SAM (SSAM), a simple modification to the standard SAM algorithm. The core innovation is a renormalization step that matches the gradient norm of the descent step to that of the ascent step.

Standard SAM involves an ascent step to find a perturbed weight $w_t^{asc}$ and a descent step using the gradient at this perturbed point. SSAM rescales the descent gradient so that its norm matches the norm of the gradient at the original weights $w_t$. If the descent gradient is excessively large, SSAM downscales it to prevent divergence. Conversely, if the gradient is small—a common occurrence near saddle points—SSAM upscales it. This provides the necessary "push" for the optimizer to escape saddle points and continue toward a true minimum without adding significant computational overhead or new hyperparameters.

Experimental Evaluation

We evaluated SSAM across various architectures, including ResNet and Vision Transformers, on datasets such as CIFAR-100 and ImageNet-1K.

Training Stability and Saddle Point Escape

A key challenge with vanilla SAM is its sensitivity to the perturbation radius $\rho$. As shown in Figure 1, as $\rho$ increases from 0.02 to 0.08, vanilla SAM and its variants struggle to decrease training loss, often stalling completely. SSAM, however, maintains a steady descent, demonstrating significantly improved optimization stability and more efficient saddle point escape.

Training loss across different perturbation radii ($\rho$). SSAM remains stable as $\rho$ increases, while vanilla SAM and SAM* stall.

Robustness to Learning Rates

SSAM effectively widens the "regime of effectiveness" for learning rates. While SAM's performance is often contingent on a narrow range of learning rates, SSAM exhibits robustness similar to standard SGD. Figure 2 illustrates that SSAM maintains a high percentage of successful runs across a much broader spectrum of learning rates compared to SAM and SAM*.

Percentage of successful runs vs. learning rate. SSAM matches the robustness of SGD, significantly outperforming vanilla SAM and SAM* in stability across learning rate scales.

Generalization Performance

Beyond stability, SSAM consistently finds flatter minima, leading to superior generalization. On ImageNet-1K with ViT-S-16, SSAM achieved a top-1 accuracy of 77.41%, outperforming vanilla SAM (76.88%) and SAM (73.81%). Similar gains were observed on CIFAR-100 with ResNet-56, where SSAM reached 75.11%* accuracy compared to SAM's 75.02%.

Conclusion

Stable SAM (SSAM) provides a simple yet effective renormalization strategy that mitigates the inherent instabilities of sharpness-aware optimization. By ensuring consistent gradient magnitudes, SSAM facilitates faster saddle point escape and allows for the use of larger, more efficient learning rates. This makes SAM a more practical and robust tool for training high-performance deep learning models.

Summary updated

BibTeX
@misc{tan2024stabilizing,
  author = {Chengli Tan and Jiangshe Zhang and Junmin Liu and Yicheng Wang and Yunda Hao},
  title = {{Stabilizing Sharpness-aware Minimization Through A Simple Renormalization Strategy}},
  year = {2024},
  eprint = {2401.07250},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2401.07250},
}
Figure