Convergence of Sharpness-Aware Minimization Algorithms using Increasing Batch Size and Decaying Learning Rate

Hinata Harada, Hideaki Iiduka · DOI

Introduction

Training deep neural networks (DNNs) involves navigating complex loss landscapes to find parameter configurations that minimize loss. However, achieving low training loss does not guarantee good generalization. Research suggests that models residing in "flat" minima—regions where the loss changes slowly with respect to parameter perturbations—tend to generalize better than those in "sharp" minima. Sharpness-Aware Minimization (SAM) was introduced to explicitly seek these flatter regions. Despite its empirical success, the theoretical understanding of SAM under dynamic training schedules, such as increasing batch sizes or decaying learning rates, has been limited. This paper provides the first theoretical convergence guarantees for SAM variants using these practical heuristics.

Methodology: Gap-Guided SAM (GSAM)

The authors focus on Gap-Guided SAM (GSAM), a variant that utilizes a "surrogate gap" to navigate the loss landscape more effectively than standard SAM. The study investigates GSAM under two primary training regimes:

  1. Increasing Batch Size: The learning rate remains constant while the number of samples per mini-batch ($b_t$) is gradually increased.
  2. Decaying Learning Rate: The batch size remains constant while the learning rate ($\eta_t$) is reduced over time, typically using schedules like Cosine Annealing or Linear Decay.

These strategies aim to balance the exploration of the loss landscape with the precision required to settle into a stable, flat minimum.

Theoretical Analysis

A key contribution of this work is the formalization of "search direction noise"—the discrepancy between the GSAM update path and the ideal Gradient Descent path. The researchers prove that by either increasing the batch size or decreasing the learning rate, this noise is suppressed at a rate of $\Theta(\sqrt{\eta_t / b_t})$, allowing the algorithm to converge to an $\epsilon$-optimal solution.

Comparison of convergence rates and hyperparameter settings for various SAM-based algorithms, highlighting the proposed GSAM variants with dynamic schedules.

As shown in the table above, the proposed GSAM variants (rows 7 and 8) achieve convergence bounds comparable to or better than existing methods while utilizing dynamic schedules that are more aligned with practical training pipelines. This theoretical validation also supports the empirical "linear scaling rule," which suggests that doubling the batch size is roughly equivalent to halving the learning rate in terms of their impact on convergence.

Experimental Results

The theoretical findings were validated through extensive experiments on the CIFAR-100 dataset using Wide-ResNet-28-10, ResNet-18, and ViT-Tiny architectures.

Generalization and Sharpness

On the Wide-ResNet-28-10 model, SAM with an increasing batch size (SAM+B) achieved a test error of 21.10%, a significant improvement over standard SAM (24.78%) and standard SGD (25.62%). Crucially, the sharpness metric for SAM+B was measured at 10.99, compared to 456.20 for standard SAM, confirming that dynamic batch scheduling is highly effective at locating flatter minima.

Performance on Transformers

The benefits extended to non-convolutional architectures as well. For the ViT-Tiny model, employing a Cosine Annealing learning rate with Adam (Adam+C) reduced the test error from 31.62% to 27.06%. These results demonstrate that dynamic schedules allow models to explore the landscape broadly in early stages and refine their position in flat regions as training progresses.

Conclusion

This research bridges the gap between the practical success of dynamic training schedules and the theoretical foundations of sharpness-aware optimization. By proving that increasing batch sizes and decaying learning rates mathematically "steer" models toward flatter minima, the authors provide a robust framework for improving the generalization of deep learning models. While the computational cost of SAM remains a challenge, these findings offer a clear path for optimizing training stability and performance across diverse architectures.

Summary updated

BibTeX
@misc{harada2024convergence,
  author = {Hinata Harada and Hideaki Iiduka},
  title = {{Convergence of Sharpness-Aware Minimization Algorithms using Increasing Batch Size and Decaying Learning Rate}},
  year = {2024},
  eprint = {2409.09984},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2409.09984},
}
Figure