TL;DR
This paper introduces Generating Prompts in Latent Space (GPLS), a novel method for rehearsal-free continual learning. GPLS treats prompts as latent variables, leveraging variational inference and a Mahalanobis distance-based loss to guide prompt generation, leading to state-of-the-art performance on several benchmarks.
What Problem Does This Paper Address?
Continual learning (CL) aims to enable models to learn new tasks sequentially without forgetting previously acquired knowledge, a phenomenon known as catastrophic forgetting. Prompt-based CL has shown promise by freezing backbone parameters and learning task-specific prompts. However, existing prompt generation methods often lack effective guidance during training, treating prompt generation as a black box. This paper addresses this gap by proposing a principled approach to prompt generation that accounts for prompt uncertainty and provides targeted training signals.
Methods
The core of GPLS lies in treating prompts as latent variables that follow a distribution. This is achieved through a trainable encoder that takes task and feature information as input and outputs the mean ($\mu$) and covariance ($\Sigma$) of a prompt distribution. The reparameterization trick is then used to sample prompts from this distribution.
Key methodological contributions include:
- Latent Variable Prompts: Prompts are modeled as observations from a distribution, capturing their inherent uncertainty. This aligns with how prompts are inserted into hidden layer outputs and implicitly influence classification.
- Variational Inference for Guidance: The paper leverages variational inference to derive an evidence lower bound (ELBO) for prompt generation. This ELBO provides a principled way to guide the training of the prompt encoder.
- Mahalanobis Distance-based Loss: A novel objective function is proposed that incorporates a Mahalanobis distance term. This term encourages prompts to be diverse and well-separated in the latent space, promoting better domain adaptivity.
- Encoder-based Prompt Generation: Instead of directly optimizing prompts, GPLS trains an encoder to generate them. This encoder is trained using the derived ELBO and a matching loss for task identification.
Datasets
The paper evaluates GPLS on the following datasets:
- Split CIFAR-100
- Split DomainNet
- Split Pets
- Split EuroSAT
- Split CropDiseases
Key Insights and Ideas
- Prompts as Latent Variables: Framing prompts as latent variables is a powerful conceptual shift that naturally handles their uncertainty and implicit influence on model behavior. This moves beyond simply optimizing deterministic prompt vectors.
- Variational Inference as a Training Signal: Using the ELBO derived from variational inference provides a theoretically grounded and effective way to train the prompt generator, offering more direct guidance than end-to-end cross-entropy loss alone.
- Mahalanobis Distance for Diversity: The use of Mahalanobis distance in the loss function is crucial for encouraging diverse prompt generation. This helps prevent prompts from collapsing into a single region, leading to better generalization across tasks.
- Encoder's Role in Capturing Task-Specific Nuances: The trainable encoder is key to learning how to map task and feature information into effective prompts, demonstrating its ability to capture subtle differences between tasks.
Key Results
GPLS achieves state-of-the-art performance on various continual learning benchmarks. Specifically:
- On Split CIFAR-100, GPLS achieves an average accuracy of 96.22% and a forgetting rate of 1.12%.
- On Split DomainNet, GPLS achieves an average accuracy of 97.12% and a forgetting rate of 0.51%.
- GPLS consistently outperforms the prompt-generation baseline DAP by significant margins (e.g., 2.17% and 6.62% on Split CIFAR-100 and Split DomainNet respectively) and also reduces forgetting.
- Ablation studies confirm the importance of each component: removing the covariance matrix ($\Sigma$) leads to severe forgetting, highlighting its role in domain adaptation.
Limitations and Future Work
- Prompt Length and Balancing Coefficient: While the paper analyzes the impact of prompt length ($k$) and the balancing coefficient ($\alpha$), finding optimal values might still require hyperparameter tuning. The paper suggests $k=10$ and $\alpha=0.25$ as good starting points based on their experiments.
- Computational Cost: While rehearsal-free, prompt generation methods can still be computationally intensive. The paper doesn't explicitly detail the computational overhead compared to other methods.
- Future Work: The paper implicitly suggests that further exploration of prompt distributions and their interaction with different backbone architectures could be fruitful. The T-SNE visualizations suggest that while GPLS improves prompt separation, further refinement might lead to even clearer task distinctions.
Summary updated