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

LoRA学得更少且遗忘更少

LoRA Learns Less and Forgets Less

Columbia University(哥伦比亚大学);Databricks Mosaic Research(Databricks Mosaic 研究部门)
Dan Biderman, Jacob Portes, Jose Javier Gonzalez Ortiz, Mansheej Paul, Philip Greengard, Connor Jennings, Daniel King, Sam Havens, Vitaliy Chiley, Jonathan Fran… 展开作者

Dan Biderman, Jacob Portes, Jose Javier Gonzalez Ortiz, Mansheej Paul, Philip Greengard, Connor Jennings, Daniel King, Sam Havens, Vitaliy Chiley, Jonathan Frankle, Cody Blakeney, John P. Cunningham

AI总结:

本研究比较LoRA与全微调在编程和数学领域的性能,发现LoRA在标准低秩设置下学习效果较弱,但能更好地缓解灾难性遗忘并保持生成多样性,同时提出LoRA微调的最佳实践。

摘要:

低秩适应(LoRA)是一种广泛用于大型语言模型的参数高效微调方法。LoRA通过仅训练选定权重矩阵的低秩扰动来节省内存。在本研究中,我们比较了LoRA和全微调在两个目标领域(编程和数学)上的性能。我们考虑了指令微调(约100K提示-响应对)和持续预训练(20B非结构化token)两种数据规模。结果表明,在标准低秩设置下,LoRA的性能显著低于全微调。然而,LoRA能更好地保持基础模型在目标领域之外任务上的表现。我们发现,LoRA比权重衰减和dropout等常见正则化技术更能缓解遗忘;它还有助于保持更多样化的生成。最后,我们证明全微调所学习的扰动秩比典型LoRA配置高10-100倍,这可能解释了部分报告的性能差距。我们最后提出了使用LoRA进行微调的最佳实践。

英文摘要:

Low-Rank Adaptation (LoRA) is a widely-used parameter-efficient finetuning method for large language models. LoRA saves memory by training only low rank perturbations to selected weight matrices. In this work, we compare the performance of LoRA and full finetuning on two target domains, programming and mathematics. We consider both the instruction finetuning (approximately 100K prompt-response pairs) and continued pretraining (20B unstructured tokens) data regimes. Our results show that, in the standard low-rank settings, LoRA substantially underperforms full finetuning. Nevertheless, LoRA better maintains the base model's performance on tasks outside the target domain. We show that LoRA mitigates forgetting more than common regularization techniques such as weight decay and dropout; it also helps maintain more diverse generations. Finally, we show that full finetuning learns perturbations with a rank that is 10-100X greater than typical LoRA configurations, possibly explaining some of the reported gaps. We conclude by proposing best practices for finetuning with LoRA.

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

↑