TL;DR
Continual fine-tuning of Large Language Models (LLMs) usually hits a wall: updating shared adapter parameters causes catastrophic forgetting, while allocating new adapters per task causes parameter counts to grow linearly. This paper introduces Mixtures of SubExperts (MoSEs), a parameter-efficient framework that integrates sparse sub-networks into attention layers with dynamic task-prompt routing. By adaptively reusing and isolating sparse parameter subsets across tasks, MoSEs prevent forgetting while keeping model capacity growth strictly sublinear.
What Problem Does This Paper Address?
When LLMs are updated sequentially on incoming streams of tasks (continual learning), they suffer heavily from catastrophic forgetting—new gradients overwrite weights crucial for previous tasks.
Standard Parameter-Efficient Fine-Tuning (PEFT) methods (such as LoRA) alleviate full-model training costs, but naive sequential adaptation of a single adapter still causes severe forgetting. Conversely, allocating dedicated modules for every incoming task causes parameter storage to scale linearly ($O(T)$) and prevents positive knowledge transfer across related tasks. Conventional Mixture-of-Experts (MoE) approaches offer conditional computation, but typically rely on static or entangled multitask routing that degrades during sequential updates. MoSEs tackles this dilemma, particularly under the realistic Task-Agnostic Incremental Learning (TaIL) setting, where the model must figure out which task it is performing at inference time without explicit task IDs.
Methods
MoSEs injects sparse, modular sub-experts into Multi-Head Self-Attention (MSA) layers alongside the frozen pretrained weights:
- Sparse Mixture of SubExperts: Rather than using dense expert modules, MoSEs defines a pool of $N$ sub-experts per layer and identifies sparse sub-networks via score-based binary masks $m^t = \{\delta^t, \xi^t\}$ using a top-$c\%$ sparsity threshold.
- Task Prompts & Key-Based Dynamic Routing: To handle task-agnostic inference (TaIL), the model learns task-specific prompt tokens $e_t$ and corresponding key vectors $k_t$. During training, an auxiliary cosine-similarity loss ($\mathcal{L}_{\text{pull}}$) encourages input representations to align with their true task key. At inference, an input is matched to the closest key ($t_x = \arg\min \gamma(q(x), k_t)$) to select the correct prompt and subnetwork without explicit task supervision.
- Strategic Layer Freezing: Instead of tuning all 32 transformer layers, MoSEs freezes early layers (e.g., skipping layers 0 and 1:
W/O[0-1]), which preserves general language representations and improves retention.
Input x ───► Pretrained Attention (Frozen) ──┐
│ │
├──► Match Task Key kt ──► Prompt et ├──► [+] ──► Output h
│ │
└──► [et ; x] ──► Sparse MoSE Router/Subnets ─┘
Datasets
The authors evaluate on the standardized TRACE benchmark across two scales:
- TRACE 0.5K: 8 diverse tasks with 500 training and 100 test examples per task.
- TRACE 5K: Scaled dataset comprising 5,000 training and 2,000 test examples per task (40,000 train / 16,000 test total).
The benchmark covers five core LLM capabilities:
- Factual Knowledge: MMLU (5-shot)
- General Reasoning: Big-Bench-Hard / BBH (3-shot CoT)
- Multilingual Understanding: TyDiQA (0-shot F1)
- Commonsense Reasoning: PIQA (0-shot)
- Reading Comprehension: BoolQ (0-shot) Alongside instruction-following evaluation sets (Self-Instruct, LIMA) and safety sets (CoNa).
Key Insights and Ideas
- Less Is More in Expert Configuration: Scaling expert counts degraded continual learning performance. A minimal setup of 2 experts with top-2 routing ($E2T2$) outperformed configurations with 3 or 4 experts ($E3T2, E4T3$), which diluted task-specific knowledge and introduced interference.
- Skipping Bottom Layers Prevents Forgetting: Freezing the first two transformer layers (
W/O[0-1]) outperformed tuning all layers (accuracy increased from $52.6\%$ to $54.9\%$, and Backward Transfer shifted from $-1.50\%$ to $+0.05\%$). Lower layers capture universal features that should remain untouched. - Sparsity Beats Full Reuse: Setting the expert selection ratio to $c = 29.0\%$ or $30.0\%$ outperformed denser sub-networks ($40\%$ or $50\%$), maintaining the lowest parameter footprint (3.83M) while keeping backward transfer close to zero or positive.
Key Results
- Task-Agnostic Incremental Learning (TaIL, TRACE 0.5K):
- Average Accuracy: MoSEs achieved $49.1\%$ ($c=29\%$) and $48.4\%$ ($c=30\%$), substantially higher than Sequential LoRA ($33.1\%$), O-LoRA ($37.3\%$), and standard MoE ($42.2\%$).
- Catastrophic Forgetting Mitigation: MoSEs achieved a Backward Transfer (BWT) of $-0.90\%$ ($c=29\%$) and $-0.43\%$ ($c=30\%$), whereas LoRA experienced massive degradation at $-22.67\%$ and MoE at $-11.10\%$.
- Efficiency: MoSEs utilized only 3.82M–3.83M trainable parameters (vs. 4.19M for LoRA and 4.22M for MoE) with a faster test latency (1.20 hours vs. 1.25 hours).
- TRACE 5K Full Benchmark:
- MoSEs maintained strong scalability, reaching $54.1\%$ average accuracy with positive backward transfer ($+0.36\%$), compared to SeqFT-LoRA ($31.5\%$, BWT $-29.67\%$).
Limitations and Future Work
- Dependency on Task Separation Quality: Under the TaIL setting, if the prompt key matching mechanism misclassifies the incoming task index ($t_x$), performance degrades toward the lower diagonals seen in task transfer matrices.
- Model Scale Limitations: The primary experiments were demonstrated on a 7B parameter backbone; scaling behaviors to 70B+ LLMs or mixture-of-agents settings remain unverified.
- Sensitivity to Sparsity Thresholds: Overly aggressive pruning or skipping too many lower layers (e.g., skipping layers 0–5) caused accuracy drops (down to $51.2\%$) and exacerbated forgetting (BWT down to $-2.90\%$), requiring careful per-architecture tuning.
Summary updated