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

LoRA-Flow:生成任务中大语言模型的动态 LoRA 融合

LoRA-Flow: Dynamic LoRA Fusion for Large Language Models in Generative Tasks

Peking University(北京大学);Tsinghua University(清华大学);Shanghai University of Finance and Economics(上海财经大学)

Hanqing Wang, Bowen Ping, Shuo Wang, Xu Han, Yun Chen, Zhiyuan Liu, Maosong Sun

AI总结:

提出 LoRA-Flow,通过参数极少的融合门控动态调整不同 LoRA 在生成任务各步骤的权重,仅需 200 样本即可学习,在六个生成任务上优于任务级融合基线。

摘要:

LoRA 采用轻量级模块为每个下游任务或领域定制大语言模型(LLMs),其中不同学习到的附加模块代表不同的技能。组合现有 LoRA 以解决新任务可以增强已学习 LoRA 的可重用性,这对于标注数据有限的任务尤为有益。先前关于 LoRA 组合的大多数工作主要依赖于每个涉及 LoRA 的任务级权重,使得不同示例和 token 共享相同的 LoRA 权重。然而,在生成任务中,不同 token 可能需要不同的技能来处理。以中文数学任务为例,理解问题描述可能更多依赖中文 LoRA,而计算部分可能更多依赖数学 LoRA。为此,我们提出 LoRA-Flow,利用动态权重调整不同 LoRA 的影响。每一步的权重由参数极少的融合门控决定,仅需 200 个训练样本即可学习。跨六个生成任务的实验表明,我们的方法始终优于使用任务级融合权重的基线。这强调了为 LoRA 组合引入动态融合权重的必要性。

英文摘要:

LoRA employs lightweight modules to customize large language models (LLMs) for each downstream task or domain, where different learned additional modules represent diverse skills. Combining existing LoRAs to address new tasks can enhance the reusability of learned LoRAs, particularly beneficial for tasks with limited annotated data. Most prior works on LoRA combination primarily rely on task-level weights for each involved LoRA, making different examples and tokens share the same LoRA weights. However, in generative tasks, different tokens may necessitate diverse skills to manage. Taking the Chinese math task as an example, understanding the problem description may depend more on the Chinese LoRA, while the calculation part may rely more on the math LoRA. To this end, we propose LoRA-Flow, which utilizes dynamic weights to adjust the impact of different LoRAs. The weights at each step are determined by a fusion gate with extremely few parameters, which can be learned with only 200 training examples. Experiments across six generative tasks demonstrate that our method consistently outperforms baselines with task-level fusion weights. This underscores the necessity of introducing dynamic fusion weights for LoRA combination.

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

↑