No More Adam: Learning Rate Scaling at Initialization is All You Need
Abstract
In this work, we question the necessity of adaptive gradient methods for training deep neural networks. SGD-SaI is a simple yet effective enhancement to stochastic gradient descent with momentum (SGDM). SGD-SaI performs learning rate Scaling at Initialization (SaI) to distinct parameter groups, guided by their respective gradient signal-to-noise ratios (g-SNR). By adjusting learning rates without relying on adaptive second-order momentum, SGD-SaI helps prevent training imbalances from the very first iteration and cuts the optimizer's memory usage by half compared to AdamW. Despite its simplicity and efficiency, SGD-SaI consistently matches or outperforms AdamW in training a variety of Transformer-based tasks, effectively overcoming a long-standing challenge of using SGD for training Transformers. SGD-SaI excels in ImageNet-1K classification with Vision Transformers(ViT) and GPT-2 pretraining for large language models (LLMs, transformer decoder-only), demonstrating robustness to hyperparameter variations and practicality for diverse applications. We further tested its robustness on tasks like LoRA fine-tuning for LLMs and diffusion models, where it consistently outperforms state-of-the-art optimizers. From a memory efficiency perspective, SGD-SaI achieves substantial memory savings for optimizer states, reducing memory usage by 5.93 GB for GPT-2 (1.5B parameters) and 25.15 GB for Llama2-7B compared to AdamW in full-precision training settings.
Community
You can access this optimizer and adopt it into your training pipeline:
https://github.com/AnonymousAlethiometer/SGD_SaI
A quick takeaway for learning rate choice is approximately 6-10x the previous AdamW, providing good convergence speed and a better final solution; a small learning rate might take longer to converge. As inherited from SGD, more extended training might bring better results.
This is an automated message from the Librarian Bot. I found the following papers similar to this paper.
The following papers were recommended by the Semantic Scholar API
- COAP: Memory-Efficient Training with Correlation-Aware Gradient Projection (2024)
- SMMF: Square-Matricized Momentum Factorization for Memory-Efficient Optimization (2024)
- CaAdam: Improving Adam optimizer using connection aware methods (2024)
- SWAN: Preprocessing SGD Enables Adam-Level Performance On LLM Training With Significant Memory Reduction (2024)
- COAT: Compressing Optimizer states and Activation for Memory-Efficient FP8 Training (2024)
- APOLLO: SGD-like Memory, AdamW-level Performance (2024)
- Natural GaLore: Accelerating GaLore for memory-efficient LLM Training and Fine-tuning (2024)
Please give a thumbs up to this comment if you found it helpful!
If you want recommendations for any Paper on Hugging Face checkout this Space
You can directly ask Librarian Bot for paper recommendations by tagging it in a comment:
@librarian-bot
recommend
Models citing this paper 0
No model linking this paper
Datasets citing this paper 0
No dataset linking this paper
Spaces citing this paper 0
No Space linking this paper