TLDR: ARSAM (Adaptively sampling-Reusing-mixing decomposed gradients to significantly accelerate SAM) is a novel optimization method that speeds up Sharpness-Aware Minimization (SAM) by approximately 40% without sacrificing model generalization. It achieves this by decomposing SAM’s gradient into an SGD gradient and a Projection of the Second-order gradient onto the First-order gradient (PSF). ARSAM adaptively samples and reuses the PSF based on its dynamic contribution during training, making SAM more efficient and broadly applicable across various deep learning tasks like image classification, human pose estimation, semantic segmentation, and model quantization, even showing improved robustness to noisy labels.
Deep learning models have achieved remarkable success across various fields, largely due to their ability to generalize well to new, unseen data. A key factor in this generalization is the concept of ‘flat minima’ in the loss landscape, where the model’s performance remains stable even with slight changes in its parameters. Sharpness-Aware Minimization (SAM) is a powerful optimization technique designed to help models find these flat minima, thereby significantly improving their generalization capabilities. However, SAM comes with a notable drawback: it typically doubles the computational cost compared to standard Stochastic Gradient Descent (SGD) because it requires twice the gradient calculations per optimization step.
A recent research paper, “Adaptively Sampling-Reusing-Mixing Decomposed Gradients to Speed Up Sharpness Aware Minimization”, introduces a novel approach called ARSAM (Adaptively sampling-Reusing-mixing decomposed gradients to significantly accelerate SAM) that aims to mitigate this computational burden without sacrificing SAM’s generalization benefits. Authored by Jiaxin Deng and Junbiao Pang, ARSAM offers a significant speedup, making SAM more practical for a wider range of applications.
The Core Discovery: Decomposing SAM’s Gradient
The foundation of ARSAM lies in a crucial discovery: SAM’s gradient can be broken down into two distinct components. The first is the familiar SGD gradient, which guides the model towards a local minimum. The second, and more novel, is the Projection of the Second-order gradient onto the First-order gradient (PSF). The PSF is identified as the component specifically responsible for guiding SAM towards a flat minimum.
The researchers observed that both the SGD gradient and the PSF dynamically change throughout the training process. Importantly, the role of the PSF becomes increasingly significant in the later stages of training, as the model refines its search for a flatter minimum. This dynamic behavior inspired the adaptive strategy behind ARSAM.
How ARSAM Works: Adaptive Sampling, Reusing, and Mixing
ARSAM leverages these insights by adaptively sampling, reusing, and mixing the decomposed gradients. Instead of computing the full SAM gradient (which involves two forward and backward passes) at every iteration, ARSAM intelligently decides when to compute the PSF and when to reuse a previously computed PSF. This decision is based on an indicator that measures the contribution of the PSF relative to the SGD gradient.
Specifically, ARSAM uses the ratio of the L2-norm of the PSF to the L2-norm of the SGD gradient as an indicator. An autoregressive model then uses this indicator to adjust the sampling frequency of the PSF. When the PSF’s contribution is less critical, ARSAM reuses a historical PSF, thereby saving computational resources. When the PSF’s role becomes more pronounced, ARSAM increases its computation frequency to ensure the model continues to find flat minima and maintain generalization.
This adaptive strategy means that in iterations where the PSF is not explicitly computed, the model updates its weights using the current SGD gradient combined with a reused PSF from a previous iteration. This ‘mixing’ of timely updated SGD gradients and reused PSFs is key to ARSAM’s efficiency and effectiveness.
Impressive Results Across Diverse Applications
Extensive experiments demonstrate ARSAM’s capabilities. On standard image classification benchmarks like CIFAR-10 and CIFAR-100, ARSAM achieves accuracies comparable to SAM while providing a speedup of approximately 40%. This means models can be trained significantly faster without compromising their generalization ability.
Beyond classification, ARSAM’s practicality extends to various challenging tasks:
- Human Pose Estimation: When applied to human pose estimation, ARSAM maintains performance similar to SAM while reducing training time.
- Semantic Segmentation: In semantic segmentation tasks, ARSAM achieves competitive accuracy and improves optimization speed by about 30% compared to SAM.
- Model Quantization: For quantization-aware training, ARSAM delivers comparable performance to SAM with roughly 50% faster training speeds.
- Robustness to Label Noise: ARSAM also shows superior robustness in scenarios with high label noise, outperforming both SGD and SAM by efficiently identifying local minima with clean samples early on and then transitioning to SAM for flatter minima later.
Compared to other efficient SAM variants like LookSAM, AE-SAM, SAF, and MESA, ARSAM often outperforms them in terms of accuracy while still offering substantial speed improvements. The adaptive nature of ARSAM, which considers the dynamic importance of the PSF, allows it to schedule computations more effectively, ensuring generalization is preserved.
Also Read:
- Unlocking Efficient Spiking Neural Network Training with SADP
- Optimizing Deep Neural Network Quantization for Efficiency
Looking Ahead
The introduction of ARSAM marks a significant step forward in making Sharpness-Aware Minimization more accessible and efficient for deep learning practitioners. By intelligently decomposing and adaptively reusing gradient components, ARSAM provides a powerful tool for achieving state-of-the-art generalization performance with a substantial reduction in training time. Future research aims to further refine the control over the acceleration ratio and explore the intriguing instances where ARSAM even surpasses SAM in accuracy, suggesting that the reuse of PSF might sometimes lead to even flatter regions in the loss landscape.


