TL;DR
Continual learning models often suffer from "catastrophic forgetting," where learning new tasks erases knowledge of old ones. While prompt-based methods help by storing task knowledge in learnable parameters, current techniques either cannot be optimized end-to-end or rely on continuous prompts that lack conceptual clarity. This paper introduces VQ-Prompt, a novel approach that uses Vector Quantization to train discrete prompts end-to-end, achieving state-of-the-art performance by better mimicking how human memory categorizes distinct concepts.
The Challenge of Prompt Selection in Continual Learning
In Class-Incremental Learning (CIL), an AI model must learn a sequence of new classes over time without forgetting previously learned ones. A highly successful recent strategy is prompt-based continual learning. Instead of updating an entire pre-trained Vision Transformer (ViT), the model is frozen, and small sets of learnable parameters—called "prompts"—are trained to guide the model for specific tasks.
However, a major dilemma exists in how the model selects the right prompt for a given image:
- Hard/Discrete Selection: The model predicts an index to select a specific prompt. Because indexing is non-differentiable, you cannot optimize the selection process directly using standard backpropagation (task loss). This leads to sub-optimal prompt choices.
- Soft/Continuous Selection: To make the process differentiable, recent methods blend multiple prompts together into a continuous, weighted average. However, continuous prompts smear knowledge together. They lack the sharp, discrete abstraction needed to separate distinct tasks—much like how human memory relies on distinct concepts rather than a continuous blur.
The authors tackle this exact gap: How can we optimize prompt selection end-to-end with task loss while keeping the prompts strictly discrete?
Introducing VQ-Prompt
To achieve differentiable, discrete prompting, the authors propose Vector Quantization Prompting (VQ-Prompt).
The pipeline works as follows:
- Continuous Prompt Formation: Given an input image, the model generates a query and computes similarity scores against a set of learnable "keys." These scores are used to create a weighted sum of a prompt pool, forming a continuous prompt.
- Vector Quantization (Nearest-Neighbor): The continuous prompt is then "snapped" to the closest discrete prompt in the predefined prompt pool. This discrete prompt is what actually gets fed into the frozen ViT.
- Gradient Estimation: Because the snapping step (an
argminoperation) is non-differentiable, the authors use a Straight-Through Estimator (STE). During backpropagation, the gradients from the discrete prompt are simply copied over to the continuous prompt, allowing the entire network to update. - VQ Regularization: To ensure the prompt pool actually learns meaningful representations, the authors add a VQ loss (pulling the discrete prompts toward the continuous ones) and a commitment loss (forcing the continuous prompts to commit to the discrete ones).
- Classifier Bias Mitigation: To prevent the model's final classification layer from becoming biased toward the most recently learned classes, the authors use the statistical mean and variance of past classes to generate pseudo-features, fine-tuning the classifier to keep it balanced.
Key Insights
- Discrete > Continuous for Memory: The authors argue (and empirically prove) that discrete prompts are superior for continual learning. They act like distinct memory slots, preventing new tasks from interfering with old ones. This aligns with cognitive science theories of "categorical perception," where humans perceive sensory inputs as distinct categories rather than continuous spectrums.
- VQ Beats "Temperature Scaling": A common trick to make a soft selection act like a hard selection is to lower the temperature of the softmax function. The authors tested this and found it performs worse than VQ. Low-temperature softmax forces the model to make aggressive, hard choices too early in training when it isn't confident yet. VQ allows smooth probability learning while still enforcing a hard discrete output.
- High Parameter Efficiency: Because discrete prompts capture abstract concepts so effectively, VQ-Prompt requires fewer prompting parameters (e.g., a pool of just 10 prompts of length 8) compared to other SOTA methods, while still achieving better accuracy.
Experimental Results
The authors evaluated VQ-Prompt on several challenging class-incremental learning benchmarks, including ImageNet-R, Split CIFAR-100, and Split CUB-200. VQ-Prompt consistently outperformed state-of-the-art prompt-based methods (like L2P, DualPrompt, CODA-Prompt, and EvoPrompt) across the board.
- ImageNet-R (10-task): VQ-Prompt achieved a Final Average Accuracy (FAA) of 78.71%, beating the previous best (EvoPrompt at 76.83%).
- Split CIFAR-100 (10-task): Achieved an FAA of 88.73%, again outperforming EvoPrompt (87.97%).
- Split CUB-200 (10-task): Achieved an FAA of 86.72%, proving its efficacy on fine-grained, specialized datasets.
- Robustness to Pre-training: The method proved highly effective not just with standard supervised pre-training, but also when using self-supervised ViT backbones like DINO and iBOT.
Limitations and Future Work
Like all prompt-based CL methods, VQ-Prompt relies heavily on large pre-trained models. It inherits any biases present in the pre-training data and carries the computational overhead of running a full ViT. Furthermore, the current mathematical formulation doesn't stop the model from overusing a few "favorite" prompts while ignoring others in the pool.
For future work, the authors suggest introducing constraints on prompt selection—for example, penalizing the reuse of prompts that have already been heavily utilized by previous tasks. This would force the model to diversify its memory allocation and potentially improve capacity for longer sequences of tasks.
Summary updated