Abstract
The Mixture of Experts (MoE) architecture improves large language models (LLMs) by utilizing sparsely activated expert sub-networks with a routing module, yet it typically demands high training cost. Previous work introduces parameter-efficient fine-tuning (PEFT) modules, e.g., LoRA, to achieve a lightweight MoE for efficiency. However, they construct static experts by manually splitting the LoRA parameters into fixed groups, which limits flexibility and dynamism. Furthermore, this manual partitioning also hinders the effective utilization of well-initialized LoRA modules. To tackle the challenges, we first delve into the parameter patterns in LoRA modules, revealing that there exists task-relevant parameters that are concentrated along the rank dimension. Based on this, we redesign the construction of experts and propose the LoRACoE (LoRA Composition of Experts) method. Specifically, when confronted with a task, it dynamically builds experts based on rank-level parameter composition, i.e., experts can flexibly combine rank-level parameters in LoRA module. Extensive experiments demonstrate that compared to other LoRA-based MoE methods, our method achieves better task performance across a broader range of tasks.
Introduction: The Limitations of Static LoRA Experts
The Mixture of Experts (MoE) architecture is a powerful way to scale model capacity without a linear increase in inference cost, as it only activates a subset of "experts" for any given input. However, training full-scale MoE models is prohibitively expensive. To solve this, researchers developed LoRA-based MoE, which applies MoE logic only to lightweight Low-Rank Adapters (LoRA).
The current state-of-the-art typically uses static partitioning: they take a LoRA module and manually split its ranks into fixed groups (e.g., ranks 1-4 are Expert A, 5-8 are Expert B). This approach is suboptimal for two reasons:
- Inflexibility: Static groups limit the model's ability to utilize specific parameters that might be useful across different "experts."
- Coarse Granularity: It ignores the underlying patterns of parameter importance, which are highly concentrated along the rank dimension.
Methods: Composition-based Expert Construction
LoRACoE (LoRA Composition of Experts) moves away from static parameter partitioning. Instead of manually grouping LoRA ranks into fixed experts, it treats individual ranks as building blocks that are dynamically recombined based on the task.
The core components of LoRACoE include:
- Rank-Wise Partitioning: Instead of grouping ranks into "buckets," LoRACoE treats each rank in the LoRA matrices ($A$ and $B$) as an individual component.
- Dynamic Composition: When the model processes an input, a routing module predicts importance weights for every rank. An "expert" is then constructed on-the-fly as a weighted combination of these ranks.
- The Router: The routing module ($W_{route}$) takes the hidden state and produces a weight matrix $G$, which determines how much each rank contributes to the final output.
- Two-Phase Training: To ensure stability, a "warm-up" phase trains a standard LoRA module first, followed by a joint training phase for both the LoRA parameters and the new routing module.
Key Insights: The Rank as the Unit of Expertise
Through parameter sensitivity analysis, the authors found that the variance of parameter importance is significantly higher along the rank dimension than along the input/output dimensions. This suggests that "knowledge" in LoRA is organized by rank.
- Synergy vs. Conflict: Different ranks exhibit positive or negative correlations depending on the task. Static partitioning forces potentially conflicting ranks to work together, whereas LoRACoE allows the router to suppress conflicting ranks and amplify synergistic ones.
- Dynamic Sparsity: LoRACoE can effectively "shut down" unimportant ranks for a specific token, achieving a finer-grained version of the sparse activation seen in traditional MoE.
Experimental Results
The authors evaluated LoRACoE across a diverse set of benchmarks using six backbone models (Llama2-7B/13B, Llama3-8B, and Qwen2-0.5B/1.5B/7B) covering commonsense reasoning, mathematical reasoning, and instruction following (IFEval).
LoRACoE consistently outperformed both standard LoRA and existing LoRA-MoE methods:
- Performance Boost: On Llama2-7B, LoRACoE achieved an average score of 74.59% across tasks, compared to 71.58% for LoRAMoE and 64.81% for standard LoRA.
- Scaling Success: The method showed robustness across all model sizes, with particularly strong gains in mathematical reasoning (e.g., outperforming LoRAMoE by over 3% on Llama3-8B).
- Efficiency: By optimizing the implementation (concatenating matrices to utilize GPU vector-matrix multiplication units), the authors reduced the forward computation time by 23.8% compared to a naive implementation, making the training time nearly identical to standard LoRA.
Conclusion and Future Work
While LoRACoE offers significant improvements, challenges remain. The routing module's output dimension grows with the number of ranks and experts, which could lead to diminishing returns at extreme scales. Future work may explore training-free initialization methods for the routing module and more sophisticated routing architectures to handle a larger number of experts effectively.
Summary updated