Sharpness aware minimization: Difference between revisions

Content deleted Content added
AnomieBOT (talk | contribs)
m Dating maintenance tags: {{Technical}}
Citation bot (talk | contribs)
Removed URL that duplicated identifier. Removed access-date with no URL. Removed parameters. | Use this bot. Report bugs. | Suggested by Abductive | Category:Orphaned articles from June 2025 | #UCB_Category 462/875
 
(8 intermediate revisions by 6 users not shown)
Line 1:
{{Short description|OptimizationMachine algorithmlearning foroptimization improving generalization in machine learning modelsalgorithm}}
{{Multiple issues|
{{technical|date=June 2025}}
{{AI-generated|date=June 2025}}
{{UncategorizedOrphan|date=June 2025}}
}}
 
'''Sharpness Aware Minimization''' ('''SAM''') is an [[optimization algorithm]] used in [[machine learning]] that aims to improve model [[generalization (machine learning)|generalization]]. The method seeks to find model parameters that are located in regions of the loss landscape with uniformly low loss values, rather than parameters that only achieve a minimal loss value at a single point. This approach is described as finding "flat" minima instead of "sharp" ones. The rationale is that models trained this way are less sensitive to variations between training and test [[data set|data]], which can lead to better performance on unseen data.<ref name="Foret2021">{{cite conference |last1=Foret |first1=Pierre |last2=Kleiner |first2=Ariel |last3=Mobahi |first3=Hossein |last4=Neyshabur |first4=Behnam |year=2021 |title=Sharpness-Aware Minimization for Efficiently Improving Generalization |url=https://openreview.net/forum?id=6Tm1mposlrM |conference= |arxiv=2010.01412 |book-title=International Conference on Learning Representations (ICLR) 2021 |year=2021 |arxiv=2010.01412 |url=https://openreview.net/forum?id=6Tm1m_rRrwY}}</ref>
 
The algorithm was introduced in a 2020 paper by a team of researchers including Pierre Foret, Ariel Kleiner, Hossein Mobahi, and Behnam Neyshabur.<ref name="Foret2021"/>
Line 30 ⟶ 31:
SAM has been applied in various machine learning contexts, primarily in [[computer vision]]. Research has shown it can improve generalization performance in models such as [[Convolutional Neural Network|Convolutional Neural Networks (CNNs)]] and [[Transformer (machine learning model)|Vision Transformers (ViTs)]] on image datasets including [[ImageNet]], [[CIFAR-10]], and [[CIFAR-100]].<ref name="Foret2021"/>
 
The algorithm has also been found to be effective in training models with [[Label noise|noisy labels]], where it performs comparably to methods designed specifically for this problem.<ref name="Wen2021MitigatingZhuang2022Surrogate">{{cite arXivconference |last1=WenZhuang |first1=YuleiJuntang |last2=LiuGong |first2=ZhenMing |last3=ZhangLiu |first3=ZheTong |last4year=Zhang |first4=Yilong |last5=Wang |first5=Linmi |last6=Zhang |first6=Tiantian2022 |title=MitigatingSurrogate MemorizationGap inMinimization SampleImproves SelectionSharpness-Aware for Learning with Noisy LabelsTraining |eprinturl=2110https://openreview.08529 |yearnet/forum?id=2021edONMAnhLu- |class=cs.LG}}</ref><ref name="Zhuang2022Surrogate">{{cite conference |last1=Zhuang |first1publisher=JuntangPMLR |last2pages=Gong |first2=Ming |last3=Liu |first3=Tong |title=Surrogate Gap Minimization Improves Sharpness-Aware Training27098–27115 |book-title=International Conference on Machine Learning (ICML) 2022 |year=2022 |pages=27098–27115 |publisher=PMLR |url=https://proceedings.mlr.press/v162/zhuang22d.html}}</ref> Some studies indicate that SAM and its variants can improve [[Out-of-distribution generalization|out-of-distribution (OOD) generalization]], which is a model's ability to perform well on data from distributions not seen during training.<ref name="Croce2021SAMBayes">{{cite journal |last1=Croce |first1=Francesco |last2=Hein |first2=Matthias |title=High-Resolution "Magic"-Field Spectroscopy on Trapped Polyatomic Molecules |journal=Physical Review Letters |arxiv=2110.11214 |year=2021 |volume=127 |issue=17 |page=173602 |doi=10.1103/PhysRevLett.127.173602 |pmid=34739278 |bibcode=2021PhRvL.127q3602P }}</ref><ref name="Kim2022Slicing">{{cite conference |last1=Kim |first1=Daehyeon |last2=Kim |first2=Seungone |last3=Kim |first3=Kwangrok |last4=Kim |first4=Sejun |last5=Kim |first5=Jangho |title=Slicing Aided Hyper-dimensional Inference and Fine-tuning for Improved OOD Generalization |book-title=Conference on Neural Information Processing Systems (NeurIPS) 2022 |year=2022 |url=https://openreview.net/forum?id=fN0K3jtnQG_}}</ref> Other areas where it has been applied include gradual [[___domain adaptation]] and mitigating [[overfitting]] in scenarios with repeated exposure to training examples.<ref name="Liu2021Delving">{{cite arXiv |last1=Liu |first1=Sitong |last2=Zhou |first2=Pan |last3=Zhang |first3=Xingchao |last4=Xu |first4=Zhi |last5=Wang |first5=Guang |last6=Zhao |first6=Hao |title=Delving into SAM: An Analytical Study of Sharpness Aware Minimization |eprint=2111.00905 |year=2021 |class=cs.LG}}</ref><ref name="Foret2021"/>
 
== Limitations ==
A primary limitation of SAM is its computational cost. By requiring two gradient computations (one for the ascent and one for the descent) per optimization step, it approximately doubles the training time compared to standard optimizers.<ref name="Foret2021"/>
 
The theoretical [[Convergence of an algorithm|convergence properties]] of SAM are still under investigation. Some research suggests that with a constant step size, SAM may not converge to a stationary point.<ref name="Andriushchenko2022Understanding">{{cite conference |last1=Andriushchenko |first1=Maksym |last2=Flammarion |first2=Nicolas |title=Towards Understanding Sharpness-Aware Minimization |book-title=International Conference on Machine Learning (ICML) 2022 |year=2022 |pages=612–639 |publisher=PMLR |url=https://proceedings.mlr.press/v162/andriushchenko22a.html}}</ref> The accuracy of the single gradient step approximation for finding the worst-case perturbation may also decrease during the training process.<ref name="Kwon2021ASAM">{{cite conference |last1=Kwon |first1=Jungmin |last2=Kim |first2=Jeongseop |last3=Park |first3=Hyunseo |last4=Choi |first4=Il-Chul |year=2021 |title=ASAM: Adaptive Sharpness-Aware Minimization for Scale-Invariant Learning of Deep Neural Networks |url=https://proceedings.mlr.press/v139/kwon21b.html |conference= |publisher=PMLR |pages=5919–5929 |book-title=International Conference on Machine Learning (ICML) 2021 |year=2021 |pages=5919–5929 |publisher=PMLR |url=https://proceedings.mlr.press/v139/kwon21a.html}}</ref>
 
The effectiveness of SAM can also be ___domain-dependent. While it has shown benefits for computer vision tasks, its impact on other areas, such as [[GPT model|GPT-style language models]] where each training example is seen only once, has been reported as limited in some studies.<ref name="Chen2023SAMLLM">{{cite arXiv |last1=Chen |first1=Xian |last2=Zhai |first2=Saining |last3=Chan |first3=Crucian |last4=Le |first4=Quoc V. |last5=Houlsby |first5=Graham |title=When is Sharpness-Aware Minimization (SAM) Effective for Large Language Models? |eprint=2308.04932 |year=2023 |class=cs.LG}}</ref> Furthermore, while SAM seeks flat minima, some research suggests that not all flat minima necessarily lead to good generalization.<ref name="Liu2023SAMOOD">{{cite conference |last1=Liu |first1=Kai |last2=Li |first2=Yifan |last3=Wang |first3=Hao |last4=Liu |first4=Zhen |last5=Zhao |first5=Jindong |title=When Sharpness-Aware Minimization Meets Data Augmentation: Connect the Dots for OOD Generalization |book-title=International Conference on Learning Representations (ICLR) 2023 |year=2023 |url=https://openreview.net/forum?id=Nc0e196NhF}}</ref> The algorithm also introduces the neighborhood size <math>\rho</math> as a new hyperparameter, which requires tuning.<ref name="Foret2021"/>
 
== Research, Variants, and Enhancements ==
Active research on SAM focuses on reducing its computational overhead and improving its performance. Several variants have been proposed to make the algorithm more efficient. These include methods that attempt to parallelize the two gradient computations, apply the perturbation to only a subset of parameters, or reduce the number of computation steps required.<ref name="Dou2022SAMPa">{{cite arXiv |last1eprint=Dou2410.10683 |first1class=Yongcs.LG |last2first1=ZhouWanyun |first2last1=CongXie |last3first2=ZhaoThomas |first3last2=Peng |last4=Zhang |first4=TongPethick |title=SAMPa: A Parallelized Version of Sharpness-Awareaware Minimization Parallelized |eprintlast3=2202.02081Cevher |yearfirst3=2022Volkan |classyear=cs.LG2022}}</ref><ref name="Chen2022SSAMu277">{{cite arXivcitation |last1=ChenMi |first1=Wenlong |last2=Liu |first2=Xiaoyu |last3=Yin |first3=Huan |last4=Yang |first4=TianlongPeng |title=Sparse SAM: SqueezingMake Sharpness-awareAware Minimization intoStronger: aA SingleSparsified Forward-backwardPerturbation PassApproach |eprintdate=2205.135162022 |yearpage=2022 |classarxiv=cs2210.LG}}</ref><ref05177 name|last2="Zhuang2022S2SAM">{{citeShen arXiv|first2=Li |last1last3=ZhuangRen |first1first3=JuntangTianhe |last2last4=LiuZhou |first2first4=TongYiyi |last3last5=TaoSun |first3first5=DachengXiaoshuai |titlelast6=S2-SAM: A Single-Step, Zero-Extra-Cost Approach to Sharpness-Aware TrainingJi |eprintfirst6=2206.08307Rongrong |yearlast7=2022Tao |classfirst7=cs.LGDacheng }}</ref> Other approaches use historical gradient information or apply SAM steps intermittently to lower the computational burden.<ref name="He2021MomentumSAMk651">{{cite journalconference |last1=HeJi |first1=ZequnJie |last2=LiuLi |first2=SitongGen |last3=ZhangFu |first3=XingchaoJingjing |last4=ZhouAfghah |first4=PanFatemeh |last5=ZhangGuo |first5=CongLinke |last6=XuYuan |first6=ZhiXiaoyong |last7=ZhaoMa |first7=HaoXiaolong |date=2025-06-05 |title=OpticalProceedings secretof sharingthe with38th cascadedInternational metasurfaceConference holographyon |journal=ScienceNeural AdvancesInformation Processing Systems |arxivurl=2110https://dl.acm.org/doi/10.5555/3737916.032653739321 |yearpublisher=2021Curran Associates Inc. |volumepublication-place=7Red Hook, NY, USA |issuevolume=1637 |doipage=10.1126/sciadv.abf9718 |pmidpages=3385378844269–44290 |pmcisbn=8046362979-8--33131438-5 |bibcodeaccess-date=2021SciA....7.9718G 2025-06-26}}</ref> Other approaches use historical gradient information or apply SAM steps intermittently to lower the computational burden.<ref name="Liu2022LookaheadSAM">{{cite conference |last1=LiuYu |first1=SitongRunsheng |last2=HeZhang |first2=ZequnYouzhi |last3=ZhangKwok |first3=XingchaoJames |last4year=Zhou2024 |first4title=PanImproving |last5=XuSharpness-Aware |first5=ZhiMinimization |last6=Zhangby |first6=CongLookahead |last7url=Zhaohttps://proceedings.mlr.press/v235/yu24q.html |first7conference=Hao |title=Lookahead Sharpness-aware Minimization |book-title=International Conference on Learning Representations (ICLR) 2022 |year=2022 |url=https://openreview.net/forum?id=7s38W2293F}}</ref>
 
To improve performance and robustness, variants have been developed that adapt the neighborhood size based on model parameter scales (Adaptive SAM or ASAM)<ref name="Kwon2021ASAM"/> or incorporate information about the curvature of the loss landscape (Curvature Regularized SAM or CR-SAM).<ref name="Kim2022CRSAM">{{cite journal |last1=Kim |first1=Minhwan |last2=Lee |first2=Suyeon |last3=Shin |first3=Jonghyun |title=MRChem Multiresolution Analysis Code for Molecular Electronic Structure Calculations: Performance and Scaling Properties |journal=Journal of Chemical Theory and Computation |arxiv=2210.01011 |year=2023 |volume=19 |issue=1 |pages=137–146 |doi=10.1021/acs.jctc.2c00982 |pmid=36410396 |pmc=9835826 }}</ref> Other research explores refining the perturbation step by focusing on specific components of the gradient or combining SAM with techniques like random smoothing.<ref name="Liu2023FriendlySAMm141">{{cite conference |last1=LiuLi |first1=KaiTao |last2=WangZhou |first2=HaoPan |last3=LiHe |first3=YifanZhengbao |last4=LiuCheng |first4=ZhenXinwen |last5=ZhangHuang |first5=RunpengXiaolin |last6title=Zhao2024 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) |first6date=Jindong2024-06-16 |titlechapter=Friendly Sharpness-Aware Minimization |book-titlepage=International Conference on Learning Representations (ICLR) 2023|publisher=IEEE |yearpages=20235631–5640 |urldoi=https://openreview10.net1109/forum?idCVPR52733.2024.00538 |isbn=RndGzfJl4y979-8-3503-5300-6 }}</ref><ref name="Singh2021RSAMt248">{{cite arXivjournal |last1=SinghLiu |first1=Sandeep KumarYong |last2=AhnMai |first2=KyungsuSiqi |last3=OhCheng |first3=SonghwaiMinhao |titlelast4=RChen |first4=Xiangning |last5=Hsieh |first5=Cho-SAM:Jui |last6=You |first6=Yang |date=2022-12-06 |title=Random StructureSharpness-Aware Minimization for|url=https://papers.nips.cc/paper_files/paper/2022/hash/9b79416c0dc4b09feaa169ed5cdd63d4-Abstract-Conference.html Generalization|journal=Advances andin RobustnessNeural Information Processing Systems |eprintvolume=2110.0748635 |yearpages=202124543–24556 |classaccess-date=cs.LG2025-06-26}}</ref>
 
Theoretical work continues to analyze the algorithm's behavior, including its implicit bias towards flatter minima and the development of broader frameworks for sharpness-aware optimization that use different measures of sharpness.<ref name="Wen2022SAMLandscape">{{cite arXiv |last1=Wen |first1=Yulei |last2=Zhang |first2=Zhe |last3=Liu |first3=Zhen |last4=Li |first4=Yue |last5=Zhang |first5=Tiantian |title=How Does SAM Influence the Loss Landscape? |eprint=2203.08065 |year=2022 |class=cs.LG}}</ref><ref name="Zhou2023SAMUnified">{{cite arXiv |last1=Zhou |first1=Kaizheng |last2=Zhang |first2=Yulai |last3=Tao |first3=Dacheng |title=Sharpness-Aware Minimization: A Unified View and A New Theory |eprint=2305.10276 |year=2023 |class=cs.LG}}</ref>
 
== References ==
{{reflist}}
 
 
{{Uncategorized|date=June 2025}}
 
[[Category:Machine learning algorithms]]
[[Category:Optimization algorithms and methods]]