Reweighting Local Mimina with Tilted SAM

Tian Li, Tianyi Zhou, Jeffrey A. Bilmes · DOI

Abstract

Tilted Sharpness-Aware Minimization (TSAM) is a smoothed generalization of the popular SAM optimizer that uses "exponential tilting" to reweight local neighborhood losses. By considering the entire loss landscape around a minimum rather than just the worst-case point, TSAM finds flatter solutions and achieves superior generalization across a wide range of vision and language tasks.

Introduction

In deep learning, models often converge to "sharp" minima—points where the training loss is zero, but moving just a tiny bit in parameter space causes the loss to spike. These sharp minima usually generalize poorly to new data.

Sharpness-Aware Minimization (SAM) was designed to mitigate this by solving a min-max problem: it looks for parameters where the maximum loss in a small neighborhood is low. However, SAM has two major drawbacks: the min-max objective is often non-smooth and non-convex, making it difficult to optimize, and it focuses exclusively on the single worst-case point in a neighborhood. This "winner-takes-all" approach can be suboptimal for finding truly robust, flat regions.

Methodology

TSAM replaces the "max" operator in SAM with a "tilted" operator based on exponential tilting. This approach uses a hyperparameter $t$ to create a weighted average of losses in a neighborhood.

  • The Spectrum of $t$: When $t \to \infty$, TSAM recovers the original SAM (focusing only on the max). When $t \to 0$, it becomes a simple average of the neighborhood. For values in between, it acts as a "soft-max," prioritizing high-loss regions while still considering the whole neighborhood.
  • Optimization via HMC: To calculate gradients for this complex integral, the authors use a simplified version of Hamiltonian Monte Carlo (HMC). Instead of just one adversarial step, they sample a few perturbations (typically $s=3$ or $5$) and aggregate their gradients using the tilted weights.
Comparison of ERM and TSAM with varying tilt parameters $t$. Higher $t$ values shift the focus towards sharper regions, while TSAM generally finds flatter minima than standard ERM.

Mathematically, TSAM is smoother than SAM, which theoretically makes it easier to optimize using standard gradient descent methods.

Key Insights and Flatness

The authors demonstrate that for small $t$, optimizing TSAM is approximately equivalent to minimizing the mean plus the variance of the loss in a neighborhood. This explicitly forces the optimizer to find regions where the loss is consistently low.

To verify this, the authors calculated the top eigenvalues of the Hessian matrix. TSAM consistently resulted in smaller max eigenvalues than both standard Empirical Risk Minimization (ERM) and SAM, indicating a much "gentler" curvature. Furthermore, TSAM showed significant gains on datasets with label noise; by looking at the whole neighborhood, the optimizer is less likely to be trapped by the sharp, spurious minima created by mislabeled examples.

Experimental Results

The authors evaluated TSAM across diverse benchmarks including CIFAR100, the GLUE benchmark, and various architectures like ResNets and Vision Transformers (ViT).

  • Vision Performance: On CIFAR100 with ResNet18, TSAM achieved 77.78% accuracy, compared to SAM's 76.52% and ERM's 71.39%.
  • NLP Performance: On the GLUE benchmark using DistilBERT, TSAM achieved the highest average score (78.01) compared to SAM (77.56) and ERM (77.15).
  • Efficiency: Even when giving SAM more computation time, TSAM maintained its lead, suggesting the benefit comes from the objective itself rather than just extra sampling.

Conclusion and Future Work

TSAM provides a smoother path to generalization by reweighting local neighborhood losses. While it introduces a tilt parameter $t$ that requires tuning and adds computational overhead due to multi-perturbation sampling, the resulting gains in flatness and robustness are significant. Future work may explore automated tuning of $t$ and further theoretical connections between neighborhood variance and generalization bounds.

Summary updated

BibTeX
@inproceedings{li2025reweighting,
  author = {Tian Li and Tianyi Zhou and Jeffrey A. Bilmes},
  title = {{Reweighting Local Mimina with Tilted SAM}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=bwfiFv8KG2},
}
Figure