Recasting Continual Learning as Sequence Modeling

Soochan Lee, Jaehyeon Son, Gunhee Kim

Abstract

Traditional Continual Learning (CL) relies on Stochastic Gradient Descent (SGD) to update model parameters, a process that frequently leads to "catastrophic forgetting." This paper proposes a paradigm shift: recasting CL as a sequence modeling problem. By utilizing Transformers within a Meta-Continual Learning (MCL) framework, the model learns new tasks through its forward pass—leveraging in-context learning—rather than through weight updates. This approach demonstrates superior scalability, significantly faster training times, and improved performance on large-scale benchmarks compared to traditional SGD-based methods.

Introduction

Continual Learning (CL) is the challenge of learning from a non-stationary stream of data without overwriting previously acquired knowledge. Historically, this has been addressed by using SGD to update model parameters. However, the sequential nature of SGD often causes new information to overwrite the old.

Existing Meta-Continual Learning (MCL) methods attempt to solve this by training a "learner" to update a "model" via an inner loop of SGD updates. While an improvement, this approach faces two major hurdles:

  1. Scalability: Computing meta-gradients through long chains of SGD updates is both memory-intensive and computationally expensive.
  2. Rigidity: Restricting the model to SGD-based learning limits its ability to adapt to complex, non-linear data streams that might require different update rules.

Methods: The Forward Pass as the Learner

The authors propose that CL is inherently a sequence modeling problem. Given a training stream $((x_1, y_1), \dots, (x_T, y_T))$, predicting the label for a new test point $x_n$ is equivalent to predicting the next token in a sequence.

Key Components

  • In-Context Learning: Instead of updating weights during the continual learning phase, the model uses a single forward pass. The Transformer’s attention mechanism acts as the "internal state" that summarizes all previously seen data in the stream.
  • Meta-Training: The model is trained at a "meta-level" across thousands of diverse CL episodes. It learns the underlying logic of how to extract and utilize information from a sequence to make accurate predictions on the fly.
  • Efficient Transformers: To handle the computational demands of long sequences, the framework utilizes Kernel-Based Efficient Transformers (KETs), such as the Linear Transformer and Performer. These reduce computational complexity from $O(T^2)$ to $O(T)$, allowing the model to function similarly to a Recurrent Neural Network (RNN) with a constant-sized internal state.
  • Label Tokenization: To accommodate novel classes during testing, class labels are tokenized into unique codes, mirroring how language models handle expanding vocabularies.

Experimental Evaluation

The framework was evaluated on seven diverse benchmarks, ranging from standard classification to large-scale datasets and regression tasks:

  • Classification: CIFAR-100 and Omniglot.
  • Large-Scale Classification: The authors introduced CASIA (3.9M images of Chinese handwriting) and MS-Celeb-1M (10M face images) to the MCL domain to test high-end scalability.
  • Regression: Tasks included sine wave reconstruction, image rotation prediction, and image completion.

Key Insights and Results

Superior Performance and Scaling

The Transformer-based approach demonstrated a significant leap in accuracy. On the large-scale CASIA benchmark, the model achieved a 0.4% error rate, vastly outperforming the SGD-based OML baseline, which recorded a 3.2% error rate. Furthermore, the performance of these "CL-Transformers" followed a scaling law: accuracy improved consistently as the number of parameters and the volume of meta-training data increased.

Efficiency Gains

By leveraging the parallel processing capabilities of Transformers during meta-training (using causal masks), the proposed method was 5x to 40x faster than sequential SGD baselines. Despite having a higher parameter count, the Transformers often required less GPU memory because they eliminated the need to store the massive computation graphs required for higher-order meta-gradients.

Biological Plausibility and Robustness

The authors note that a forward-pass-only learning mechanism is more aligned with biological neural functions, where fast, minute-to-minute learning likely does not rely on backpropagation. Forgetting analysis showed that these models maintained much higher accuracy on early tasks in a sequence compared to traditional methods, effectively solving the catastrophic forgetting problem within the scope of the sequence.

Limitations and Future Work

While promising, the approach has trade-offs. Efficient variants like Linear Transformers showed a slight drop in accuracy compared to standard "vanilla" Transformers. Additionally, there is a physical limit to how much information can be compressed into the model's recurrent state. Finally, the method relies on a robust meta-training phase; its ability to generalize to entirely out-of-distribution task types without further tuning remains an area for future research.

Conclusion

Recasting continual learning as sequence modeling shifts the burden of adaptation from rigid weight updates to flexible, learned inference. As AI moves toward larger data regimes, this framework offers a viable, scalable, and efficient path forward for building models that truly learn over time.

Summary updated

BibTeX
@inproceedings{lee2023recasting,
  author = {Soochan Lee and Jaehyeon Son and Gunhee Kim},
  title = {{Recasting Continual Learning as Sequence Modeling}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=x816mCbWpR},
}
Figure