arXiv:2507.00029cs.LGcs.AI2025-07被引 17

用注意力路由将低秩专家精准注入模型核心,实现高效多任务适配。

LoRA-Mixer: Coordinate Modular LoRA Experts Through Serial Attention Routing

  • 通过注意力机制路由特定任务的低秩专家,实现细粒度任务分工。
  • 仅用48%参数量,性能超越现有方法,在多个基准上提升超3个百分点。
  • 支持即插即用和跨模型复用,适合资源有限的多任务场景。

现有将低秩适配(LoRA)与专家混合(MoE)结合的方法常替换整个注意力或前馈层,或并行添加专家分支,导致参数效率下降且任务专一性受限。本文提出LoRA-Mixer,一种模块化MoE框架,将任务特定的LoRA专家路由至注意力模块的核心投影矩阵(输入/输出线性层),而非主要针对前馈层。该设计通过充分挖掘注意力机制,实现细粒度的令牌级任务专一性,同时保持对Transformer与状态空间模型(SSMs)的即插即用兼容性。为在数据有限时训练稳健路由器,提出自适应路由专业化损失(RSL),通过熵调控目标联合实现全局负载均衡与输入感知专一性。框架支持两种模式:(i) 采用可微分硬-软Top-k路由方案联合优化适配器与路由;(ii) 在冻结预训练的LoRA模块基础上进行即插即用路由。在15个基准测试(包括MedQA、GSM8K、HumanEval、GLUE)中,经RSL优化的LoRA-Mixer在仅使用48%可训练参数的情况下,优于当前最优路由与LoRA-MoE基线,在GSM8K、CoLA、ARC-C上分别取得3.79、2.90、3.95个百分点的提升。跨模型迁移与适配器复用实验进一步验证了其通用性与数据效率。代码已开源。

原文摘要 · Abstract (English)

Recent attempts to combine low-rank adaptation (LoRA) with mixture-of-experts (MoE) for multi-task adaptation of Large Language Models (LLMs) often replace whole attention/FFN layers with switch experts or append parallel expert branches, undermining parameter efficiency and limiting task specialization. We introduce LoRA-Mixer, a modular MoE framework that routes task-specific LoRA experts into the core projection matrices of the attention module, namely input and output linear layers, rather than primarily targeting FFN blocks. The design delivers fine-grained token-level specialization by fully exploiting the attention mechanism, while remaining drop-in compatible with Transformers and state-space models (SSMs), since linear projection layers are ubiquitous. To train robust routers from limited data while promoting stable, selective decisions and high expert reuse, LoRA-Mixer employs an adaptive Routing Specialization Loss (RSL) that jointly enforces global load balance and input-aware specialization via an entropy-shaping objective. The framework supports two regimes: (i) joint optimization of adapters and router with a differentiable hard-soft top-k routing scheme, and (ii) plug-and-play routing over frozen, pre-trained LoRA modules sourced from public repositories. Across 15 benchmarks, including MedQA, GSM8K, HumanEval, and GLUE, RSL-optimized LoRA-Mixer outperforms state-of-the-art routing and LoRA-MoE baselines while using 48 percent of their trainable parameters, with gains of 3.79, 2.90, and 3.95 percentage points on GSM8K, CoLA, and ARC-C, respectively. Cross-model transfer and adapter reuse experiments further demonstrate the approach's versatility and data efficiency. Our code is available at https://github.com/hustcselwb/LoRA-Mixer.

LoRAMoE适配器路由

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。