AdaRankGrad: Adaptive Gradient-Rank and Moments for Memory-Efficient LLMs Training and Fine-Tuning

Yehonathan Refael, Jonathan Svirsky, Boris Shustin, Wasim Huleihel, Ofir Lindenbaum

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.

The illustration shows how AdaRankGrad reduces gradient dimensionality from 3D to 1D as training converges.

Key components of the AdaRankGrad method include:

  1. 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).
  2. 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.
  3. 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.
  4. 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.
Eigenvalue decay in an MLP layer's gradient, showing that most information is captured by the first few eigenvalues.
  • 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).
Table 1: Comparison between AdaRankGrad, GaLore, and LoRA. Assume W ∈Rn×m(n ≥m), constant rank r, and adaptive-rank radap (with initial-rank rinit = r).

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

Abstract

Training and fine-tuning large language models (LLMs) come with challenges related to memory and computational requirements due to the increasing size of the model weights and the optimizer states. Various techniques have been developed to tackle these challenges, such as low-rank adaptation (LoRA), which involves introducing a parallel trainable low-rank matrix to the fixed pre-trained weights at each layer. However, these methods often fall short compared to the full-rank weight training approach, as they restrict the parameter search to a low-rank subspace. This limitation can disrupt training dynamics and require a full-rank warm start to mitigate the impact. In this paper, we introduce a new method inspired by a phenomenon we formally prove: as training progresses, the rank of the estimated layer gradients gradually decreases, and asymptotically approaches rank one. Leveraging this, our approach involves adaptively reducing the rank of the gradients during Adam optimization steps, using an efficient online-updating low-rank projections rule. We further present a randomized SVD scheme for efficiently finding the projection matrix. Our technique enables full-parameter fine-tuning with adaptive low-rank gradient updates, significantly reducing overall memory requirements during training compared to state-of-the-art methods while improving model performance in both pretraining and fine-tuning. Finally, we provide a convergence analysis of our method and demonstrate its merits for training and fine-tuning language and biological foundation models.
BibTeX
@inproceedings{refael2025adarankgrad,
  author = {Yehonathan Refael and Jonathan Svirsky and Boris Shustin and Wasim Huleihel and Ofir Lindenbaum},
  title = {{AdaRankGrad: Adaptive Gradient-Rank and Moments for Memory-Efficient LLMs Training and Fine-Tuning}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=LvNROciCne},
}
Figure