InsCL: A Data-efficient Continual Learning Paradigm for Fine-tuning Large Language Models with Instructions

Yifan Wang, Yafei Liu, Chufan Shi, Haoling Li, Chen Chen, Haonan Lu, Yujiu Yang

Introduction

As Large Language Models (LLMs) are increasingly deployed in dynamic environments, the ability to learn new tasks sequentially without losing proficiency in previous ones—a challenge known as catastrophic forgetting—has become a critical research frontier. While traditional "replay-based" methods, which involve re-training on a subset of old data, have shown promise, they often suffer from computational inefficiency and a lack of strategic data selection.

This paper introduces InsCL (Instruction-based Continual Learning), a data-efficient framework specifically designed for the instruction-tuning paradigm. By leveraging the rich semantic information contained within instructions, InsCL optimizes both the quantity and quality of replayed data, significantly outperforming standard strategies with minimal overhead.

The Problem: Catastrophic Forgetting in Instruction Tuning

Instruction tuning involves training models on {instruction, input, output} triplets to align their behavior with human intent. However, when an LLM is fine-tuned on a sequence of diverse tasks, the weights optimized for new tasks often overwrite the representations necessary for previous ones.

Existing replay methods typically treat all data points as equal or rely on simple random sampling. InsCL challenges this approach by arguing that the instructions themselves serve as high-quality task proxies. These proxies can be used to intelligently guide the replay process, ensuring that the model retains "unique" knowledge that is most at risk of being forgotten.

The InsCL Framework

InsCL introduces two primary innovations to make continual learning more efficient and effective:

1. Dynamic Replay via Wasserstein Distance

Rather than replaying a fixed percentage of data from every historical task, InsCL calculates the similarity between the current task and previous tasks. This is achieved by computing the Wasserstein Distance between instruction embeddings. The Wasserstein Distance provides a robust measure of how much one distribution must be transformed to match another.

Crucially, InsCL employs a dissimilarity-based allocation rule: it allocates more replay data to tasks that are dissimilar to the current task. The intuition is that similar tasks provide a natural form of reinforcement, while dissimilar tasks represent distinct knowledge domains that are more likely to be overwritten by new, unrelated gradients.

2. Instruction Information Metric (InsInfo)

To ensure that the specific data points chosen for replay are of the highest quality, the authors developed the InsInfo metric. The process involves:

  • Intent Tagging: Using GPT-4 to annotate instructions with fine-grained tags (e.g., "Logic Reasoning," "Spelling Check").
  • Complexity Quantification: Calculating a score based on the number and rarity of these tags, utilizing a method similar to the Inverse Document Frequency (IDF) metric used in information retrieval.

By weighting replay sampling toward instructions with high InsInfo scores, InsCL prioritizes complex and diverse examples that offer the most "information gain" for the model.

Experimental Setup

The framework was evaluated using the SuperNI (Super-NaturalInstructions) dataset. The researchers organized 765 English tasks into 16 distinct categories (e.g., Program Execution, Closed QA, Summarization) to simulate a long-term continual learning trajectory. The primary model used for the experiments was LLaMA-7B, tested across various task orders, including Curriculum, Random, and Reverse sequences.

Key Results and Insights

InsCL demonstrated significant improvements in both performance and stability compared to existing baselines:

  • Performance Gains: InsCL achieved a 27.96% relative gain over a "No Replay" baseline and a 3.0% relative gain over standard "Random Replay" methods.
  • Enhanced Stability: While the performance of models without replay plummeted to below 65% after 16 tasks, InsCL maintained performance on previous tasks at over 90%.
  • Anatomy of Forgetting: A manual analysis of 3,000 forgetting instances revealed that complex reasoning tasks (such as Code or Program Execution) are particularly susceptible to "Instruction-Unrelated" forgetting. In these cases, the model does not just fail the specific task but completely loses the ability to follow the required output format or basic logical structure.

Discussion and Limitations

InsCL proves that instructions are a computationally cheap and effective summary of task nature. However, the framework's success is tied to the quality of natural language instructions. Ambiguous or poorly written instructions can lead to inaccurate similarity calculations, potentially degrading the effectiveness of the Wasserstein-based allocation.

Additionally, while the use of GPT-4 for intent tagging is a one-time preprocessing step, it introduces a dependency on proprietary models. Future iterations of InsCL could explore the use of smaller, open-source models to automate the tagging process. Finally, while validated on a 7B parameter model, further research is required to see how these continual learning dynamics scale to models with 70B+ parameters.

Conclusion

InsCL represents a shift toward more intelligent, data-efficient continual learning. By treating instructions as the core signal for task similarity and data quality, InsCL provides a scalable path for maintaining LLM versatility as they are fine-tuned on an ever-expanding array of human knowledge and tasks.

Summary updated

BibTeX
@inproceedings{wang2024inscl,
  author = {Yifan Wang and Yafei Liu and Chufan Shi and Haoling Li and Chen Chen and Haonan Lu and Yujiu Yang},
  title = {{InsCL: A Data-efficient Continual Learning Paradigm for Fine-tuning Large Language Models with Instructions}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.naacl-long.37},
}
Figure