Sharpness-Aware Minimization Leads to Low-Rank Features

Maksym Andriushchenko, Dara Bahri, Hossein Mobahi, Nicolas Flammarion
5/25/2023
cs.LG

Official code: tml-epfl/sam-low-rank-features (29 stars, last commit 2023-09-22).

Abstract

Sharpness-aware minimization (SAM) is a recently proposed method that minimizes the sharpness of the training loss of a neural network. While its generalization improvement is well-known and is the primary motivation, we uncover an additional intriguing effect of SAM: reduction of the feature rank which happens at different layers of a neural network. We show that this low-rank effect occurs very broadly: for different architectures such as fully-connected networks, convolutional networks, vision transformers and for different objectives such as regression, classification, language-image contrastive training. To better understand this phenomenon, we provide a mechanistic understanding of how low-rank features arise in a simple two-layer network. We observe that a significant number of activations gets entirely pruned by SAM which directly contributes to the rank reduction. We confirm this effect theoretically and check that it can also occur in deep networks, although the overall rank reduction mechanism can be more complex, especially for deep networks with pre-activation skip connections and self-attention layers. We make our code available at https://github.com/tml-epfl/sam-low-rank-features.

View on arXivView PDF

Code Implementations(1)

Sharpness-Aware Minimization Leads to Low-Rank Features [NeurIPS 2023]

292Python, Jupyter NotebookMay 25, 20233 years ago

Similar Papers

Cite this paper

@article{andriushchenko2023sharpnessaware,
  title  = {Sharpness-Aware Minimization Leads to Low-Rank Features},
  author = {Maksym Andriushchenko and Dara Bahri and Hossein Mobahi and Nicolas Flammarion},
  year   = {2023},
  eprint = {2305.16292},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2305.16292v2},
  journal = {NEURIPS 2023 2023}
}

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

Discussion