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

LoRA-FA:高效且有效的低秩表示微调

LoRA-FA: Efficient and Effective Low Rank Representation Fine-tuning

The Hong Kong University of Science and Technology (Guangzhou)(香港科技大学(广州));Hong Kong University of Science and Technology(香港科技大学);Harbin Institute of Technology, Shenzhen(哈尔滨工业大学(深圳))

Longteng Zhang, Lin Zhang, Shaohuai Shi, Xiaowen Chu, Bo Li

AI总结:

本文提出LoRA-FA,通过冻结投影下矩阵A并训练投影上矩阵B,有效提升低秩适应性能,同时减少计算和内存开销。

摘要:

微调大型语言模型(LLMs)对提升其在下游任务上的性能至关重要,但全参数微调(Full-FT)计算成本高且内存消耗大。参数高效微调(PEFT)方法,如低秩适应(LoRA),通过仅优化少量参数来解决这一问题。然而,LoRA在某些场景下可能不如Full-FT,因为其低秩梯度存在固有局限。本文揭示了LoRA更新中的不对称、可压缩结构:将W的低秩修改可重新表述为单层线性回归,意味着其中一个LoRA因子可以冻结而不牺牲表达能力。基于这一见解,我们引入LoRA-FA,冻结投影下矩阵A并仅训练投影上矩阵B。我们进一步通过推导闭式梯度修正来缩小与Full-FT的差距。通过在多样本基准测试(包括GLUE、GSM8K、MT-Bench和HumanEval)上的广泛实验,我们证明LoRA-FA在性能上与现有PEFT方法和Full-FT相当。系统效率实验表明,LoRA-FA显著减少了微调过程中的激活内存消耗和计算工作量。我们的代码可在https://github.com/huggingface/peft上获得。

英文摘要:

Fine-tuning large language models (LLMs) is crucial for improving their performance on downstream tasks, but full-parameter fine-tuning (Full-FT) is computationally expensive and memory-intensive. Parameter-efficient fine-tuning (PEFT) methods, such as Low-Rank Adaptation (LoRA), address this by optimizing only a small subset of parameters. However, LoRA may underperform Full-FT in certain scenarios due to the intrinsic limitations of its low-rank gradients. In this work, we reveal an asymmetric, collapsible structure in LoRA's update: the low-rank modification to W can be reformulated as a single-layer linear regression, implying that one of the LoRA factors can be frozen without sacrificing expressivity. Leveraging this insight, we introduce LoRA-FA, which freezes the projection-down matrix A and trains only the projection-up matrix B. We further close the gap to Full-FT by deriving closed-form gradient corrections that minimize the discrepancy between the induced low-rank gradient and the full gradient. Through extensive experiments on diverse benchmarks, including GLUE, GSM8K, MT-Bench, and HumanEval, we demonstrate that LoRA-FA consistently achieves comparable performance to existing PEFT methods and Full-FT. Experiments on system efficiency show that LoRA-FA significantly reduces activation memory consumption and computational workload in fine-tuning. Our code is available at https://github.com/huggingface/peft.

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

↑