Skip to main content
QUICK REVIEW

[Paper Review] LoRA-GA: Low-Rank Adaptation with Gradient Approximation

Shaowen Wang, Linxi Yu|arXiv (Cornell University)|Jul 6, 2024
Image and Signal Denoising MethodsComputer Science4 citations
TL;DR

LoRA-GA proposes a novel gradient-based initialization for Low-Rank Adaptation (LoRA) that accelerates convergence by aligning the initial gradients of the low-rank adapter matrices with those of full fine-tuning. By initializing the adapter matrices using the top singular vectors of the full model's gradient matrix, LoRA-GA achieves convergence rates comparable to full fine-tuning, outperforming vanilla LoRA by up to 11.52% on GSM8K and reducing training FLOPs by 2–4×.

ABSTRACT

Fine-tuning large-scale pretrained models is prohibitively expensive in terms of computational and memory costs. LoRA, as one of the most popular Parameter-Efficient Fine-Tuning (PEFT) methods, offers a cost-effective alternative by fine-tuning an auxiliary low-rank model that has significantly fewer parameters. Although LoRA reduces the computational and memory requirements significantly at each iteration, extensive empirical evidence indicates that it converges at a considerably slower rate compared to full fine-tuning, ultimately leading to increased overall compute and often worse test performance. In our paper, we perform an in-depth investigation of the initialization method of LoRA and show that careful initialization (without any change of the architecture and the training algorithm) can significantly enhance both efficiency and performance. In particular, we introduce a novel initialization method, LoRA-GA (Low Rank Adaptation with Gradient Approximation), which aligns the gradients of low-rank matrix product with those of full fine-tuning at the first step. Our extensive experiments demonstrate that LoRA-GA achieves a convergence rate comparable to that of full fine-tuning (hence being significantly faster than vanilla LoRA as well as various recent improvements) while simultaneously attaining comparable or even better performance. For example, on the subset of the GLUE dataset with T5-Base, LoRA-GA outperforms LoRA by 5.69% on average. On larger models such as Llama 2-7B, LoRA-GA shows performance improvements of 0.34, 11.52%, and 5.05% on MT-bench, GSM8K, and Human-eval, respectively. Additionally, we observe up to 2-4 times convergence speed improvement compared to vanilla LoRA, validating its effectiveness in accelerating convergence and enhancing model performance. Code is available at https://github.com/Outsider565/LoRA-GA.

Motivation & Objective

  • To address the slow convergence of vanilla LoRA, which increases total FLOPs and often degrades test performance despite lower per-step cost.
  • To investigate whether suboptimal initialization of LoRA adapter weights is a root cause of its slow convergence.
  • To develop a new initialization method that aligns the gradient update direction of the low-rank adapter with that of the full model from the first step.
  • To achieve convergence speed and performance comparable to full fine-tuning while preserving LoRA’s parameter efficiency and memory footprint.

Proposed method

  • LoRA-GA initializes the adapter matrices $A$ and $B$ using the top $r$ left and right singular vectors of the full model’s gradient matrix $\nabla_W \mathcal{L}$, ensuring the initial $\Delta(BA)$ aligns with $\Delta W$.
  • The method uses the singular value decomposition (SVD) of the gradient matrix to extract $U_{[1:r]}$ and $V_{[1:r]}$, which are then scaled by $\sqrt[4]{d_{\text{out}}}/\sqrt{\gamma}$ to stabilize output variance.
  • A new scaling factor $\alpha / \sqrt{r}$ is introduced to maintain output variance invariance across different ranks and input dimensions.
  • The initialization is applied only once before training, requiring no changes to LoRA’s architecture or training algorithm.
  • The method combines gradient approximation with output stability (SO) and is compatible with existing LoRA variants like ReLoRA.

Experimental results

Research questions

  • RQ1Does the default random initialization of LoRA’s adapter weights significantly slow down convergence compared to full fine-tuning?
  • RQ2Can aligning the initial gradient direction of the low-rank adapter with that of the full model accelerate convergence?
  • RQ3What initialization scheme ensures both gradient alignment and output variance stability in LoRA?
  • RQ4How does the proposed initialization compare to existing initialization strategies in terms of convergence speed and final performance?

Key findings

  • On the GLUE benchmark with T5-Base, LoRA-GA outperforms vanilla LoRA by 5.69% on average, achieving performance comparable to full fine-tuning.
  • On Llama 2-7B, LoRA-GA improves performance by 0.34, 11.52%, and 5.05% on MT-bench, GSM8K, and HumanEval, respectively.
  • LoRA-GA achieves up to 4× faster convergence than vanilla LoRA, reducing the number of training steps and FLOPs required to reach target performance.
  • The initialization step adds only ~1 minute to training on a 7B model (e.g., 74.7s on Llama 2-7B), with no additional memory overhead beyond standard LoRA.
  • Abllation studies confirm that both gradient approximation (+GA) and output stability (+SO) contribute to improved convergence, with their combination in LoRA-GA yielding the best results.
  • LoRA-GA maintains the same memory cost as standard LoRA and is compatible with other LoRA variants, such as ReLoRA, without architectural changes.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.