Content deleted Content added
-- Draft creation using the WP:Article wizard -- |
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 |
||
(23 intermediate revisions by 13 users not shown) | |||
Line 1:
{{Short description|Machine learning optimization algorithm}}
{{Multiple issues|
{{technical|date=June 2025}}
{{AI-generated|date=June 2025}}
{{Orphan|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}}</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"/>
== Underlying Principle ==
SAM modifies the standard training objective by minimizing a "sharpness-aware" loss. This is formulated as a minimax problem where the inner objective seeks to find the highest loss value in the immediate neighborhood of the current model weights, and the outer objective minimizes this value:<ref name="Foret2021"/>
<math>\min_{w} \max_{\|\epsilon\|_p \le \rho} L_{\text{train}}(w + \epsilon) + \lambda \|w\|_2^2</math>
In this formulation:
* <math>w</math> represents the model's parameters (weights).
* <math>L_{\text{train}}</math> is the [[loss function|loss]] calculated on the training data.
* <math>\epsilon</math> is a perturbation applied to the weights.
* <math>\rho</math> is a [[hyperparameter (machine learning)|hyperparameter]] that defines the radius of the neighborhood (an <math>L_p</math> ball) to search for the highest loss.
* An optional [[Regularization (mathematics)|L2 regularization]] term, scaled by <math>\lambda</math>, can be included.
A direct solution to the inner maximization problem is computationally expensive. SAM approximates it by taking a single [[gradient ascent]] step to find the perturbation <math>\epsilon</math>. This is calculated as:<ref name="Foret2021"/>
<math>\epsilon(w) = \rho \frac{\nabla L_{\text{train}}(w)}{\|\nabla L_{\text{train}}(w)\|_2}</math>
The optimization process for each training step involves two stages. First, an "ascent step" computes a perturbed set of weights, <math>w_{\text{adv}} = w + \epsilon(w)</math>, by moving towards the direction of the highest local loss. Second, a "descent step" updates the original weights <math>w</math> using the gradient calculated at these perturbed weights, <math>\nabla L_{\text{train}}(w_{\text{adv}})</math>. This update is typically performed using a standard optimizer like [[Stochastic gradient descent|SGD]] or [[Adam (optimization algorithm)|Adam]].<ref name="Foret2021"/>
== Application and Performance ==
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="Zhuang2022Surrogate">{{cite conference |last1=Zhuang |first1=Juntang |last2=Gong |first2=Ming |last3=Liu |first3=Tong |year=2022 |title=Surrogate Gap Minimization Improves Sharpness-Aware Training |url=https://openreview.net/forum?id=edONMAnhLu- |conference= |publisher=PMLR |pages=27098–27115 |book-title=International Conference on Machine Learning (ICML) 2022}}</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. Other areas where it has been applied include gradual [[___domain adaptation]] and mitigating [[overfitting]] in scenarios with repeated exposure to training examples.<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}}</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. Furthermore, while SAM seeks flat minima, some research suggests that not all flat minima necessarily lead to good generalization. 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 |eprint=2410.10683 |class=cs.LG |first1=Wanyun |last1=Xie |first2=Thomas |last2=Pethick |title=SAMPa: Sharpness-aware Minimization Parallelized |last3=Cevher |first3=Volkan |year=2022}}</ref><ref name="u277">{{citation |last1=Mi |first1=Peng |title=Make Sharpness-Aware Minimization Stronger: A Sparsified Perturbation Approach |date=2022 |page= |arxiv=2210.05177 |last2=Shen |first2=Li |last3=Ren |first3=Tianhe |last4=Zhou |first4=Yiyi |last5=Sun |first5=Xiaoshuai |last6=Ji |first6=Rongrong |last7=Tao |first7=Dacheng }}</ref><ref name="k651">{{cite conference |last1=Ji |first1=Jie |last2=Li |first2=Gen |last3=Fu |first3=Jingjing |last4=Afghah |first4=Fatemeh |last5=Guo |first5=Linke |last6=Yuan |first6=Xiaoyong |last7=Ma |first7=Xiaolong |date=2025-06-05 |title=Proceedings of the 38th International Conference on Neural Information Processing Systems |url=https://dl.acm.org/doi/10.5555/3737916.3739321 |publisher=Curran Associates Inc. |publication-place=Red Hook, NY, USA |volume=37 |page= |pages=44269–44290 |isbn=979-8--33131438-5 |access-date=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=Yu |first1=Runsheng |last2=Zhang |first2=Youzhi |last3=Kwok |first3=James |year=2024 |title=Improving Sharpness-Aware Minimization by Lookahead |url=https://proceedings.mlr.press/v235/yu24q.html |conference= |book-title=International Conference on Learning Representations (ICLR) 2022}}</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). 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="m141">{{cite conference |last1=Li |first1=Tao |last2=Zhou |first2=Pan |last3=He |first3=Zhengbao |last4=Cheng |first4=Xinwen |last5=Huang |first5=Xiaolin |title=2024 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) |date=2024-06-16 |chapter=Friendly Sharpness-Aware Minimization |page= |publisher=IEEE |pages=5631–5640 |doi=10.1109/CVPR52733.2024.00538 |isbn=979-8-3503-5300-6 }}</ref><ref name="t248">{{cite journal |last1=Liu |first1=Yong |last2=Mai |first2=Siqi |last3=Cheng |first3=Minhao |last4=Chen |first4=Xiangning |last5=Hsieh |first5=Cho-Jui |last6=You |first6=Yang |date=2022-12-06 |title=Random Sharpness-Aware Minimization |url=https://papers.nips.cc/paper_files/paper/2022/hash/9b79416c0dc4b09feaa169ed5cdd63d4-Abstract-Conference.html |journal=Advances in Neural Information Processing Systems |volume=35 |pages=24543–24556 |access-date=2025-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.
== References ==
{{reflist}}
[[Category:Machine learning algorithms]]
[[Category:Optimization algorithms and methods]]
|