让多个低秩适配器公平协作,提升大模型微调效果。
ReMix: Reinforcement routing for mixtures of LoRAs in LLM finetuning
- 用非学习权重确保每个低秩适配器平等参与路由
- 提出无偏梯度估计方法,实现可训练的公平路由
- 在参数量相近时显著超越现有高效微调方法
低秩适配器(LoRAs)是一种参数高效的微调技术,通过向预训练模型注入可训练的低秩矩阵来适应新任务。混合低秩适配器(Mixture-of-LoRAs)模型通过将每层输入路由到少量专用的LoRA,高效扩展神经网络。现有混合LoRAs路由器为每个LoRA分配可学习的路由权重,支持端到端训练。然而我们发现,实际中路由权重极不均衡,通常仅一两个LoRA主导路由,严重限制了有效LoRA数量和模型表达能力。本文归因于可学习权重的本质,重新设计路由器。提出名为ReMix的新路由器:使用不可学习的路由权重,确保所有活跃的LoRA等效参与,避免单一适配器主导。由于不可学习权重无法直接通过梯度下降训练,我们进一步采用强化学习中的RLOO(reinforce leave-one-out)技术,将损失视为奖励,路由器视为策略,构建无偏梯度估计器。该方法还支持扩大训练计算以提升预测性能。大量实验表明,ReMix在激活参数数相近的情况下,显著优于当前最先进的参数高效微调方法。
原文摘要 · Abstract (English)
Low-rank adapters (LoRAs) are a parameter-efficient finetuning technique that injects trainable low-rank matrices into pretrained models to adapt them to new tasks. Mixture-of-LoRAs models expand neural networks efficiently by routing each layer input to a small subset of specialized LoRAs of the layer. Existing Mixture-of-LoRAs routers assign a learned routing weight to each LoRA to enable end-to-end training of the router. Despite their empirical promise, we observe that the routing weights are typically extremely imbalanced across LoRAs in practice, where only one or two LoRAs often dominate the routing weights. This essentially limits the number of effective LoRAs and thus severely hinders the expressive power of existing Mixture-of-LoRAs models. In this work, we attribute this weakness to the nature of learnable routing weights and rethink the fundamental design of the router. To address this critical issue, we propose a new router designed that we call Reinforcement Routing for Mixture-of-LoRAs (ReMix). Our key idea is using non-learnable routing weights to ensure all active LoRAs to be equally effective, with no LoRA dominating the routing weights. However, our routers cannot be trained directly via gradient descent due to our non-learnable routing weights. Hence, we further propose an unbiased gradient estimator for the router by employing the reinforce leave-one-out (RLOO) technique, where we regard the supervision loss as the reward and the router as the policy in reinforcement learning. Our gradient estimator also enables to scale up training compute to boost the predictive performance of our ReMix. Extensive experiments demonstrate that our proposed ReMix significantly outperform state-of-the-art parameter-efficient finetuning methods under a comparable number of activated parameters.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。