Tilted Sharpness-Aware Minimization

Tian Li, Tianyi Zhou, Jeff Bilmes

TL;DR

Tilted Sharpness-Aware Minimization (TSAM) is a smoothed generalization of the popular SAM optimizer that uses "exponential tilting" to find flatter, more generalizable minima. By reweighting multiple high-loss regions in a neighborhood rather than focusing solely on the single worst-case point, TSAM achieves superior performance and smoother optimization across a wide range of vision and language tasks.

What Problem Does This Paper Address?

In deep learning, we often find that models with the same training accuracy perform very differently on new data. This is usually because some models land in "sharp" minima (where the loss changes rapidly with small parameter tweaks), while others land in "flat" minima (where the loss stays low in a local neighborhood). Flat minima are widely believed to generalize better.

Sharpness-Aware Minimization (SAM) was designed to find these flat regions by solving a min-max problem: it tries to minimize the maximum loss within a small radius $\rho$ of the current parameters. However, SAM has two major drawbacks:

  1. Optimization Difficulty: The min-max formulation is non-smooth and non-convex, making it computationally challenging and hard to optimize.
  2. Winner-Takes-All: SAM focuses exclusively on the single worst-case perturbation. It ignores other nearby regions that might also have high loss, potentially missing a more holistic picture of the local landscape's sharpness.

Methods

The authors introduce Tilted SAM (TSAM), which replaces the "max" operator in SAM with a "soft-max" style aggregation inspired by exponential tilting.

The TSAM objective is defined as: $$L^t(\theta) := \frac{1}{t} \log \mathbb{E}_{\epsilon} [e^{tL(\theta+\epsilon)}]$$

Comparison of loss landscapes between standard ERM and TSAM with varying tilt parameters ($t$). The orange line represents the smoothed objective, guiding the optimizer to flatter minima (green star).

Key Components:

  • The Tilt Parameter ($t$): This hyperparameter controls the "aggression" of the reweighting. When $t \to 0$, TSAM behaves like standard random smoothing (average loss). As $t \to \infty$, it converges to the original SAM (maximum loss). As shown in the figure above, varying $t$ smoothly alters the optimization landscape.
  • Smoothing: Mathematically, TSAM is smoother than SAM. This makes it more amenable to standard gradient-based optimization.
  • Hamiltonian Dynamics Sampler: To solve this objective, the authors developed an efficient sampling algorithm motivated by Hamiltonian Monte Carlo (HMC). Instead of just doing one step of gradient ascent (like SAM), they use a physics-inspired discretization to sample several perturbations ($\epsilon$) that represent high-loss regions.

Datasets

The authors evaluated TSAM across diverse benchmarks to prove its versatility:

  • Image Classification: CIFAR100 (including a version with 20% label noise), TinyImagenet, and the Describable Texture Dataset (DTD).
  • Natural Language Processing: The GLUE benchmark (including tasks like CoLA, SST-2, MNLI, and QNLI) using a pretrained DistilBERT model.
  • Architectures: They tested on standard CNNs (ResNet18, WideResNet) and Vision Transformers (ViT).

Key Insights and Ideas

  • Soft vs. Hard Max: By considering a weighted average of high-loss neighbors rather than just the single worst one, TSAM "sees" more of the local landscape. This prevents the optimizer from being distracted by a single sharp spike while ignoring a generally "rugged" area.
  • The "Aha" Moment on Smoothness: The paper proves that the smoothness of the TSAM objective scales linearly with $t$. This provides a theoretical justification for why TSAM is easier to optimize than the non-smooth SAM.
  • Flatness Verification: The authors didn't just look at accuracy; they measured the Hessian eigenvalues (a mathematical measure of curvature). TSAM solutions consistently showed smaller top eigenvalues than SAM, confirming they had indeed found flatter ground.

Key Results

TSAM consistently outperformed ERM (standard training), SAM, and several advanced SAM variants (like PGN and RSAM):

  • CIFAR100: TSAM achieved 77.78% accuracy on ResNet18, compared to 76.52% for SAM and 71.39% for standard ERM.
  • Robustness to Noise: In the "Noisy CIFAR100" task, TSAM maintained a significant lead (69.98% vs SAM's 69.00%), suggesting it is more robust to corrupted data.
  • NLP Performance: On the GLUE benchmark, TSAM achieved the highest average score (78.01) across all tested objectives.
  • Efficiency: Surprisingly, TSAM only needs a small number of samples ($s=3$ or $5$) to achieve these gains, making it practical for real-world training pipelines.

Limitations and Future Work

  • Computational Cost: While more efficient than some variants, TSAM still requires more gradient evaluations per iteration than standard SGD or vanilla SAM.
  • Hyperparameter Tuning: The tilt parameter $t$ adds another knob to turn. While the authors found a range of $t$ (e.g., 1 to 20) that works well, it still requires validation.
  • Integration with Adaptive Optimizers: The current study focused on standard SGD-style updates. The authors noted that combining TSAM with adaptive methods like Adam or Lion is a promising direction for future research.
  • HMC Complexity: The sampler uses a simplified Euler discretization; exploring more sophisticated HMC techniques might yield even better perturbations at the cost of complexity.

Summary updated

BibTeX
@inproceedings{li2025tilted,
  author = {Tian Li and Tianyi Zhou and Jeff Bilmes},
  title = {{Tilted Sharpness-Aware Minimization}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=bwfiFv8KG2},
}
Figure