将LoRA拆成积木块,按秩重组提升模型融合效果
Merging LoRAs like Playing LEGO: Pushing the Modularity of LoRA to Extremes Through Rank-Wise Clustering
- 把LoRA按秩拆解为独立语义单元,实现灵活组合
- 通过聚类生成新LoRA,rank可调至k,性能优于现有方法
- 无需重新训练,适合快速整合多个领域适配模型
低秩适应(LoRA)因其模块化设计成为大语言模型领域微调的热门技术,广泛部署于Huggingface等平台。这种模块性激发了对多LoRA组合以增强模型能力的兴趣。然而,现有组合方法多依赖任务特定训练,且主流合并技术未能充分释放LoRA的模块潜力,常导致参数干扰与性能下降。本文探索在更细粒度上拆解与重装多个LoRA的可能性,类比拼装乐高积木。提出最小语义单元(MSUs)概念,其中每个秩对应的参数被视为独立单元,具备排列不变性与拼接-求和等价性,支持灵活组合。基于此,提出LoRA-LEGO框架:通过秩级参数聚类,将来自不同LoRA的MSUs分为 $k$ 个簇,每簇质心作为代表单元,构建新合并LoRA,其秩可调整为 $k$。同时采用双重重加权策略优化合并后LoRA尺度。跨多个基准测试的实验表明,本方法在LoRA合并上优于现有方案。
原文摘要 · Abstract (English)
Low-Rank Adaptation (LoRA) has emerged as a popular technique for fine-tuning large language models (LLMs) to various domains due to its modular design and widespread availability on platforms like Huggingface. This modularity has sparked interest in combining multiple LoRAs to enhance LLM capabilities. However, existing methods for LoRA composition primarily focus on task-specific adaptations that require additional training, and current model merging techniques often fail to fully leverage LoRA's modular nature, leading to parameter interference and performance degradation. In this paper, we investigate the feasibility of disassembling and reassembling multiple LoRAs at a finer granularity, analogous to assembling LEGO blocks. We introduce the concept of Minimal Semantic Units (MSUs), where the parameters corresponding to each rank in LoRA function as independent units. These MSUs demonstrate permutation invariance and concatenation-summation equivalence properties, enabling flexible combinations to create new LoRAs. Building on these insights, we propose the LoRA-LEGO framework. This framework conducts rank-wise parameter clustering by grouping MSUs from different LoRAs into $k$ clusters. The centroid of each cluster serves as a representative MSU, enabling the assembly of a merged LoRA with an adjusted rank of $k$. Additionally, we apply a dual reweighting strategy to optimize the scale of the merged LoRA. Experiments across various benchmarks demonstrate that our method outperforms existing approaches in LoRA merging.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。