Abstract
Sharpness-Aware Minimization (SAM) has emerged as a powerful technique for improving the generalization of deep neural networks by seeking flatter minima in the loss landscape. However, its effectiveness is highly sensitive to a manually tuned hyperparameter: the perturbation radius ($\rho$). This paper introduces LETS (LEarning the perTurbation radiuS), a bilevel optimization framework that automates the selection of $\rho$ during training. By minimizing a squared generalization gap, LETS consistently finds optimal radii across diverse architectures and tasks, eliminating the need for expensive grid searches while achieving state-of-the-art performance in both computer vision and natural language processing.
Introduction: The Challenge of Flat Minima
In deep learning, the geometry of the loss landscape is a critical indicator of a model's ability to generalize. "Sharp" minima—regions where the loss increases sharply with minor parameter perturbations—are often associated with overfitting. Conversely, "flat" minima tend to generalize better to unseen data.
Sharpness-Aware Minimization (SAM) explicitly targets these flat regions by minimizing the maximum loss within a neighborhood of radius $\rho$ around the current parameters. While effective, SAM introduces a significant bottleneck: the "Goldilocks" problem of $\rho$. As shown in Figure 1, the performance of SAM and its variants like ASAM is highly dependent on the choice of $\rho$. If $\rho$ is too small, the regularization effect is negligible; if too large, the optimization may fail to converge to a good local optimum.
Currently, practitioners rely on exhaustive grid searches to find the optimal $\rho$ for every new dataset or architecture, a process that is both computationally expensive and inefficient.
Methodology: Learning the Radius (LETS)
The authors propose LETS (LEarning the perTurbation radiuS) to transform $\rho$ from a static hyperparameter into a learnable parameter. LETS formulates this as a bilevel optimization problem:
- Lower-Level Optimization: The model parameters $\theta$ are updated to minimize the SAM objective given a current $\rho$.
- Upper-Level Optimization: The radius $\rho$ is updated to minimize a meta-objective. The authors found that minimizing the squared generalization gap—the difference between validation loss and training loss—provides the most stable and effective signal for learning $\rho$.
To ensure computational feasibility, LETS employs a first-order approximation of the Hessian matrix. This allows the update of $\rho$ to occur with minimal overhead, maintaining a convergence rate comparable to standard SAM. LETS is designed as a modular component that can be integrated with various SAM derivatives, such as Adaptive SAM (ASAM).
Experimental Results
The LETS framework was evaluated across a wide range of benchmarks, including CIFAR-10/100, ImageNet, and the GLUE benchmark for NLP.
Performance Across Architectures
As summarized in the table below, LETS-SAM and LETS-ASAM consistently outperform their base counterparts and other efficient SAM variants (like GSAM or ESAM) across multiple architectures, including ResNet, WideResNet, and Vision Transformers (ViT).
Key Findings
- Robustness to Initialization: LETS is remarkably insensitive to the initial value of $\rho$. Regardless of the starting point, the algorithm converges to an optimal radius, effectively automating the tuning process.
- Landscape Flattening: Empirical visualizations confirm that LETS-SAM results in significantly flatter loss landscapes than standard SAM, directly correlating with its improved generalization.
- Noise Tolerance: In experiments with label noise, LETS demonstrated superior robustness, maintaining high accuracy even when a significant portion of the training labels were corrupted.
Conclusion
LETS addresses a fundamental limitation of Sharpness-Aware Minimization by automating the search for the optimal perturbation radius. By leveraging a bilevel optimization approach focused on the generalization gap, LETS provides a "plug-and-play" solution that improves model performance while reducing the computational burden of hyperparameter tuning. Its success across diverse domains—from computer vision to machine translation—positions it as a robust tool for training more generalizable deep learning models.
Summary updated