Skip to main content
QUICK REVIEW

[Paper Review] Why Does Sharpness-Aware Minimization Generalize Better Than SGD?

Zixiang Chen, Junkai Zhang|arXiv (Cornell University)|Oct 11, 2023
Machine Learning and Data ClassificationComputer Science4 citations
TL;DR

This paper provides a theoretical explanation for why Sharpness-Aware Minimization (SAM) generalizes better than SGD in two-layer ReLU convolutional networks, particularly under label noise. It shows SAM prevents early-stage noise memorization by favoring flatter minima, enabling effective feature learning, while SGD fails when signal strength is weak. The key result is a formal phase transition in generalization performance based on signal-to-noise ratio.

ABSTRACT

The challenge of overfitting, in which the model memorizes the training data and fails to generalize to test data, has become increasingly significant in the training of large neural networks. To tackle this challenge, Sharpness-Aware Minimization (SAM) has emerged as a promising training method, which can improve the generalization of neural networks even in the presence of label noise. However, a deep understanding of how SAM works, especially in the setting of nonlinear neural networks and classification tasks, remains largely missing. This paper fills this gap by demonstrating why SAM generalizes better than Stochastic Gradient Descent (SGD) for a certain data model and two-layer convolutional ReLU networks. The loss landscape of our studied problem is nonsmooth, thus current explanations for the success of SAM based on the Hessian information are insufficient. Our result explains the benefits of SAM, particularly its ability to prevent noise learning in the early stages, thereby facilitating more effective learning of features. Experiments on both synthetic and real data corroborate our theory.

Motivation & Objective

  • To understand why SAM generalizes better than SGD in nonlinear, non-smooth neural networks, especially under label noise.
  • To characterize the conditions under which SGD leads to harmful overfitting versus benign overfitting in two-layer ReLU convolutional networks.
  • To formally demonstrate that SAM achieves benign overfitting even when SGD fails, by preventing noise learning in early training stages.
  • To establish a theoretical distinction between SAM and SGD in terms of generalization error, particularly in non-smooth loss landscapes.

Proposed method

  • Analyzes the loss landscape of two-layer ReLU convolutional networks, showing it is non-smooth, invalidating Hessian-based explanations.
  • Introduces a data model characterized by signal strength $\|\bm{\mu}\|_2$ and input dimension $d$, to study generalization under label noise.
  • Uses probabilistic concentration inequalities to bound the test error of SAM and SGD, focusing on the margin of prediction.
  • Derives conditions under which the prediction margin remains large, ensuring low test error, by analyzing the norm of network weights and activation outputs.
  • Employs a phase transition analysis to show a sharp boundary in generalization performance based on $\|\bm{\mu}\|_2$ relative to $d^{1/4}$.
  • Proves that SAM maintains low test error ($\leq p + \epsilon$) when $\|\bm{\mu}\|_2 \geq \widetilde{\Omega}(1)$, while SGD fails when $\|\bm{\mu}\|_2 \leq O(d^{1/4})$.

Experimental results

Research questions

  • RQ1Under what conditions does SGD fail to generalize due to harmful overfitting in two-layer ReLU networks?
  • RQ2Why does SAM generalize better than SGD in non-smooth, nonlinear neural networks, especially with label noise?
  • RQ3What role does the signal strength $\|\bm{\mu}\|_2$ play in determining the generalization performance of SAM and SGD?
  • RQ4How does SAM prevent noise learning in the early stages of training, enabling better feature learning?
  • RQ5Is there a phase transition in generalization error between SGD and SAM based on signal-to-noise ratio?

Key findings

  • For SGD, when $\|\bm{\mu}\|_2 \leq O(d^{1/4})$, the test error is at least $p + 0.1$, indicating harmful overfitting.
  • For SGD, when $\|\bm{\mu}\|_2 \geq \Omega(d^{1/4})$, the test error is bounded by $p + \epsilon$, indicating benign overfitting.
  • For SAM, with $\|\bm{\mu}\|_2 \geq \widetilde{\Omega}(1)$, the test error is bounded by $p + \epsilon$, ensuring benign overfitting even when SGD fails.
  • SAM effectively prevents noise learning in early training stages, enabling more efficient feature learning compared to SGD.
  • The paper establishes a formal phase transition in generalization performance, with SAM outperforming SGD in the low-signal regime where SGD fails.
  • The theoretical analysis confirms that SAM's success is not due to Hessian-based smoothness assumptions, making it applicable to non-smooth ReLU networks.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.