Towards a General Framework for Continual Learning with Pre-training

Liyuan Wang, Jingyi Xie, Xingxing Zhang, Hang Su, Jun Zhu

TL;DR

Continual learning typically struggles when adapting pre-trained models to diverse downstream tasks or non-supervised pre-training paradigms. This paper establishes a theoretical framework that decomposes the continual learning objective into three sub-problems—within-task prediction (WTP), task-identity inference (TII), and task-adaptive prediction (TAP)—and optimizes them explicitly via parameter-efficient fine-tuning (PEFT) and representation statistics. Furthermore, the authors demonstrate that moving beyond prompt tuning to weight-modifying PEFT (like LoRA) enables "upstream continual learning," allowing the model's core backbone to accumulate transferable knowledge over time.

What Problem Does This Paper Address?

Adapting pre-trained vision models (e.g., Vision Transformers) to a sequence of tasks has recently relied heavily on prompt-based parameter-efficient fine-tuning (such as L2P and DualPrompt). While effective under standard supervised pre-training on ImageNet-21K, these methods suffer from significant limitations:

  1. Brittleness across settings: Their performance deteriorates when moving to self-supervised pre-training (e.g., iBOT) or fine-grained downstream domains.
  2. Backbone stagnation ("Upstream" learning): Prompt-based methods freeze the backbone entirely and steer intermediate activations via learnable prefixes. Consequently, the backbone itself never incorporates or enriches its general knowledge from incremental experiences, preventing positive backward/forward transfer to subsequent unseen domains.

Methods

The authors provide a theoretical formulation decomposing the class-incremental learning (CIL) cross-entropy objective into three hierarchical components:

  • Within-Task Prediction (WTP): Distinguishing classes within the currently active task.
  • Task-Identity Inference (TII): Determining which task a sample belongs to, using unadapted backbone representations.
  • Task-Adaptive Prediction (TAP): Separating classes across all tasks observed so far.
Input x ---> Backbone f_θ ---> Unadapted Reps ---> Auxiliary Head h_ω (TII) ---> Predicted Task i
                                     |
                                     v
                        Task-Specific PEFT e_i (WTP)
                                     |
                                     v
                           Adapted Reps ---> Output Head h_ψ (TAP) ---> Final Class y

To optimize these components efficiently without storing raw replay samples:

  • WTP with Contrastive Regularization: Task-specific PEFT parameters ($e_t$, implemented via Prompts or LoRA) are initialized from $e_{t-1}$. In addition to cross-entropy on task $t$, a contrastive regularization loss penalizes newly adapted embeddings if they overlap with cached mean centroids ($\mu_c$) of previous tasks.
  • TII via Auxiliary Classifier: An auxiliary head $\hat{h}_\omega$ is trained to predict task IDs using pseudo-representations sampled from Gaussian approximations around $K$-nearest neighbor (KNN) centroids of unadapted representations ($\hat{G}_c$).
  • TAP via Unified Classifier: The final classification head $h_\psi$ is trained on pseudo-representations sampled from the distribution of adapted representations ($G_c$) across all seen classes.
  • Upstream Knowledge Accumulation: By adopting LoRA instead of prompt vectors, task updates can be accumulated back into the backbone weights to benefit future zero/few-shot adaptation.

Datasets

The authors evaluated their framework across several standard benchmarks:

  • Pre-training: Supervised ImageNet-21K (Sup-21K) and self-supervised ImageNet-21K (iBOT-21K), using a ViT-B/16 backbone.
  • Downstream CIL Benchmarks:
  • Split ImageNet-R (200 classes split into 10 incremental tasks).
  • Split CUB-200 (200 fine-grained bird classes split into 10 tasks).
  • Upstream / Few-Shot Evaluation: $N$-way $K$-shot (5-way 1-shot and 5-way 5-shot) tasks drawn from remaining unseen classes of Split ImageNet-R, Split CUB-200, and a combined cross-domain benchmark mixing CUB-200 and Cars-196.

Key Insights and Ideas

  • Sufficient & Necessary Bounds: The authors prove that controlling the errors of WTP, TII, and TAP guarantees an upper bound on overall continual learning error (Theorem 1), and conversely, any well-performing model implicitly minimizes all three (Theorem 2).
  • Preventing Feature Collapse Without Replay: Contrastive regularization between new embeddings and stored centroids of old tasks prevents adapted representations from interfering with prior task distributions.
  • Prompts vs. LoRA for Knowledge Accumulation: Prompts merely direct intermediate token flow, leaving the foundation model static. LoRA adapts weight matrices directly, allowing downstream task exposure to genuinely enrich the backbone's representations for downstream few-shot transfer.
  • Neuroscience Parallels: Sequential inference (first querying unadapted representations to route the task, then invoking task-specific adapted representations) mirrors biological memory indexing, where non-memory cell populations route signals to switch specific memory engrams on or off.

Key Results

  • Superiority in Challenging Regimes (Downstream CIL):
  • Under self-supervised pre-training (iBOT-21K) on Split CUB-200, prior prompt methods collapsed (DualPrompt: 41.46% Final Average Accuracy; CODA-Prompt: 47.79%). In contrast, Ours-Prompt achieved 72.27% and Ours-LoRA achieved 71.75%.
  • On Split ImageNet-R with iBOT-21K, the proposed approach achieved 70.94% FAA (LoRA), outperforming CODA-Prompt (61.22%) by nearly 10 percentage points.
  • Catastrophic forgetting was dramatically reduced: on Sup-21K Split ImageNet-R, Ours-Prompt dropped forgetting (FFM) to 0.95% (vs. 5.17% for CODA-Prompt and 7.51% for L2P).
  • Enabling Upstream Continual Learning:
  • In 5-way 1-shot transfer on Split ImageNet-R (Sup-21K), Ours-LoRA reached 67.00% accuracy, compared to only 49.88% when using prompt-based methods with a static backbone.
  • On iBOT-21K Split CUB-200 (5-way 1-shot), Ours-LoRA achieved 53.63% vs. 36.50% for the prompt version.

Limitations and Future Work

  • Dependence on Density Approximations: Storing class-specific Gaussian statistics around KNN centroids requires tracking representation means, which adds mild memory overhead compared to strictly zero-exemplar setups.
  • Weight Accumulation Overhead: While LoRA allows backbone parameters to absorb task knowledge, updating shared LoRA weights across vastly disparate datasets requires explicit dataset routing mechanisms.
  • Broadening Scope: Extending this hierarchical paradigm beyond classification to complex vision-language, multimodal generation, and open-ended embodied agents remains an open frontier.

Summary updated

BibTeX
@inproceedings{wang2023towards,
  author = {Liyuan Wang and Jingyi Xie and Xingxing Zhang and Hang Su and Jun Zhu},
  title = {{Towards a General Framework for Continual Learning with Pre-training}},
  booktitle = {IMOL @ NeurIPS},
  year = {2023},
  url = {https://openreview.net/forum?id=scD9otIPoF},
}

Loading related content...

Figure