Learn Continually, Generalize Rapidly: Lifelong Knowledge Accumulation for Few-shot Learning

Xisen Jin, Bill Yuchen Lin, Mohammad Rostami, Xiang Ren

Abstract

This paper introduces CLIF (Continual LearnIng of Few-shot Learners), a framework designed to enable AI models to accumulate knowledge over a stream of diverse tasks, thereby enhancing their ability to generalize to new tasks rapidly. We propose BiHNet+Reg, a bi-level hypernetwork approach that generates task-specific adapters while employing regularization to mitigate catastrophic forgetting. Experimental results on two large-scale benchmarks, CLIF-26 and CLIF-55, demonstrate that our approach significantly outperforms standard continual learning and few-shot baselines.

Introduction: Bridging Continual and Few-Shot Learning

In the pursuit of "General Linguistic Intelligence," two research fields have largely remained siloed. Few-Shot Learning (FSL) focuses on generalizing to new tasks from minimal examples using static, pre-trained models. Conversely, Continual Learning (CL) aims to learn a sequence of tasks without forgetting previous ones.

However, human learning is synergistic: we leverage past experiences to become faster at acquiring new skills. This paper bridges the gap by proposing the CLIF framework, which asks: Can a model learn continually to generalize more rapidly?

Overview of the CLIF framework, showing the transition from sequential training on upstream tasks to evaluation on both seen and unseen downstream tasks.

The CLIF Framework and Methodology

The CLIF setup involves a model encountering a sequence of "upstream" tasks (e.g., GLUE tasks) one by one. The model must learn these without revisiting previous data. Evaluation is then conducted on "Few-Shot Performance"—the speed and accuracy of adaptation to entirely unseen "downstream" tasks.

BiHNet+Reg: Bi-level Hypernetworks with Regularization

To address the challenges of CLIF, we propose BiHNet+Reg. This architecture moves beyond standard fine-tuning by utilizing:

  1. Adapter-Based Architecture: Small MLP layers (adapters) are inserted into a transformer model (e.g., BART). Only these adapters are updated, preserving the core pre-trained knowledge.
  2. Hypernetwork Generation: A hypernetwork ($g$) is trained to generate the adapter weights based on task representations, providing a layer of abstraction.
  3. Bi-level Task Representations: The model generates "High-resource" embeddings (averaging all task examples) for stability during training and "Few-shot" embeddings (averaging $K$ examples) to simulate the evaluation environment.
  4. Regularization: An $L_2$ penalty is applied to the hypernetwork to ensure that learning new tasks does not drastically alter the weight generation logic for previous tasks.
Comparison of Vanilla CL, Memory-Based CL (MbPA++), and the proposed HyperCL (BiHNet+Reg) architecture featuring bi-level task representations and adapter generation.

Experimental Setup and Benchmarks

We developed two benchmarks to evaluate the framework:

  • CLIF-26: Comprising 9 GLUE tasks for upstream training and 17 DivFSL tasks for downstream evaluation.
  • CLIF-55: A larger scale benchmark with 45 upstream and 10 downstream tasks from the HuggingFace library.

All tasks are unified into a sequence-to-sequence question-answering format, enabling a single model to handle diverse objectives like classification and NLI without architectural changes.

Key Insights and Results

  • Generalization vs. Forgetting: Interestingly, while catastrophic forgetting severely impacts performance on old tasks, its effect on generalization is less pronounced. In some instances, minor forgetting prevents overfitting to specific upstream tasks, aiding flexibility.
  • Superior Performance: BiHNet+Reg achieved a few-shot accuracy of 60.09% on CLIF-26, significantly higher than the 52.66% of a zero-knowledge baseline.
  • Retention of Knowledge: While vanilla BART models saw performance on early tasks drop to ~19% after the full sequence, BiHNet+Reg maintained 77.22% accuracy on seen tasks.
  • Efficiency: By optimizing the hypernetwork's hidden dimensions, we reduced trainable parameters from 139M to 40M without sacrificing performance.

Limitations and Future Directions

Despite its success, BiHNet+Reg still faces a "capacity gap" compared to models fine-tuned on the entire transformer (BART-Single). Future work will explore expanding adapter capacity, handling blurry task boundaries in real-world lifelong learning, and incorporating unlabeled data streams to further refine model performance.

Summary updated

Abstract

The ability to continuously expand knowledge over time and utilize it to rapidly generalize to new tasks is a key feature of human linguistic intelligence. Existing models that pursue rapid generalization to new tasks (e.g., few-shot learning methods), however, are mostly trained in a single shot on fixed datasets, unable to dynamically expand their knowledge; while continual learning algorithms are not specifically designed for rapid generalization. We present a new learning setup, Continual Learning of Few-Shot Learners (CLIF), to address the challenges of both learning settings in a unified setup. CLIF assumes a model learns from a sequence of diverse NLP tasks arriving sequentially, accumulating knowledge for improved generalization to new tasks, while also retaining performance on the tasks learned earlier. We examine how the generalization ability is affected in the continual learning setup, evaluate a number of continual learning algorithms, and propose a novel regularized adapter generation approach. We find that catastrophic forgetting affects generalization ability to a less degree than performance on seen tasks; while continual learning algorithms can still bring considerable benefit to the generalization ability.
BibTeX
@inproceedings{jin2021learn,
  author = {Xisen Jin and Bill Yuchen Lin and Mohammad Rostami and Xiang Ren},
  title = {{Learn Continually, Generalize Rapidly: Lifelong Knowledge Accumulation for Few-shot Learning}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2021},
  doi = {10.18653/v1/2021.findings-emnlp.62},
}
Figure