[Paper Review] Learning to Prompt for Continual Learning
This paper proposes L2P, a novel continual learning method that uses a learnable prompt pool to dynamically instruct a frozen pre-trained model on sequential tasks, eliminating the need for rehearsal buffers or task identity at test time. L2P achieves state-of-the-art performance across multiple benchmarks, including in challenging task-agnostic settings, by jointly optimizing task-invariant and task-specific knowledge through a query-based prompt selection mechanism.
The mainstream paradigm behind continual learning has been to adapt the model parameters to non-stationary data distributions, where catastrophic forgetting is the central challenge. Typical methods rely on a rehearsal buffer or known task identity at test time to retrieve learned knowledge and address forgetting, while this work presents a new paradigm for continual learning that aims to train a more succinct memory system without accessing task identity at test time. Our method learns to dynamically prompt (L2P) a pre-trained model to learn tasks sequentially under different task transitions. In our proposed framework, prompts are small learnable parameters, which are maintained in a memory space. The objective is to optimize prompts to instruct the model prediction and explicitly manage task-invariant and task-specific knowledge while maintaining model plasticity. We conduct comprehensive experiments under popular image classification benchmarks with different challenging continual learning settings, where L2P consistently outperforms prior state-of-the-art methods. Surprisingly, L2P achieves competitive results against rehearsal-based methods even without a rehearsal buffer and is directly applicable to challenging task-agnostic continual learning. Source code is available at https://github.com/google-research/l2p.
Motivation & Objective
- To address catastrophic forgetting in continual learning without relying on rehearsal buffers or known task identities at test time.
- To develop a succinct, intelligent episodic memory system that stores knowledge more efficiently than data buffering.
- To enable effective knowledge transfer and minimize interference between diverse tasks in sequential learning.
- To design a prompt-based framework that allows a single frozen backbone to adapt to new tasks via dynamic, instance-wise prompt selection.
- To demonstrate effectiveness in task-agnostic continual learning, where task boundaries are unknown during inference.
Proposed method
- L2P maintains a shared prompt pool of learnable parameters, where each prompt encodes task-specific or shared knowledge.
- A query mechanism dynamically selects a subset of prompts based on input features, using learnable keys to guide retrieval.
- The prompt pool is jointly optimized with the supervised loss, enabling the model to learn task-invariant and task-specific knowledge simultaneously.
- Prompts are prepended to input embeddings, acting as conditional instructions to guide the frozen backbone's predictions.
- A diversified prompt selection strategy reduces interference between unrelated tasks by limiting cross-task prompt sharing.
- The method uses a key-value memory structure where keys are learnable and used to retrieve relevant prompts based on input features.
Experimental results
Research questions
- RQ1Can a prompt-based memory system replace traditional rehearsal buffers in continual learning while maintaining performance?
- RQ2Can a single frozen model be effectively guided by dynamic, instance-wise prompt selection without requiring task identity at test time?
- RQ3How can prompts be designed to encode both task-invariant and task-specific knowledge to reduce catastrophic forgetting?
- RQ4To what extent can prompt-based learning generalize to task-agnostic continual learning, where task boundaries are unknown?
- RQ5How do hyperparameters such as prompt pool size, prompt length, and selection size affect model performance and knowledge retention?
Key findings
- L2P outperforms all prior state-of-the-art methods on standard class-incremental and domain-incremental benchmarks, including settings with no rehearsal buffer.
- In the task-agnostic setting, L2P achieves the best performance even without a rehearsal buffer, surpassing methods that rely on buffer-based or task-identity-dependent mechanisms.
- Removing the prompt pool and using a single prompt leads to a significant performance drop, confirming the importance of a shared, multi-prompt memory system.
- Learnable keys in the prompt retrieval mechanism are critical—replacing them with mean prompts degrades performance, indicating their role in decoupling query and prompt learning.
- The diversified prompt selection strategy improves performance on diverse datasets like 5-datasets by reducing interference between unrelated tasks.
- Optimal prompt length and pool size are crucial: too small a prompt length harms performance, while larger pool sizes improve results, especially when tasks are diverse.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.