SAMPa: Sharpness-aware Minimization Parallelized

Wanyun Xie, T. Pethick, V. Cevher
2/3/2026

No official code found. Best implementation: LIONS-EPFL/SAMPa (6 stars, last commit 2025-05-29).

Abstract

Sharpness-aware minimization (SAM) has been shown to improve the generalization of neural networks. However, each SAM update requires \emph{sequentially} computing two gradients, effectively doubling the per-iteration cost compared to base optimizers like SGD. We propose a simple modification of SAM, termed SAMPa, which allows us to fully parallelize the two gradient computations. SAMPa achieves a twofold speedup of SAM under the assumption that communication costs between devices are negligible. Empirical results show that SAMPa ranks among the most efficient variants of SAM in terms of computational time. Additionally, our method consistently outperforms SAM across both vision and language tasks. Notably, SAMPa theoretically maintains convergence guarantees even for \emph{fixed} perturbation sizes, which is established through a novel Lyapunov function. We in fact arrive at SAMPa by treating this convergence guarantee as a hard requirement -- an approach we believe is promising for developing SAM-based methods in general. Our code is available at \url{https://github.com/LIONS-EPFL/SAMPa}.

View on arXivView PDF

Code Implementations(1)

LIONS-EPFL/SAMPaCommunity100%

SAMPa: Sharpness-aware Minimization Parallelized, NeurIPS 2024

60PythonOct 7, 20241 years ago

Similar Papers

Cite this paper

@article{xie2026sampa,
  title  = {SAMPa: Sharpness-aware Minimization Parallelized},
  author = {Wanyun Xie and T. Pethick and V. Cevher},
  year   = {2026},
  eprint = {2410.10683},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2410.10683},
  url    = {https://arxiv.org/abs/2410.10683},
  journal = {NEURIPS 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/2410.10683.svg)](https://codeofpaper.com/paper/2410.10683)

Discussion