arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2407.05000cs.LGcs.CL
收藏

LoRA-GA:基于梯度逼近的低秩适配

LoRA-GA: Low-Rank Adaptation with Gradient Approximation

Tsinghua University(清华大学)

Shaowen Wang, Linxi Yu, Jian Li

AI总结:

本文提出LoRA-GA初始化方法,通过对齐低秩矩阵与全量微调的梯度,显著加速LoRA收敛并提升性能,在多个基准上超越原始LoRA。

摘要:

微调大规模预训练模型在计算和内存成本上极其昂贵。LoRA作为最流行的参数高效微调(PEFT)方法之一,通过微调一个参数显著更少的辅助低秩模型,提供了一种成本效益高的替代方案。尽管LoRA在每次迭代中显著降低了计算和内存需求,但大量经验证据表明,其收敛速度远慢于全量微调,最终导致总体计算量增加,且测试性能往往更差。在本文中,我们对LoRA的初始化方法进行了深入研究,并表明仔细的初始化(不改变架构和训练算法)能显著提升效率和性能。具体地,我们提出了一种新颖的初始化方法LoRA-GA(基于梯度逼近的低秩适配),该方法在第一步使低秩矩阵乘积的梯度与全量微调的梯度对齐。我们的广泛实验表明,LoRA-GA达到了与全量微调相当的收敛速度(因此显著快于原始LoRA以及各种近期改进方法),同时获得相当甚至更好的性能。例如,在GLUE数据集子集上使用T5-Base时,LoRA-GA平均比LoRA高出5.69%。在更大的模型如Llama 2-7B上,LoRA-GA在MT-bench、GSM8K和Human-eval上分别提升了0.34、11.52%和5.05%。此外,我们观察到与原始LoRA相比,收敛速度提高了2-4倍,验证了其在加速收敛和提升模型性能方面的有效性。代码可在https://github.com/Outsider565/LoRA-GA获取。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑