Skip to content
Last Dictionary

sharpness-aware minimization

nounAlso: SAM, adaptive sharpness-aware minimization, ASAM

In plain wordsA training method that looks for settings where the error stays low even if the settings are nudged a little, rather than settings that are merely low at one precise point.

  1. An optimization procedure that minimizes the worst-case loss within a small neighborhood of the current parameters — a min–max objective — rather than the loss at a single point, steering training toward flat minimasharp and flat minima, n.: Two kinds of low points a trained model can settle into: narrow pits where small changes spoil performance, and broad basins where they barely matter. Broad basins are thought to generalize better, though this is debated.. Each step computes the gradient, takes an ascent step of radius ρ along its normalized direction to approximate the worst nearby point, computes the gradient there, and applies that second gradient at the original parameters through any base optimizeroptimizer, n.: The rule a training program uses to turn measured errors into actual changes to a model's internal numbers, deciding the direction and size of each adjustment.. The extra gradient computation roughly doubles the cost per step; variants cut the overhead or make the neighborhood scale-invariant (adaptive SAM). SAM improved image-classification benchmarks and robustness to label noiselabel noise, n.: Mistakes in the answers attached to training or test examples — a dog photo marked 'cat' — which can mislead what a model learns and distort how good it seems., with especially large gains for vision transformersvision transformer, n.: A way of applying the transformer, the design behind chatbots, to pictures: the image is cut into small square tiles that the model reads like words in a sentence. and MLP-Mixers trained without heavy augmentation, and is also used in fine-tuning. Why it works is still debated: its benefits do not track measured flatness as closely as its motivation suggests, and its implicit regularization of the training dynamics may matter more.

min⁡θ  max⁡∥ϵ∥2≤ρ  L(θ+ϵ)\min_{\theta} \; \max_{\lVert \epsilon \rVert_2 \le \rho} \; L(\theta + \epsilon)

Origin

Introduced by Pierre Foret, Ariel Kleiner, Hossein Mobahi and Behnam Neyshabur of Google in 'Sharpness-Aware Minimization for Efficiently Improving Generalization' (arXiv October 2020; ICLR 2021), drawing on the flat-minima tradition and PAC-Bayesian generalization bounds.

Usage note

The abbreviation SAM also denotes Meta's Segment Anything ModelSegment Anything Model, prop. n.: A family of AI models from Meta that trace the exact outline of whatever you point to in a photo or video, whether by clicking on it, drawing a box around it or, in newer versions, naming it..

Related

See also
  • sharp and flat minimasharp and flat minima, n.: Two kinds of low points a trained model can settle into: narrow pits where small changes spoil performance, and broad basins where they barely matter. Broad basins are thought to generalize better, though this is debated.
  • loss landscapeloss landscape, n.: A way of picturing training as a journey across hilly terrain, where position stands for the model's settings and height for its error. Training searches for low valleys.
  • optimizeroptimizer, n.: The rule a training program uses to turn measured errors into actual changes to a model's internal numbers, deciding the direction and size of each adjustment.
  • implicit regularizationimplicit regularization, n.: The hidden preferences of a training method itself: even with no explicit rule against complexity, the way a model is trained tends to steer it toward simpler solutions.
  • generalization gapgeneralization gap, n.: The difference between how well a model does on the examples it trained on and how well it does on new ones. A big gap means it memorized rather than learned.
  • adversarial trainingadversarial training, n.: Toughening an AI model by deliberately showing it attacks during training — the tricky inputs that fool it — along with the right responses, so it learns to resist them.

Sources

  1. Foret, P., Kleiner, A., Mobahi, H. & Neyshabur, B. (2021). Sharpness-Aware Minimization for Efficiently Improving Generalization. ICLR 2021. arxiv.org/abs/2010.01412

Mentioned in

sharp and flat minimasharp and flat minima, n.: Two kinds of low points a trained model can settle into: narrow pits where small changes spoil performance, and broad basins where they barely matter. Broad basins are thought to generalize better, though this is debated.