Introduction
Fine-tuning Large Language Models (LLMs) often encounters a "memory wall." While a 65B parameter model might fit on consumer-grade GPUs for inference, training typically requires substantial VRAM to store optimizer states (e.g., Adam's momentum and variance) and a full map of gradients. Consequently, researchers often resort to Parameter-Efficient Fine-Tuning (PEFT) methods like LoRA, which update only a fraction of the model. However, PEFT can be less expressive than full-parameter tuning.
Researchers from Fudan University have introduced LOMO (LOw-Memory Optimization), a new optimizer designed to enable full-parameter fine-tuning of massive models like LLaMA-65B on consumer hardware, such as eight RTX 3090 GPUs. LOMO reduces memory overhead to approximately 10.8% of standard industry solutions by fusing gradient computation with parameter updates and replacing Adam with a stabilized version of SGD.
Methodology: Fused Backward Pass
LOMO's primary innovation lies in rethinking the training process to minimize memory footprint through three key strategies:
- Optimizer Simplification: While Adam is standard for training, it triples the memory required for weights by storing two additional values per parameter. LOMO utilizes Stochastic Gradient Descent (SGD), which requires zero extra state memory. The authors argue that for fine-tuning—where the model is already near a solution—SGD is sufficient.
- Fused Backward Pass: In standard training, all gradients are calculated before updating weights, leading to $O(N)$ memory usage. LOMO "fuses" these steps: as soon as a gradient for a specific parameter is calculated during the backward pass, the parameter is updated immediately, and the gradient is discarded. This reduces gradient memory usage to $O(1)$, specifically the size of the largest single parameter tensor.
- Stabilization Techniques: To ensure stability during mixed-precision training (FP16/BF16) with SGD, LOMO incorporates gradient clipping by value and dynamic loss scaling.
Memory Efficiency and Throughput
LOMO pushes training memory requirements down to near-inference levels. For a LLaMA-7B model, LOMO reduced the memory footprint from 102.2 GB (standard AdamW) to just 14.58 GB. This efficiency allowed the team to fine-tune a 65B parameter model on a single machine with 8x RTX 3090 GPUs (24GB VRAM each), a task that previously required enterprise-grade A100 nodes.
Furthermore, LOMO's throughput for a 7B model on a single GPU was 11x higher than AdamW, as it avoids the heavy communication overhead associated with sharding optimizer states across multiple cards.
Performance Evaluation
The researchers evaluated LOMO using the SuperGLUE benchmark (including RTE, BoolQ, WSC, WiC, MultiRC, and COPA) across the LLaMA model family (7B to 65B).
LOMO consistently outperformed LoRA across tasks. For LLaMA-13B, LOMO achieved an average score of 84.2, compared to LoRA’s 81.4 and a Zero-shot baseline of 57.2. These results suggest that full-parameter tuning via LOMO is not only more memory-efficient but also more effective than popular PEFT methods.
Conclusion and Future Work
LOMO democratizes high-level NLP research by making full-parameter fine-tuning accessible to smaller labs with limited hardware resources. While highly effective for fine-tuning, future work is needed to determine if LOMO's SGD-based approach is stable enough for pre-training from scratch. Additionally, the authors suggest that combining LOMO with parameter quantization (e.g., 4-bit or 8-bit) could further push the boundaries of memory efficiency.
Summary updated