A Modern Look at the Relationship Between Sharpness and Generalization

Abstract

Sharpness of minima is a promising quantity that can correlate with generalization in deep networks and, when optimized during training, can improve generalization. However, standard sharpness is not invariant under reparametrizations of neural networks, and, to fix this, reparametrization-invariant sharpness definitions have been proposed, most prominently adaptive sharpness (Kwon et al., 2021). But does it really capture generalization in modern practical settings? We comprehensively explore this question in a detailed study of various definitions of adaptive sharpness in settings ranging from training from scratch on ImageNet and CIFAR-10 to fine-tuning CLIP on ImageNet and BERT on MNLI. We focus mostly on transformers for which little is known in terms of sharpness despite their widespread usage. Overall, we observe that sharpness does not correlate well with generalization but rather with some training parameters like the learning rate that can be positively or negatively correlated with generalization depending on the setup. Interestingly, in multiple cases, we observe a consistent negative correlation of sharpness with OOD generalization implying that sharper minima can generalize better. Finally, we illustrate on a simple model that the right sharpness measure is highly data-dependent, and that we do not understand well this aspect for realistic data distributions.

Cite

Text

Andriushchenko et al. "A Modern Look at the Relationship Between Sharpness and Generalization." International Conference on Machine Learning, 2023.

Markdown

[Andriushchenko et al. "A Modern Look at the Relationship Between Sharpness and Generalization." International Conference on Machine Learning, 2023.](https://mlanthology.org/icml/2023/andriushchenko2023icml-modern/)

BibTeX

@inproceedings{andriushchenko2023icml-modern,
  title     = {{A Modern Look at the Relationship Between Sharpness and Generalization}},
  author    = {Andriushchenko, Maksym and Croce, Francesco and Müller, Maximilian and Hein, Matthias and Flammarion, Nicolas},
  booktitle = {International Conference on Machine Learning},
  year      = {2023},
  pages     = {840-902},
  volume    = {202},
  url       = {https://mlanthology.org/icml/2023/andriushchenko2023icml-modern/}
}