mSAM: Micro-Batch-Averaged Sharpness-Aware Minimization

Kayhan Behdin, Qingquan Song, Aman Gupta, Sathiya Keerthi, Ayan Acharya +5 more
2/19/2023
stat.MLcs.LG

No confident code implementation found for this paper.

Abstract

Modern deep learning models are over-parameterized, where different optima can result in widely varying generalization performance. The Sharpness-Aware Minimization (SAM) technique modifies the fundamental loss function that steers gradient descent methods toward flatter minima, which are believed to exhibit enhanced generalization prowess. Our study delves into a specific variant of SAM known as micro-batch SAM (mSAM). This variation involves aggregating updates derived from adversarial perturbations across multiple shards (micro-batches) of a mini-batch during training. We extend a recently developed and well-studied general framework for flatness analysis to theoretically show that SAM achieves flatter minima than SGD, and mSAM achieves even flatter minima than SAM. We provide a thorough empirical evaluation of various image classification and natural language processing tasks to substantiate this theoretical advancement. We also show that contrary to previous work, mSAM can be implemented in a flexible and parallelizable manner without significantly increasing computational costs. Our implementation of mSAM yields superior generalization performance across a wide range of tasks compared to SAM, further supporting our theoretical framework.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{behdin2023msam,
  title  = {mSAM: Micro-Batch-Averaged Sharpness-Aware Minimization},
  author = {Kayhan Behdin and Qingquan Song and Aman Gupta and Sathiya Keerthi and Ayan Acharya and Borja Ocejo and Gregory Dexter and Rajiv Khanna and David Durfee and Rahul Mazumder},
  year   = {2023},
  eprint = {2302.09693},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2302.09693v2}
}

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/2302.09693.svg)](https://codeofpaper.com/paper/2302.09693)

Discussion