Introduction
Sharpness-Aware Minimization (SAM) has emerged as a powerful technique for improving the generalization of deep neural networks. By seeking "flat" minima in the loss landscape rather than just the lowest point, SAM helps models perform better on unseen data. However, SAM's effectiveness is constrained by its high sensitivity to two critical hyperparameters: the perturbation radius ($\rho$) and the learning rate ($\eta$). Finding the optimal values for these parameters typically requires exhaustive and computationally expensive grid searches.
This paper introduces LightSAM, a parameter-agnostic variant designed to eliminate the need for manual hyperparameter tuning. By integrating adaptive optimizers into both the perturbation and update steps, LightSAM ensures reliable convergence and superior performance across diverse tasks without the need for problem-specific constant tuning.
The LightSAM Approach
The core innovation of LightSAM is the use of adaptive optimizers (such as AdaGrad and Adam) for both the weight perturbation and the final model update. In standard SAM, Stochastic Gradient Descent (SGD) is typically used for both steps. LightSAM replaces this with a dual-adaptive mechanism:
- Adaptive Perturbation Radius: The radius $\rho$ dynamically adjusts based on historical gradients.
- Adaptive Learning Rate: The update step $\eta$ is similarly scaled by gradient information.
The authors propose three specific variants: LightSAM-I (using AdaGrad-Norm), LightSAM-II (using coordinate-wise AdaGrad), and LightSAM-III (using Adam). This comprehensive adaptivity distinguishes LightSAM from previous attempts like AdaSAM, which only applied adaptivity to the final update step.
Beyond empirical design, the authors provide a rigorous theoretical foundation. They prove that LightSAM converges at a rate of $O(\ln T / T^{1/4})$ without requiring the unrealistic "bounded gradient" assumption common in prior literature. This theoretical guarantee holds for any choice of $\rho$ and $\eta > 0$, confirming the algorithm's parameter-agnostic nature.
Experimental Results
LightSAM was evaluated across standard benchmarks in computer vision (MNIST, ImageNet-1k) and natural language processing (GLUE).
Vision Tasks
On ImageNet-1k, LightSAM was used to fine-tune Vision Transformer (ViT) models. As shown in the table below, LightSAM consistently outperformed both standard optimizers (SGD, Adam) and existing SAM variants. For instance, LightSAM achieved an accuracy of 78.09% on ViT-Small, surpassing standard Adam (77.10%) and SAM (74.27%).
Robustness to Hyperparameters
A key highlight of the study is LightSAM's insensitivity to hyperparameter scaling. In tests where $\rho$ and $\eta$ were scaled by factors of 0.5x to 2x, standard SAM and ASAM often failed to converge. In contrast, LightSAM remained stable across all nine tested configurations, maintaining a tight accuracy range of 77.76% ± 0.38 on the ViT-Small model.
Language Tasks
When fine-tuning the RoBERTa model on the GLUE benchmark, LightSAM achieved the highest average score of 87.23 across eight tasks, demonstrating its versatility beyond image classification.
Conclusion
LightSAM effectively addresses the primary bottleneck of Sharpness-Aware Minimization: hyperparameter sensitivity. By making both the perturbation and update steps adaptive, it provides a robust, "plug-and-play" optimizer that matches or exceeds the performance of carefully tuned SAM variants. While LightSAM still requires two gradient computations per step, the significant reduction in total training time—achieved by eliminating the need for hyperparameter sweeps—makes it a highly practical choice for training modern, over-parameterized models.
Summary updated