Lune

CVPR2024Top-tier venue

Friendly Sharpness-Aware Minimization

Tao Li, Pan Zhou, Zhengbao He, Xinwen Cheng, Xiaolin Huang

Abstract

Sharpness-Aware Minimization (SAM) has been instrumental in improving deep neural network training by minimizing both training loss and loss sharpness. Despite the practical success, the mechanisms behind SAM's generalization enhancements remain elusive, limiting its progress in deep learning optimization. In this work, we investigate SAM's core components for generalization improvement and introduce "Friendly-SAM" (F-SAM) to further enhance SAM's generalization. Our investigation reveals the key role of batch-specific stochastic gradient noise within the adversarial perturbation, i.e., the current minibatch gradient, which significantly influences SAM's generalization performance. By decomposing the adversarial perturbation in SAM into full gradient and stochastic gradient noise components, we discover that relying solely on the full gradient component degrades generalization while excluding it leads to improved performance. The possible reason lies in the full gradient component's increase in sharpness loss for the entire dataset, creating inconsistencies with the subsequent sharpness minimization step solely on the current minibatch data. Inspired by these insights, F-SAM aims to mitigate the negative effects of the full gradient component. It removes the full gradient estimated by an exponentially moving average (EMA) of historical stochastic gradients, and then leverages stochastic gradient noise for improved generalization. Moreover, we provide theoretical validation for the EMA approximation and prove the convergence of F-SAM on non-convex problems. Extensive experiments demonstrate the superior generalization performance and robustness of F-SAM over vanilla SAM. Code is available at https://github.com/nblt/F-SAM .

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

29 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Modality-Aware SAM: Sharpness-Aware-Minimization Driven Gradient Modulation for Harmonized Multimodal Learning cites Sharpness-aware Minimization for Efficiently Improving Generalization
  • Bi-LoRA: Efficient Sharpness-Aware Minimization for Fine-Tuning Large-Scale Models cites Fundamental Convergence Analysis of Sharpness-Aware Minimization
  • Bi-LoRA: Efficient Sharpness-Aware Minimization for Fine-Tuning Large-Scale Models cites Sharpness-aware Minimization for Efficiently Improving Generalization
  • Fundamental Convergence Analysis of Sharpness-Aware Minimization cites Sharpness-aware Minimization for Efficiently Improving Generalization
  • Swin Transformer: Hierarchical Vision Transformer using Shifted Windows cites Training data-efficient image transformers & distillation through attention
  • Beyond Magic Words: Sharpness-Aware Prompt Evolving for Robust Large Language Models with TARE cites Language Models are Few-Shot Learners
  • Beyond Magic Words: Sharpness-Aware Prompt Evolving for Robust Large Language Models with TARE cites Sharpness-aware Minimization for Efficiently Improving Generalization
  • SAMPa: Sharpness-aware Minimization Parallelized cites Fundamental Convergence Analysis of Sharpness-Aware Minimization
  • SAMPa: Sharpness-aware Minimization Parallelized cites Sharpness-aware Minimization for Efficiently Improving Generalization
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers29

  1. Fundamental Convergence Analysis of Sharpness-Aware MinimizationPham Duy Khanh, Hoang-Chau Luong, Boris S. Mordukhovich, Dat Ba TranNeurIPS 2024 · 27 citations
  2. SAMPa: Sharpness-aware Minimization ParallelizedWanyun Xie, Thomas Pethick, Volkan CevherNeurIPS 2024 · 12 citations
  3. Beyond Magic Words: Sharpness-Aware Prompt Evolving for Robust Large Language Models with TAREGuancheng Wan, Lucheng Fu, Haoxin Liu, Yiqiao Jin et al.ICLR 2026 · 11 citations
  4. Modality-Aware SAM: Sharpness-Aware-Minimization Driven Gradient Modulation for Harmonized Multimodal LearningHossein Rajoli Nowdeh, Jie Ji, Xiaolong Ma, Fatemeh AfghahNeurIPS 2025 · 3 citations
  5. Bi-LoRA: Efficient Sharpness-Aware Minimization for Fine-Tuning Large-Scale ModelsYuhang Liu, Tao Li, Zhehao Huang, Zuopeng Yang et al.ICLR 2026 · 3 citations

Builds on19

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. Swin Transformer: Hierarchical Vision Transformer using Shifted WindowsZe Liu, Yutong Lin, Yue Cao, Han Hu et al.ICCV 2021 · 31,683 citations
  3. Training data-efficient image transformers & distillation through attentionHugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa et al.ICML 2021 · 8,974 citations
  4. Sharpness-aware Minimization for Efficiently Improving GeneralizationPierre Foret, Ariel Kleiner, Hossein Mobahi, Behnam NeyshaburICLR 2021 · 1,861 citations
  5. AdaBelief Optimizer: Adapting Stepsizes by the Belief in Observed GradientsJuntang Zhuang, Tommy Tang, Yifan Ding, Sekhar Tatikonda et al.NeurIPS 2020 · 697 citations

Related papers

  1. How Sharpness-Aware Minimization Minimizes Sharpness?Kaiyue Wen, Tengyu Ma, Zhiyuan LiICLR 2023 · 3 citations
  2. Unveiling m-Sharpness Through the Structure of Stochastic Gradient NoiseHaocheng Luo, Mehrtash Harandi, Dinh Phung, Trung LeNeurIPS 2025 · 2 citations
  3. Towards Understanding Sharpness-Aware MinimizationMaksym Andriushchenko, Nicolas FlammarionICML 2022 · 190 citations
  4. Sharpness-Aware Minimization Efficiently Selects Flatter Minima Late In TrainingZhanpeng Zhou, Mingze Wang, Yuchen Mao, Bingrui Li et al.ICLR 2025
  5. Momentum-SAM: Sharpness Aware Minimization without Computational OverheadMarlon Becker, Frederick Altrock, Benjamin RisseNeurIPS 2025 · 16 citations
Dusk over the sea between two cliffs drawn in fine vertical lines