Lifelong Language Learning with Adapter based Transformers

Shadab Khan, Surbhi Agarwal, P. K. SrijithCLL @ ACML 2022

TL;DR

This paper introduces "Adapter-based Transformers" for Lifelong Language Learning (LLL), a method that allows NLP models to learn new tasks sequentially without forgetting previous ones. By using lightweight, task-specific adapter modules, the approach achieves better performance than existing methods while significantly reducing computational overhead and avoiding task order bias.

What Problem Does This Paper Address?

Real-world applications of Natural Language Processing (NLP) often involve systems that need to continuously learn from streams of new tasks and data over time. A major challenge in this "continual learning" setting is "catastrophic forgetting," where a model, upon learning a new task, loses the knowledge it acquired from previous tasks. Existing methods, like those using generative replay, struggle with scalability to many tasks and can be sensitive to the order in which tasks are presented. This paper aims to address these limitations by proposing a more efficient and robust lifelong learning framework.

Methods

The core innovation is the "Adapter-based Transformer" framework. Instead of retraining the entire large pre-trained Transformer model for each new task, this approach leverages adapter modules. These are small, lightweight neural network modules inserted into each layer of a pre-trained Transformer (like GPT-2).

Here's how it works:

  • Task-Specific Adapters: For each new NLP task, a new set of adapter modules is added to the existing Transformer architecture.
  • Frozen Core: Crucially, the parameters of the original pre-trained Transformer and all previously trained adapter modules are kept frozen. Only the newly added adapter modules are trained on the new task.
  • Network Growth: This strategy ensures that the model retains knowledge from older tasks perfectly because their parameters are untouched. New knowledge is encoded within the new, task-specific adapters. The overall network size grows minimally with each new task, as adapters are significantly smaller than the base model.
  • No Replay: Unlike some prior methods, this approach does not require generating or storing pseudo-samples from previous tasks, simplifying the process and avoiding potential issues with replay data quality or storage.

Datasets

The experiments were conducted on three standard NLP datasets:

  • Stanford Sentiment Treebank (SST): A sentiment analysis task.
  • Semantic Role Labeling (SRL): A role labeling task on Wikipedia data.
  • Goal-oriented dialogue (WOZ): A reservation task from the English Wizard of Oz dataset.

The paper also mentions an additional experiment with the Amazon Review dataset, indicating the framework's ability to scale to more tasks.

Key Insights and Ideas

  • Efficiency through Modularity: The use of small, task-specific adapters is a highly efficient way to extend the capabilities of large pre-trained models without the prohibitive cost of full fine-tuning for every new task.
  • Robustness to Task Order: A significant finding is that the performance of the proposed Adapter-based Transformer is largely independent of the order in which tasks are learned. This is a major advantage over methods that rely on replay, which can be sensitive to task sequencing.
  • Minimal Catastrophic Forgetting: By freezing the core model and previous adapters, the framework effectively prevents catastrophic forgetting, ensuring that knowledge from earlier tasks is preserved.
  • Scalability: The framework is designed to scale to a large number of tasks, as adding a new task simply means adding a new set of adapters, with minimal impact on overall model size and training complexity.

Key Results

  • Improved Accuracy: The Adapter-based Transformer achieved an average task accuracy increase of 4.1% over the baseline LAMOL model.
  • Reduced Parameter Growth: The model's parameter growth was kept below 15% even after training on multiple tasks, demonstrating significant efficiency. For instance, training on 12 layers resulted in only a 13.9% increase in parameters compared to the baseline.
  • Faster Training: The proposed method exhibited faster training times compared to the baseline LAMOL.
  • Task Order Insensitivity: Experiments showed that task ordering had minimal impact on the model's performance, a key advantage.

Limitations and Future Work

  • Performance Gap: While the proposed method improves upon existing LLL frameworks, the paper notes that there is still a performance gap between these methods and ideal multi-task learning scenarios.
  • Future Work: The authors suggest that further exploration of adapter architectures and their integration with different pre-trained models could lead to even greater improvements. The current work focuses on NLP tasks, and extending this approach to other domains could be a valuable future direction.

Summary updated

BibTeX
@inproceedings{khan2022lifelong,
  author = {Shadab Khan and Surbhi Agarwal and P. K. Srijith},
  title = {{Lifelong Language Learning with Adapter based Transformers}},
  booktitle = {CLL @ ACML},
  year = {2022},
  url = {https://openreview.net/forum?id=4TZzNZSJzp},
}
Figure