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

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Wang, Hanqing, Ping, Bowen, Wang, Shuo, Han, Xu, Chen, Yun, Liu, Zhiyuan, Sun, Maosong
Format: Preprint
Veröffentlicht: 2024
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866916130019344384
author Wang, Hanqing
Ping, Bowen
Wang, Shuo
Han, Xu
Chen, Yun
Liu, Zhiyuan
Sun, Maosong
author_facet Wang, Hanqing
Ping, Bowen
Wang, Shuo
Han, Xu
Chen, Yun
Liu, Zhiyuan
Sun, Maosong
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2402_11455
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle LoRA-Flow: Dynamic LoRA Fusion for Large Language Models in Generative Tasks
Wang, Hanqing
Ping, Bowen
Wang, Shuo
Han, Xu
Chen, Yun
Liu, Zhiyuan
Sun, Maosong
Computation and Language
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.
title LoRA-Flow: Dynamic LoRA Fusion for Large Language Models in Generative Tasks
topic Computation and Language
url https://arxiv.org/abs/2402.11455