AI Research Scientist · Scaling Laws & Stability
Sharpness-aware minimization (SAM) algorithm
Sharpness-aware minimization (SAM) algorithm
Computing the ascent-step perturbation
- 1Find the worst-case directionCompute and normalize it: - the unit direction that increases loss fastest from the current weights.
- 2Bound it to the neighborhoodScale by the radius : , the farthest step allowed within the -ball around .
- 3Form the perturbed weightsAdd it to : . This is the ascent step - an approximation of the worst-case point near , used only for the next step.
- 1Compute the ascent gradient: at .WhyThis is the loss-increasing direction the perturbation is built from.
- 2Perturb the weight: , so .WhyThis places the search at the worst-case point inside the neighborhood, not at itself.
- 3Evaluate the descent gradient at , not at : , then update , versus SGD’s .WhyUsing the perturbed-point gradient makes the update react to how loss behaves nearby, not just at one point.
Recall check from the same lesson
Since SAM's ascent step already finds the highest-loss point near the current weights, the descent step could equivalently just run ordinary gradient descent from the original weights $w$ and still bias training toward flatter minima.
Review the explanation
Answer: False. The flatness bias comes specifically from evaluating the descent gradient at the perturbed point $w_{adv}$, which reflects how loss behaves nearby. Descending from the original $w$ instead reduces the procedure to plain gradient descent, discarding the very step that penalizes sharp regions.
Sources
One sitting · 20–30 minutes
A focused session on your AI Research Scientist interview
LearnBench starts from what you already know — skip what you have, master what you’re missing.
Start now