TL;DR
This paper introduces AdaPrefix and AdaPrefix++, novel methods for continual learning in large pre-trained transformer models. AdaPrefix combines parameter-efficient techniques (adapters and prefixes) to learn new tasks without forgetting old ones, while AdaPrefix++ further enhances this by using a hypernetwork to generate task-specific prefixes, enabling knowledge transfer between tasks and achieving even better performance, especially on smaller models.
What Problem Does This Paper Address?
The core challenge addressed is catastrophic forgetting in deep learning models. As models are trained on sequential tasks, they tend to forget information learned from previous tasks. This is a significant hurdle for building AI systems that can continuously learn and adapt in dynamic, real-world environments, such as autonomous driving or personalized recommendation systems, where new data and tasks arrive over time. Storing all past data for retraining is often infeasible due to memory constraints. The paper focuses on applying continual learning to large pre-trained transformer models (PLMs), which are powerful but computationally expensive to fine-tune fully. Existing parameter-efficient fine-tuning (PEFT) methods like adapters and prefixes offer a way to adapt PLMs with fewer parameters, but their application to continual learning, especially in vision tasks, and their ability to facilitate knowledge transfer between tasks, remain areas for improvement.
Methods
The paper proposes two main methods:
- AdaPrefix: This method integrates two popular PEFT techniques: adapters and prefixes. Adapters are small neural networks inserted into the transformer architecture, while prefixes are trainable vectors prepended to the input of attention layers. AdaPrefix strategically places adapters after the feed-forward network (FFN) layers and prefixes within the multi-head attention (MHA) layers of a PLM. Crucially, for continual learning, AdaPrefix assigns separate adapter and prefix parameters for each task, ensuring parameter isolation and preventing catastrophic forgetting.
- AdaPrefix++: This is an advancement over AdaPrefix that introduces knowledge transfer between tasks. Instead of having independent prefixes for each task, AdaPrefix++ uses a hypernetwork. This hypernetwork takes task embeddings and layer embeddings as input and generates the task-specific prefixes. By sharing the hypernetwork across all tasks, knowledge learned from previous tasks can inform the generation of prefixes for new tasks. To prevent the hypernetwork itself from forgetting, a regularization term is added to the loss function, encouraging consistency in prefix generation across tasks.
Both methods leverage existing PLMs as a backbone and only fine-tune the task-specific PEFT parameters and the hypernetwork (in AdaPrefix++).
Datasets
The paper evaluates its methods on several benchmark datasets across different continual learning scenarios:
- Task Incremental Learning (TIL) and Class Incremental Learning (CIL):
- Split-CIFAR100: CIFAR100 is split into 10 tasks, each with 10 classes.
- Split-ImageNet-R: ImageNet-R is split into 10 tasks, each with 20 classes.
- Domain Incremental Learning (DIL):
- CDDB-Hard: A continual deepfake detection benchmark.
The authors also explore the impact of different backbone sizes of the Vision Transformer (ViT) and DeiT architectures.
Key Insights and Ideas
- Synergy of Adapters and Prefixes: Combining adapters and prefixes, as done in AdaPrefix, offers a more robust approach to continual learning than using either technique in isolation. This combination leverages the strengths of both for better performance.
- Hypernetworks for Knowledge Transfer: The introduction of a hypernetwork in AdaPrefix++ is a key innovation. It allows for effective knowledge transfer by generating task-specific prefixes, leading to improved performance and reduced forgetting compared to parameter isolation methods.
- Effectiveness on Smaller PLMs: AdaPrefix and AdaPrefix++ show particular promise for smaller PLM architectures, where full fine-tuning is even more prohibitive. They achieve significant improvements even when using smaller backbones.
- Regularization for Hypernetwork Stability: The regularization technique applied to the hypernetwork in AdaPrefix++ is crucial for preventing it from forgetting past tasks, thereby enabling consistent knowledge transfer.
Key Results
- Superior Performance: AdaPrefix++ consistently outperforms other state-of-the-art continual learning methods, including adapters, prefixes, and prompt-based approaches, across various datasets and backbone architectures.
- Accuracy Improvements: The paper reports accuracy improvements of 2-3% for AdaPrefix and 4-7% for AdaPrefix++ compared to baselines, especially on smaller PLMs. For instance, on DeiT-T in the TIL scenario, AdaPrefix++ achieves a 5-6% increase in accuracy.
- Reduced Forgetting: AdaPrefix++ demonstrates a very low amount of forgetting (around 1%) compared to other SOTA approaches.
- Forward Transfer: AdaPrefix++ shows strong forward transfer capabilities, meaning knowledge gained from earlier tasks helps in learning subsequent tasks more effectively.
Limitations and Future Work
- Parameter Growth in AdaPrefix: While AdaPrefix is parameter-efficient, the paper notes that the parameter growth for AdaPrefix++ is smaller than AdaPrefix, implying AdaPrefix might have a slightly larger parameter footprint when considering task-specific parameters.
- Hypernetwork Complexity: While AdaPrefix++ uses a hypernetwork for efficiency, the paper acknowledges that training a hypernetwork can be computationally expensive and requires significant data, which might be a practical limitation in some continual learning scenarios.
- Domain Incremental Learning: While the paper mentions experiments on DIL, the primary focus and detailed analysis are on Task and Class Incremental Learning. Further exploration in DIL could be a future direction.
- Hyperparameter Tuning: The paper mentions extensive hyperparameter tuning (prefix length, adapter reduction factor, regularization constant $\lambda$) was performed, highlighting the sensitivity of the methods to these choices. Future work could explore more automated hyperparameter optimization strategies.
Summary updated