TL;DR
This paper provides the first theoretical convergence guarantee for AdaSAM, an optimization algorithm that combines Sharpness-Aware Minimization (SAM) with adaptive learning rates and momentum acceleration. The authors prove that AdaSAM achieves a non-trivial $\mathcal{O}(1/\sqrt{bT})$ convergence rate in stochastic non-convex settings and exhibits a linear speedup property with respect to mini-batch size, matching its strong empirical performance on NLP benchmarks.
What Problem Does This Paper Address?
Deep learning models often suffer from generalization gaps where excellent training performance doesn't translate to test data. Sharpness-Aware Minimization (SAM) addresses this by actively seeking out "flat" minima in the loss landscape rather than just low-loss minima. However, SAM comes with two major pain points: it doubles the computational cost per iteration (requiring two forward/backward passes) and introduces tedious hyperparameter tuning, particularly when balancing the learning rate and the perturbation radius.
To ease tuning, practitioners frequently combine SAM with adaptive learning rate methods (like Adam or AMSGrad) and momentum—a combination colloquially termed AdaSAM. While empirically successful, AdaSAM lacked theoretical convergence guarantees. Mathematically proving that it works is incredibly difficult because three distinct optimization mechanisms—the gradient perturbation step, the history-based adaptive learning rate, and the momentum step—are tightly coupled and dependent on one another. This paper breaks that theoretical deadlock.
Methods
The authors analyze the convergence of AdaSAM under a stochastic, non-convex setting. To overcome the mathematical challenge of the three coupled steps, they introduce two clever proof techniques:
- Delayed Second-Order Momentum: To decouple the adaptive learning rate from the current SAM gradient step, they utilize a delayed second-order momentum term from the previous iteration. This makes the terms independent when taking mathematical expectations, making the analysis tractable.
- Auxiliary Sequence: To handle the extra error terms introduced by momentum acceleration, they introduce an auxiliary sequence $z_t = x_t + \frac{\beta_1}{1-\beta_1}(x_t - x_{t-1})$ to absorb the momentum effects and prove that the total accumulated error across all iterations remains bounded.
The complete algorithmic framework of AdaSAM is outlined below:
Datasets
The authors evaluated AdaSAM by fine-tuning a pre-trained RoBERTa-large model on the GLUE (General Language Understanding Evaluation) benchmark. This benchmark covers a diverse set of natural language processing (NLP) tasks:
- Sentence-level & Similarity Tasks: CoLA, SST-2, STS-B, MRPC
- Inference & Question Answering Tasks: RTE, MNLI, QNLI, QQP
Key Insights and Ideas
- Linear Speedup is Preserved: The authors prove that AdaSAM enjoys a mini-batch linear speedup property. If you scale up the mini-batch size $b$ by a factor of $k$, the number of iterations $T$ required to reach a stationary point scales down by $k$. This makes AdaSAM highly attractive for large-scale distributed training.
- Bounded Adaptivity: The proof relies on showing that the adaptive learning rate estimation ($\eta_t$) stays within a strictly limited range, preventing the optimizer from diverging due to noisy gradient perturbations.
Key Results
- Theoretical Convergence: The paper establishes a convergence rate of $\mathcal{O}(1/\sqrt{bT})$ for AdaSAM in non-convex optimization.
- Empirical Superiority on GLUE: AdaSAM consistently outperformed standard SGD, standard SAM, and AMSGrad. As shown in Table I, AdaSAM achieved the highest score on 6 out of 8 GLUE tasks, improving the average score over AMSGrad by 0.28 points.
- Linear Speedup Verification: The authors empirically validated their linear speedup theory by testing batch sizes of 4, 8, 16, and 32. As the batch size increased, the training loss dropped significantly faster, with a batch size of 32 requiring roughly half the iterations of a batch size of 16 to reach similar loss levels.
Limitations and Future Work
While this work bridges the gap between theory and practice for adaptive SAM methods, two main challenges remain:
- Computational Overhead: AdaSAM still inherits SAM's core drawback—it requires two gradient computations per iteration, making it twice as expensive as standard Adam/AMSGrad per step.
- Distributed Scaling: Although the linear speedup property hints at excellent distributed scaling, the authors note that explicitly extending and evaluating AdaSAM within distributed architectures (like Parameter-Server frameworks) remains an objective for future work.
Summary updated