Improving SAM Requires Rethinking its Optimization Formulation

Wanyun Xie, Fabian Latorre, Kimon Antonakopoulos, Thomas Pethick, Volkan Cevher
7/17/2024
cs.LGstat.ML

Official code: LIONS-EPFL/BiSAM (4 stars, MIT, last commit 2024-10-06).

Abstract

This paper rethinks Sharpness-Aware Minimization (SAM), which is originally formulated as a zero-sum game where the weights of a network and a bounded perturbation try to minimize/maximize, respectively, the same differentiable loss. To fundamentally improve this design, we argue that SAM should instead be reformulated using the 0-1 loss. As a continuous relaxation, we follow the simple conventional approach where the minimizing (maximizing) player uses an upper bound (lower bound) surrogate to the 0-1 loss. This leads to a novel formulation of SAM as a bilevel optimization problem, dubbed as BiSAM. BiSAM with newly designed lower-bound surrogate loss indeed constructs stronger perturbation. Through numerical evidence, we show that BiSAM consistently results in improved performance when compared to the original SAM and variants, while enjoying similar computational complexity. Our code is available at https://github.com/LIONS-EPFL/BiSAM.

View on arXivView PDF

Code Implementations(1)

LIONS-EPFL/BiSAMOfficial100%
MIT

The public code for BiSAM paper.

40PythonMay 29, 20242 years agoMIT

Similar Papers

Cite this paper

@article{xie2024improving,
  title  = {Improving SAM Requires Rethinking its Optimization Formulation},
  author = {Wanyun Xie and Fabian Latorre and Kimon Antonakopoulos and Thomas Pethick and Volkan Cevher},
  year   = {2024},
  eprint = {2407.12993},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2407.12993v1},
  journal = {ICML 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2407.12993.svg)](https://codeofpaper.com/paper/2407.12993)

Discussion