Intuition-aware Mixture-of-Rank-1-Experts for Parameter Efficient Finetuning

Yijiang Liu, Rongyu Zhang, Huanrui Yang, Kurt Keutzer, Yuan Du, Li Du, Shanghang Zhang · OpenReview

Abstract

Large Language Models (LLMs) have demonstrated significant potential in performing multiple tasks in multimedia applications, ranging from content generation to interactive entertainment, and artistic creation. However, the diversity of downstream tasks in multitask scenarios presents substantial adaptation challenges for LLMs. While traditional methods often succumb to knowledge confusion on their monolithic dense models, Mixture-of-Experts (MoE) has emerged as a promising solution with its sparse architecture for effective task decoupling. Inspired by the principles of human cognitive neuroscience, we design a novel framework T-REX (mixTure-of-Rank-onE-eXperts) that leverages the inherent semantic clustering of instances to mimic the human brain to deal with multitask, offering implicit guidance to the router for optimized feature allocation. Moreover, we introduce cutting-edge Rank-1 Experts formulation designed to manage a spectrum of intuitions, demonstrating enhanced parameter efficiency and effectiveness in multitask LLM finetuning. Extensive experiments demonstrate that T-REX achieves superior efficiency and 2.15% overall accuracy improvement across 14 public datasets against other state-of-the-art baselines.

Introduction

Fine-tuning Large Language Models (LLMs) for diverse multi-task environments is notoriously difficult. While Mixture-of-Experts (MoE) architectures allow models to "decouple" tasks by routing inputs to specialized sub-networks, they face two major hurdles:

  1. Parameter Bloat: In traditional MoE, adding more experts typically increases the parameter count linearly. To handle dozens of diverse tasks, the memory and computational overhead become prohibitive.
  2. Naive Routing: Most routers use a simple linear layer to assign tokens to experts. However, human-defined task labels (e.g., "Reasoning" vs. "Knowledge") are often coarse and ambiguous. Standard routers often fail to capture fine-grained semantic nuances, leading to suboptimal expert allocation.

Methodology

The T-REX framework introduces two primary innovations to solve these issues:

1. Mix-and-Match (MaM) Rank-1 Experts

Standard LoRA (Low-Rank Adaptation) represents weight updates as the product of two matrices, $A$ and $B$. T-REX takes this further by decomposing these into sets of rank-1 vectors. Instead of having $N$ independent experts, T-REX maintains a pool of $I$ left-vectors ($a_i$) and $J$ right-vectors ($b_j$). By allowing the router to pair any $a_i$ with any $b_j$, the model creates $I \times J$ "virtual" experts. This allows the number of experts to grow quadratically while the parameter count only grows linearly ($I+J$).

2. Semantic-aware Router (The "Intuition")

To move beyond "naive" routing, T-REX takes inspiration from human intuition. It uses an external embedding model to map training data into a latent space and then performs $k$-means clustering to find "semantic centroids." During inference, the model calculates the cosine similarity between the input's embedding and these centroids. This "intuition score" is fused with the base routing weights, providing a prior that guides the model to select experts based on the actual semantic content of the prompt rather than just human-provided task labels.

Comparison of LoRA, LoRA-MoE, and the T-REX architecture featuring Rank-1 experts and intuition-based routing.

Experimental Setup

The researchers curated a massive multi-task suite for evaluation:

  • Training: 20 datasets spanning five dimensions: Reasoning (ANLI, HellaSwag), Examination (MMLU, ARC), Language (WiC, WinoGrande), Understanding (OpenBookQA), and Knowledge (CommonSenseQA, BoolQ).
  • Evaluation: 14 public datasets were used for the main performance benchmarks.
  • OOD Generalization: The Big-Bench Hard (BBH) benchmark was used to test the model's ability to generalize to completely unseen tasks in a zero-shot setting.

Key Insights and Ideas

  • Subspace Expansion: The "mix-and-match" strategy mathematically expands the vector subspace that the experts can cover. This allows for a more precise approximation of the "ideal" weight update matrix for a given task.
  • Human Labels are Noisy: Visualization of task embeddings shows that human-labeled categories often overlap significantly in embedding space. By using unsupervised clustering (the "intuition"), the router receives a much cleaner signal for task differentiation.
  • Smoother Convergence: Theoretical and empirical results show that the intuition signal acts as a high-quality initialization for the router, leading to a smoother and more stable training trajectory compared to traditional MoE.
Evolution of expert combination parameters in latent space, comparing LoRA, Rank-1, and T-REX, demonstrating the stability provided by intuition-aware routing.

Key Results

  • Superior Efficiency: T-REX achieved its best results using 30-40% fewer trainable parameters than baselines like MoLoRA and SiRA. For example, on Mistral 7B, T-REX used ~40M parameters compared to ~84M for LoRA-32.
  • Performance Gains: Across 14 datasets and 7 different LLM backbones (including LLaMA-2/3, Mistral, and Gemma), T-REX consistently outperformed other PEFT methods, showing up to a 2.15% overall accuracy improvement.
  • Zero-Shot Mastery: On the BBH benchmark, T-REX demonstrated significantly better out-of-distribution (OOD) generalization, surpassing LoRA by over 1% on Gemma 2B and Yi 6B backbones.

Limitations and Future Work

While T-REX shows significant promise, there are areas for further exploration. The current study focuses exclusively on text-based LLMs; extending this to Vision-Language Models (VLMs) is a logical next step. Additionally, while the experts are ultra-lightweight, the router's linear layer grows with the number of experts ($I \times J$). For extremely large expert pools, the router itself might become a bottleneck, suggesting the use of low-rank decompositions for the router matrix. Finally, the quality of the routing is dependent on the external embedding model used for the "intuition" signal.

Summary updated

BibTeX
@misc{liu2024intuition,
  author = {Yijiang Liu and Rongyu Zhang and Huanrui Yang and Kurt Keutzer and Yuan Du and Li Du and Shanghang Zhang},
  title = {{Intuition-aware Mixture-of-Rank-1-Experts for Parameter Efficient Finetuning}},
  year = {2024},
  eprint = {2404.08985},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2404.08985},
}
Figure