This NeurIPS 2022 paper presents a refreshingly simple solution to a notoriously difficult problem in machine learning: how to keep a model learning new things without it forgetting everything it already knows.
The Problem: Catastrophic Forgetting in Continual Learning
In Continual Learning (CL), models are trained on a sequence of tasks. Standard neural networks suffer from catastrophic forgetting: as they learn a new task, their internal weights shift, and performance on previous tasks plummets.
This paper focuses specifically on Domain Incremental Learning (DIL). In DIL, the set of classes remains the same (e.g., classifying "cat" vs. "dog"), but the domain shifts over time (e.g., first learning from real photos, then from sketches, then from cartoons).
Most existing solutions try to find a shared feature space for all domains or use "exemplars"—a memory buffer of old data used for rehearsal. However, sharing often leads to a "tug-of-war" where new knowledge overwrites the old, and storing exemplars raises significant privacy and memory concerns.
The "Occam's Razor" Solution: S-Prompts
The authors propose S-Prompting (Simple Prompting), a paradigm that abandons the traditional goal of "sharing" knowledge across tasks. Instead of trying to force different domains to coexist in one evolving feature space, they treat them independently.
The Core Mechanism
- Frozen Backbone: The method uses a large, pre-trained transformer (like ViT or CLIP) and keeps its weights completely frozen. This ensures the model's fundamental "understanding" of images never degrades.
- Independent Prompts: For every new domain, the model learns a tiny set of new parameters called "prompts" (learnable tokens added to the input). These prompts are learned independently for each domain, preventing any cross-domain interference.
- Domain Identification: Since the model doesn't know which domain a test image belongs to during inference, the authors use K-Means clustering in the frozen feature space to find "domain centers" during training. At inference, a simple K-NN (K-Nearest Neighbors) check identifies the most likely domain, and the corresponding prompts are plugged in.
Two Concrete Approaches
- S-iPrompts (Image): Uses a Vision Transformer (ViT). It learns a set of image prompts and a domain-specific classifier for each task.
- S-liPrompts (Language-Image): Uses CLIP. This is the paper's flagship approach. It synchronously learns both image prompts and language prompts (contextual text tokens). This leverages CLIP’s dual-modality to create highly separable domain features.
Key Insights and Results
The authors evaluated S-Prompts on three challenging DIL benchmarks: CDDB-Hard (deepfake detection), CORe50 (object recognition), and DomainNet (highly heterogeneous domains).
- Independence over Sharing: The most counter-intuitive insight is that not sharing knowledge is the key to success in DIL. By learning prompts independently, they turn a "zero-sum game" into a "win-win game."
- Massive Performance Gains: S-liPrompts achieved a 30% relative improvement over the best previous exemplar-free methods. Remarkably, it even outperformed state-of-the-art methods that were allowed to use exemplars (storing old data) by about 6% on average.
- High Efficiency: Because prompts are so small, the model only grows by about 0.03% per new domain, making it incredibly efficient for long-term learning. On a single RTX-3090, identifying the domain and running inference takes only ~11.8ms.
- Zero-Shot Generalization: The model showed a strong ability to handle "unseen" domains, significantly outperforming competitors on out-of-distribution data.
Limitations and Future Work
While highly effective for DIL, the authors note that S-Prompts is less effective for Class-Incremental Learning (CIL), where new classes are added over time. In CIL, the boundaries between tasks are more sensitive, and the K-NN domain identification is more likely to fail.
Additionally, the method's success heavily depends on the pre-trained transformer's ability to distinguish domains in its frozen feature space. If two domains are too similar for the backbone to tell apart, the K-NN selector might choose the wrong prompts. Future work will explore adapting this "independent prompting" logic to more complex scenarios where both domains and classes change simultaneously.
Summary updated