TL;DR
AdaRankGrad is a memory-efficient optimization framework that adaptively reduces the rank of gradient updates as Large Language Models (LLMs) converge. By exploiting a formally proven "rank-vanishing" phenomenon—where gradients naturally approach rank one over time—it achieves full-parameter training performance with up to 50% less optimizer memory than state-of-the-art methods like LoRA and GaLore.
What Problem Does This Paper Address?
Training and fine-tuning LLMs is notoriously memory-intensive. While model weights are large, the optimizer states (like the first and second moments in Adam) are often the real bottleneck, sometimes tripling the memory footprint of the model itself. For instance, training a 7B parameter model can require ~70GB of VRAM, far exceeding the capacity of consumer-grade GPUs like the NVIDIA RTX 3090.
Existing solutions have significant trade-offs:
- LoRA (Low-Rank Adaptation): Constrains updates to a fixed, pre-defined low-rank subspace, which can limit the model's expressive power compared to full-parameter tuning.
- GaLore: Projects gradients into a low-rank subspace but uses a fixed rank and fixed update intervals, which doesn't account for the changing dynamics of the model as it learns.
AdaRankGrad aims to provide the performance of full-parameter training with the memory efficiency of low-rank methods by making the projection rank truly adaptive.
Methods
The authors introduce a new algorithm based on a key theoretical insight: in reversible neural networks, the rank of the gradient matrix gradually decreases and asymptotically approaches rank one as training progresses.
Key components of the AdaRankGrad method include:
- Adaptive Subspace Selection: Instead of a fixed rank, the algorithm uses an Information-based Adaptive Subspace Selection (IASS). It calculates the smallest rank $r$ required to preserve a specific fraction of the gradient's information (e.g., 90% of the squared norm).
- Efficient Projections: It utilizes a Randomized SVD (SSRF) scheme to find the projection matrix $Q$ quickly, avoiding the massive computational cost of a full Singular Value Decomposition on large weight matrices.
- Moment Transformation: Crucially, when the subspace is updated, AdaRankGrad transforms the existing Adam moments ($M_t$ and $V_t$) to align with the new subspace. This ensures training continuity and prevents the performance dips often seen in other projection-based methods.
- Convergence-Triggered Updates: Subspace updates aren't scheduled by clock time but by the convergence of the projected gradient, ensuring resources are only spent on updates when necessary.
Datasets
The researchers evaluated AdaRankGrad across three distinct domains:
- Natural Language Understanding: The GLUE benchmark (8 tasks including MNLI, SST-2, and MRPC) using a RoBERTa-base model.
- Large-Scale Pre-training: The C4 dataset (Common Crawl) for pre-training LLaMA models ranging from 60M to 1B parameters.
- Biological Foundation Models: The Geneformer task, involving cell classification on biological omics data (specifically cardiomyopathy disease states).
Key Insights and Ideas
- The "Aha" Moment: Gradient Rank Vanishing. The authors formally prove that gradients become simpler (lower rank) as the model gets closer to an optimal solution. Figure 2 in the paper demonstrates this empirically: in an MLP layer, just two eigenvalues can capture 90% of the gradient information.
- Dynamic vs. Static: By allowing the rank to decrease over time (as seen in Figure 3), the model saves significant memory in the later stages of training without sacrificing the high-rank updates needed during the initial "warm-up" phase.
- Full-Parameter, Low-Memory: Unlike LoRA, which changes the model architecture, AdaRankGrad performs full-parameter updates. It simply uses a low-rank view of the gradients to save memory in the optimizer.
Key Results
AdaRankGrad consistently outperformed or matched existing methods while using less memory:
- Memory Efficiency: It reduced optimizer state memory by 25% to 50% compared to GaLore. For a LLaMA-1B model, AdaRankGrad used ~3.62GB for weights and optimizer states, compared to GaLore's ~4.38GB and LoRA's ~6.17GB.
- Accuracy: On the GLUE benchmark, AdaRankGrad (initial rank 4) achieved an average accuracy that surpassed both LoRA and GaLore. For example, on the RTE task, it reached 81.23% accuracy, while GaLore reached 79.42%.
- Pre-training Performance: In LLaMA-1B pre-training, AdaRankGrad achieved a validation perplexity of 14.71, significantly better than GaLore (15.64) and LoRA (19.21).
Limitations and Future Work
- Computational Overhead: While the subspace updates are infrequent, the process of determining the optimal rank and performing the randomized SVD does add some computational time per update step.
- Optimizer Scope: The current study focuses primarily on the Adam/AdamW optimizer. The authors suggest that exploring other update rules, like AdaFactor, could be a promising next step.
- Subspace Search: Future research could investigate even more efficient algorithms for computing the projection subspace to further reduce the "search" cost during training.
Summary updated