Efficient Sharpness-Aware Minimization for Molecular Graph Transformer Models

Yili Wang, Kai-ya Zhou, Ninghao Liu, Ying Wang, Xin Wang
2/12/2026

No official code found. Best implementation: YL-wang/GraphSAM (6 stars, last commit 2024-02-16).

Abstract

Sharpness-aware minimization (SAM) has received increasing attention in computer vision since it can effectively eliminate the sharp local minima from the training trajectory and mitigate generalization degradation. However, SAM requires two sequential gradient computations during the optimization of each step: one to obtain the perturbation gradient and the other to obtain the updating gradient. Compared with the base optimizer (e.g., Adam), SAM doubles the time overhead due to the additional perturbation gradient. By dissecting the theory of SAM and observing the training gradient of the molecular graph transformer, we propose a new algorithm named GraphSAM, which reduces the training cost of SAM and improves the generalization performance of graph transformer models. There are two key factors that contribute to this result: (i) \textit{gradient approximation}: we use the updating gradient of the previous step to approximate the perturbation gradient at the intermediate steps smoothly (\textbf{increases efficiency}); (ii) \textit{loss landscape approximation}: we theoretically prove that the loss landscape of GraphSAM is limited to a small range centered on the expected loss of SAM (\textbf{guarantees generalization performance}). The extensive experiments on six datasets with different tasks demonstrate the superiority of GraphSAM, especially in optimizing the model update process. The code is in:https://github.com/YL-wang/GraphSAM/tree/graphsam

View on arXivView PDF

Code Implementations(1)

YL-wang/GraphSAMCommunity100%

[ICLR'24] Efficient Sharpness-Aware Minimization for Molecular Graph Transformer Models

60Python, DockerfileAug 14, 20222 years ago

Similar Papers

Cite this paper

@article{wang2026efficient,
  title  = {Efficient Sharpness-Aware Minimization for Molecular Graph Transformer Models},
  author = {Yili Wang and Kai-ya Zhou and Ninghao Liu and Ying Wang and Xin Wang},
  year   = {2026},
  eprint = {2406.13137},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2406.13137},
  journal = {ICLR 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2406.13137.svg)](https://codeofpaper.com/paper/2406.13137)

Discussion