Abstract
The memory requirements of standard optimizers like AdamW pose a significant bottleneck for training Large Language Models (LLMs), often necessitating expensive hardware clusters. This paper presents APOLLO (Approximated Gradient Scaling for Memory Efficient LLM Optimization), a novel optimizer that achieves the memory efficiency of SGD while maintaining the performance of AdamW. By utilizing structured, low-rank random projections instead of element-wise variance tracking, APOLLO drastically reduces optimizer state memory. Our results show that APOLLO-Mini can pre-train a LLaMA-7B model on a single 12GB GPU and achieve 3x higher throughput than AdamW on high-end hardware.
Introduction
The primary constraint in scaling LLM training is GPU memory. While model weights are substantial, the optimizer states in AdamW—momentum and variance—effectively triple the memory footprint per parameter. Existing solutions like GaLore reduce this via Singular Value Decomposition (SVD), but introduce significant computational overhead. APOLLO addresses this by replacing SVD with random projections and coarsening the granularity of learning rate adaptation, moving from element-wise to channel-wise or tensor-wise scaling.
Methodology: Approximated Gradient Scaling
APOLLO's core innovation is the use of random Gaussian projections to estimate gradient scaling factors. This approach leverages the Johnson-Lindenstrauss lemma to preserve gradient norm ratios without the heavy compute cost of SVD.
- APOLLO: Projects gradients into a low-rank auxiliary space for channel-wise scaling.
- APOLLO-Mini: A more aggressive variant using a rank-1 projection to compute a single scaling factor per tensor, reducing optimizer memory to nearly zero.
Experimental Results
Empirical evaluations on the C4 dataset and various downstream tasks (MMLU, BoolQ, etc.) demonstrate that APOLLO matches or outperforms AdamW. Notably, APOLLO-Mini's stateless nature introduces beneficial noise that can improve generalization, as seen in its superior performance on zero-shot reasoning tasks. For instance, on a 350M model, APOLLO-Mini achieved an average score of 0.3785, surpassing AdamW's 0.3712.
Efficiency gains are substantial: APOLLO supports 4x larger batch sizes than AdamW on A100 GPUs, translating to a 3x throughput increase. Furthermore, the combination of APOLLO-Mini and INT8 quantization allowed for the first-ever scratch pre-training of a LLaMA-7B model on a consumer-grade 12GB GPU.
Conclusion
APOLLO bridges the gap between the memory efficiency of SGD and the convergence properties of AdamW. By proving that fine-grained element-wise adaptation is not strictly necessary for LLMs, it opens new avenues for training massive models on accessible hardware. Future work will focus on a rigorous theoretical framework for the observed generalization benefits of stateless optimization in LLMs.
Summary updated