How to Fine-Tune Vision Models with SGD
Ananya Kumar, Ruoqi Shen, Sébastien Bubeck, Suriya Gunasekar
摘要
SGD and AdamW are the two most used optimizers for fine-tuning large neural networks in computer vision. When the two methods perform the same, SGD is preferable because it uses less memory (12 bytes/parameter with momentum and 8 bytes/parameter without) than AdamW (16 bytes/parameter). However, on a suite of downstream tasks, especially those with distribution shifts, we find that fine-tuning with AdamW performs substantially better than SGD on modern Vision Transformer and ConvNeXt models. We find that large gaps in performance between SGD and AdamW occur when the fine-tuning gradients in the first "embedding" layer are much larger than in the rest of the model. Our analysis suggests an easy fix that works consistently across datasets and models: freezing the embedding layer (less than 1% of the parameters) leads to SGD with or without momentum performing slightly better than AdamW while using less memory (e.g., on ViT-L, SGD uses ∼ 33% less GPU memory). Our insights result in state-ofthe-art accuracies on five popular distribution shift benchmarks: WILDS-FMoW, WILDS-Camelyon, BREEDS-Living-17, Waterbirds, and DomainNet.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 12 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Emerging Properties in Self-Supervised Vision Transformers 引用了 A Simple Framework for Contrastive Learning of Visual Representations
- Emerging Properties in Self-Supervised Vision Transformers 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Surgical Fine-Tuning Improves Adaptation to Distribution Shifts 引用了 Learning Transferable Visual Models From Natural Language Supervision
- Out-of-Domain Robustness via Targeted Augmentations 引用了 Learning Transferable Visual Models From Natural Language Supervision
- An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale 引用了 A Simple Framework for Contrastive Learning of Visual Representations
- Swin Transformer: Hierarchical Vision Transformer using Shifted Windows 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Swin Transformer: Hierarchical Vision Transformer using Shifted Windows 引用了 Learning Transferable Visual Models From Natural Language Supervision
- On the Implicit Bias of Adam 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Learning Transferable Visual Models From Natural Language Supervision 引用了 A Simple Framework for Contrastive Learning of Visual Representations
- Learning Transferable Visual Models From Natural Language Supervision 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Task-Specific Skill Localization in Fine-tuned Language Models 引用了 Surgical Fine-Tuning Improves Adaptation to Distribution Shifts
引用它的顶会 Paper12
- Task-Specific Skill Localization in Fine-tuned Language ModelsAbhishek Panigrahi, Nikunj Saunshi, Haoyu Zhao, Sanjeev AroraICML 2023 · 100 次引用
- Surgical Fine-Tuning Improves Adaptation to Distribution ShiftsYoonho Lee, Annie S. Chen, Fahim Tajwar, Ananya Kumar 等ICLR 2023 · 47 次引用
- Out-of-Domain Robustness via Targeted AugmentationsIrena Gao, Shiori Sagawa, Pang Wei Koh, Tatsunori Hashimoto 等ICML 2023 · 33 次引用
- On the Implicit Bias of AdamMatias D. Cattaneo, Jason M. Klusowski, Boris ShigidaICML 2024 · 26 次引用
- Trainable Transformer in TransformerAbhishek Panigrahi, Sadhika Malladi, Mengzhou Xia, Sanjeev AroraICML 2024 · 16 次引用
它引用的 Paper20
- Learning Transferable Visual Models From Natural Language SupervisionAlec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh 等ICML 2021 · 47,906 次引用
- Swin Transformer: Hierarchical Vision Transformer using Shifted WindowsZe Liu, Yutong Lin, Yue Cao, Han Hu 等ICCV 2021 · 31,683 次引用
- A Simple Framework for Contrastive Learning of Visual RepresentationsTing Chen, Simon Kornblith, Mohammad Norouzi, Geoffrey E. HintonICML 2020 · 24,064 次引用
- An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn 等ICLR 2021 · 21,477 次引用
- Emerging Properties in Self-Supervised Vision TransformersMathilde Caron, Hugo Touvron, Ishan Misra, Hervé Jégou 等ICCV 2021 · 8,921 次引用
相关 Paper
- Do We Need Adam? Surprisingly Strong and Sparse Reinforcement Learning with SGD in LLMsSagnik Mukherjee, Lifan Yuan, Pavan Jayasinha, Dilek Hakkani-Tür 等ICML 2026 · 4 次引用
- Early Convolutions Help Transformers See BetterTete Xiao, Mannat Singh, Eric Mintun, Trevor Darrell 等NeurIPS 2021 · 974 次引用
- EfficientFSL: Enhancing Few-Shot Classification via Query-Only Tuning In Vision TransformersWenwen Liao, Hang Ruan, Jianbo Yu, Bing Song 等AAAI 2026
- AdaLomo: Low-memory Optimization with Adaptive Learning RateKai Lv, Hang Yan, Qipeng Guo, Haijun Lv 等ACL Findings 2024 · 9 次引用
- Fine-tuning Image Transformers using Learnable MemoryMark Sandler, Andrey Zhmoginov, Max Vladymyrov, Andrew JacksonCVPR 2022 · 51 次引用
