Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

Towards Efficient and Scalable Sharpness-Aware Minimization

About

Recently, Sharpness-Aware Minimization (SAM), which connects the geometry of the loss landscape and generalization, has demonstrated significant performance boosts on training large-scale models such as vision transformers. However, the update rule of SAM requires two sequential (non-parallelizable) gradient computations at each step, which can double the computational overhead. In this paper, we propose a novel algorithm LookSAM - that only periodically calculates the inner gradient ascent, to significantly reduce the additional training cost of SAM. The empirical results illustrate that LookSAM achieves similar accuracy gains to SAM while being tremendously faster - it enjoys comparable computational complexity with first-order optimizers such as SGD or Adam. To further evaluate the performance and scalability of LookSAM, we incorporate a layer-wise modification and perform experiments in the large-batch training scenario, which is more prone to converge to sharp local minima. We are the first to successfully scale up the batch size when training Vision Transformers (ViTs). With a 64k batch size, we are able to train ViTs from scratch in minutes while maintaining competitive performance.

Yong Liu, Siqi Mai, Xiangning Chen, Cho-Jui Hsieh, Yang You• 2022

Related benchmarks

TaskDatasetResultRank
Mathematical ReasoningGSM8K
Accuracy58.55
1398
Image ClassificationCIFAR-10 (test)
Accuracy93.31
882
Image ClassificationCIFAR-100 (test)
Accuracy79.3
295
Image ClassificationCIFAR-10-C
Accuracy60.41
179
DialogueMT-Bench
MT-Bench Score5.94
41
Instruction FollowingBBH--
40
Code GenerationHumanEval
Pass@125.28
36
Instruction FollowingDROP
DROP Score50.34
20
Instruction FollowingMMLU
MMLU Accuracy63.45
20
Node ClassificationCoraFull (train val test)
Accuracy68.38
18
Showing 10 of 16 rows

Other info

Follow for update