Introduction
As Large Language Models (LLMs) are increasingly integrated into dynamic, real-world environments, the ability to learn new tasks sequentially without losing prior knowledge—known as Continual Learning (CL)—has become a critical research frontier. Two primary challenges dominate this field: Catastrophic Forgetting (CF), where the model's performance on previous tasks degrades as new ones are learned, and Knowledge Transfer (KT), the ability to leverage existing knowledge to accelerate the learning of novel tasks.
While Parameter-Efficient Tuning (PET) methods like LoRA or Prompt Tuning have shown promise by isolating task-specific knowledge into modular blocks, they often suffer from a "selection gap." In these systems, the mechanism for learning a task is typically decoupled from the mechanism used to select the appropriate block during inference. This separation often necessitates the use of task-IDs at test time, which is impractical for many real-world applications.
The SAPT Framework
To bridge this gap, the Shared Attention Framework (SAPT) aligns the learning and selection processes by employing a unified attention mechanism that operates at the instance level rather than the task level.
Shared Attentive Learning & Selection (SALS)
The core of SAPT is the Shared Attentive Learning & Selection (SALS) module. Unlike traditional approaches that assign a single isolated PET block to a new task, SALS treats the learning of a new task as an optimization over a weighted combination of all previously learned PET blocks.
When a new input instance arrives, it is projected into a "query" space and compared against "key" vectors associated with each existing PET block to generate attention weights. These weights determine the contribution of each "expert" block to the final output. By integrating this selection logic directly into the training objective, the model naturally learns to identify and reuse relevant knowledge from prior tasks, facilitating robust forward knowledge transfer.
Attentive Reflection Module (ARM)
A significant risk in sequential learning is "representation drift," where the query projection layer changes so much during the learning of a new task that it can no longer correctly select blocks for previous tasks. SAPT mitigates this through the Attentive Reflection Module (ARM).
ARM utilizes a generative replay strategy, but with a key efficiency: it only generates "pseudo-samples" (input representations) rather than full input-output pairs. During the training of a new task, the model "reflects" on these pseudo-samples. A Kullback-Leibler (KL) divergence loss is applied to ensure that the attention distributions for previous tasks remain consistent with their original states, effectively anchoring the selection mechanism against forgetting.
Experimental Evaluation
The SAPT framework was rigorously evaluated across two diverse benchmarks:
- SuperNI Benchmark: Comprising 15 distinct NLP tasks (e.g., QA, summarization, sentiment analysis), this benchmark tests the model's versatility across diverse task types.
- Long Sequence Benchmark: A sequence of 15 classification datasets designed to evaluate long-term stability and resistance to catastrophic forgetting over extended learning periods.
Experiments were conducted on models of varying scales, including T5-Large (770M) and LLaMA-2 (7B and 13B), to assess the framework's scalability.
Results and Discussion
SAPT demonstrated a significant performance advantage over state-of-the-art baselines such as SeqLoRA and O-LoRA. On the SuperNI benchmark, SAPT-LoRA achieved an Average Performance (AP) of 51.54, vastly outperforming the best baseline (Replay) at 35.37.
Key findings include:
- Minimal Forgetting: The Forgetting Rate (F.Ra) was recorded at a remarkably low 0.91 on SuperNI, validating the effectiveness of the ARM module in stabilizing the selection logic.
- Positive Forward Transfer: The SALS mechanism successfully leveraged existing knowledge, leading to improved performance on subsequent tasks compared to models trained from scratch.
- Scalability: The performance gap between SAPT and its competitors widened as the base model size increased, suggesting that SAPT is particularly well-suited for the current generation of Large Language Models.
Conclusion
SAPT introduces a paradigm shift in continual learning by treating selection and learning as a single, aligned objective. By utilizing instance-level shared attention and an efficient reflection module, it provides a scalable solution to the twin challenges of catastrophic forgetting and knowledge transfer. Future work will explore methods to prune the growing pool of PET blocks and investigate mechanisms for enhancing backward transfer to improve performance on older tasks.
Summary updated