Abstract
Parameter-efficient fine-tuning (PEFT) methods are increasingly used with pre-trained language models (PLMs) for continual learning (CL). These methods typically involve training a PEFT module for each new task and employing similarity-based selection to route modules during inference. However, they face two major limitations: 1) interference during module training with already learned modules and 2) suboptimal routing when composing modules. In this paper, we present L2R, a method that isolates the training of new PEFT modules to ensure their task specialization. L2R then learns to compose the learned modules by training a network of routers that leverages a small memory containing examples of previously seen tasks. We evaluate our method in two CL setups using various benchmarks. Our results demonstrate that L2R provides an effective composition of PEFT modules, leading to improved generalization and performance compared to other methods.
TL;DR
L2R (Learning to Route) is a new approach to Continual Learning that prevents "knowledge interference" by training task-specific adapters in total isolation. Instead of relying on simple similarity scores to pick an adapter at test time, L2R uses a small memory of past examples to train a dedicated routing network that dynamically composes multiple adapters for every input.
What Problem Does This Paper Address?
Continual Learning (CL) aims to teach models new tasks without them forgetting old ones. Recently, researchers have turned to Parameter-Efficient Fine-Tuning (PEFT)—like adapters or prompts—to handle this. The idea is simple: keep the main model frozen and just add a tiny "module" for each new task.
However, current PEFT-based CL methods hit two major roadblocks:
- Interference: If you train a new module while old ones are active, the new knowledge can get "muddled" by the old.
- Suboptimal Routing: At inference time, the model has to decide which module to use. Most methods use basic similarity checks (e.g., "does this input look like Task A?"), which often fails to capture the nuance needed to combine knowledge from multiple specialized modules.
Methods
The authors introduce L2R, which operates in two distinct phases:
- Isolated Training: When a new task arrives, L2R adds a new adapter but keeps all previous adapters deactivated. This ensures the new adapter specializes purely on the current task without any "noise" from previous ones.
- Memory-Based Router Learning: After training the adapters, L2R needs to learn how to combine them. It populates a small, non-parametric memory (about 10% of the training data). It then trains a router network using these samples. This router looks at the input (specifically the
[CLS]token representation) and outputs an allocation vector.
- Composition Strategies: The paper explores two ways to use the router's output: L2R-wavg (computing a weighted average of the adapters' outputs) and L2R-merge (merging the actual weights of the adapters).
- Gumbel-Sigmoid: Instead of a standard Softmax (which forces modules to compete), they use a Gumbel-sigmoid activation. This allows the model to treat tasks as a hierarchy, potentially activating multiple relevant adapters for a single complex input.
Datasets
The researchers evaluated L2R across three diverse benchmarks:
- MTL5: 5 distinct text classification tasks (e.g., AGNews, Yelp, Amazon). These represent "far-domain" tasks where boundaries are clear.
- Web-of-Science (WOS): 7 document classification tasks. These are "near-domain" tasks, making it harder to distinguish between them.
- AfriSenti: 12 multilingual sentiment analysis tasks covering various African languages (e.g., Hausa, Igbo, Yoruba).
They tested these in both Task-Incremental (TIL) (where the model is told which task it's doing) and the much harder Class-Incremental (CIL) (where the model must figure out the task on its own) settings.
Key Insights and Ideas
- Isolation is Key for Specialization: By deactivating old adapters during new task training, L2R prevents "catastrophic interference" at the source. The adapters become true experts in their specific domains.
- Routing as Local Adaptation: Training the router on a small memory buffer acts as a form of "local adaptation." It bridges the gap between training in isolation and performing in a multi-task environment.
- Modularity over Competition: The use of Gumbel-sigmoid allows the model to effectively learn linguistic relationships. In the AfriSenti benchmark, the router learned to co-activate adapters for related languages like Hausa and Igbo when processing similar inputs.
Key Results
- CIL Superiority: In the challenging Class-Incremental setting, L2R-wavg consistently outperformed state-of-the-art baselines. On the AfriSenti benchmark, it achieved 60.04% accuracy, significantly higher than the next best baseline, MoCL (45.61%).
- Matching the Upper Bound: In Task-Incremental settings, L2R often matched the "Upper Bound" (a model trained with perfect knowledge of which adapter to use), suggesting the learned routing function is nearly optimal.
- Memory Scaling: The authors found that even a tiny memory (1% of data) provides a massive boost, but performance continues to scale as the memory size increases toward 30%.
- Wavg vs. Merge: Weighted averaging (
L2R-wavg) generally outperformed parameter merging (L2R-merge), likely because merging parameters can still cause some internal interference between weights.
Limitations and Future Work
- Memory Constraints: While the memory used is small (10%), it still requires storing raw examples, which might raise data privacy or storage concerns.
- Model Scale: The study focused on smaller PLMs like BERT and AfroXLMR. Testing on Large Language Models (LLMs) is a necessary next step.
- Memory Population: The current method uses random sampling. More advanced "core-set" selection or outlier elimination methods could further improve the router's performance.
Summary updated