Convolutional Prompting meets Language Models for Continual Learning

Anurag Roy, Riddhiman Moulick, Vinay Kumar Verma, Saptarshi Ghosh, Abir DasCVPR 2024

Abstract

Continual Learning (CL) enables machine learning models to learn from continuously shifting data streams without forgetting previously acquired knowledge. While pretrained Vision Transformers (ViT) combined with prompt tuning have shown promise in overcoming catastrophic forgetting, existing methods often suffer from inefficient knowledge sharing and high parameter overhead. We introduce ConvPrompt, a novel framework that utilizes convolutional kernels to generate task-specific prompts from shared embeddings. By leveraging Large Language Models (LLMs) to measure task similarity and dynamically adjust prompt allocation, ConvPrompt achieves state-of-the-art performance with significantly reduced computational costs. Our experiments demonstrate a ~3% accuracy improvement over existing methods while utilizing 60% fewer trainable parameters.

Introduction

In the field of machine learning, Continual Learning (CL) represents the challenge of learning new tasks sequentially without experiencing "catastrophic forgetting." Recent advancements have pivoted toward "rehearsal-free" methods, which avoid storing old data due to privacy or storage constraints. These methods typically employ prompt tuning, attaching small learnable vectors to a frozen, pre-trained Vision Transformer (ViT) backbone.

However, current state-of-the-art (SOTA) prompt-based methods, such as CODA-Prompt and DualPrompt, face two primary limitations:

  1. Rigidity: They often assign a fixed number of prompts to every task, leading to redundancy when tasks are similar and overfitting when they are not.
  2. Efficiency: They frequently require multiple forward passes or significant parameter overhead to determine which prompts to activate for a given input.

ConvPrompt addresses these issues by reimagining prompt generation through convolutional operations and semantic guidance from LLMs.

Methodology

ConvPrompt introduces three core innovations to the prompt-tuning paradigm:

1. Convolutional Prompt Generation

Rather than learning independent prompt vectors for each task, ConvPrompt maintains a shared embedding matrix across all tasks. For each new task, the model learns small convolutional kernels. These kernels slide over the shared embeddings to produce task-specific prompts. This architecture allows the model to capture "common concepts" within the shared embeddings while the kernels extract the specific features necessary for the current task, facilitating better knowledge transfer.

2. Language-Guided Task Similarity

To overcome the inefficiency of fixed prompt counts, ConvPrompt utilizes GPT-3 to generate fine-grained text descriptions of visual attributes for each class (e.g., describing a "bee" via attributes like "yellow stripes" or "transparent wings"). By comparing the BERT embeddings of these descriptions between new and historical tasks, the model calculates a semantic similarity score. If a new task is highly similar to a previous one, ConvPrompt dynamically reduces the number of new kernels learned, preventing parameter explosion and leveraging existing knowledge.

3. Single-Pass Prompt Weighting

Existing methods often require a full forward pass just to calculate prompt weights. ConvPrompt optimizes this by using the [cls] token from each layer to weight the prompts for the subsequent layer. This enables the model to process an image in a single pass, significantly reducing inference latency.

Experimental Results

Benchmarks

The framework was evaluated on three standard CL benchmarks:

  • Split CIFAR-100: 100 classes split into 10 sequential tasks.
  • ImageNet-R: A 200-class subset containing various artistic styles, split into 5, 10, and 20 tasks.
  • CUB-200: A fine-grained dataset of 200 bird species, testing the model's ability to distinguish between highly similar categories.

Performance and Efficiency

ConvPrompt consistently outperformed existing SOTA methods across all metrics:

  • Accuracy: On the 10-task ImageNet-R benchmark, ConvPrompt achieved 77.86% average accuracy, significantly higher than CODA-Prompt (74.24%) and DualPrompt (68.50%).
  • Parameter Efficiency: The model required only 2.2% additional trainable parameters relative to the backbone, compared to 4.6% for CODA-Prompt.
  • Computational Overhead: ConvPrompt reduced inference complexity to 17.98B MACs (Multiply-Accumulate operations), nearly half of the 33.72B MACs required by CODA-Prompt.
  • Fine-Grained Learning: On the CUB-200 dataset, ConvPrompt improved the SOTA by nearly 6%, validating the effectiveness of language-guided similarity in distinguishing closely related tasks.

Discussion and Insights

Convolution as an Inductive Bias: The use of convolution forces the model to learn how to compose prompts from a shared knowledge pool rather than simply memorizing vectors. This structured approach proves more robust for sequential learning.

Semantic Similarity: Using LLMs to derive a "semantic summary" of a task is computationally negligible compared to traditional feature statistics methods, yet it provides a powerful signal for dynamic resource allocation.

Layer-Specific Utility: Ablation studies revealed that applying prompts to the first seven layers of the ViT is the optimal configuration. Deeper layers, which handle high-level abstract features, showed stagnating or declining performance when prompted, suggesting that prompt-based intervention is most effective at mid-level feature extraction.

Conclusion

ConvPrompt represents a significant step forward in rehearsal-free continual learning. By combining convolutional prompt generation with LLM-based semantic guidance, the framework achieves superior accuracy while maintaining a low parameter and computational footprint. Future work may explore the robustness of this method in niche domains where LLM descriptions might be less accurate, such as medical or satellite imagery, and investigate methods for kernel merging to further enhance scalability.

Summary updated

BibTeX
@inproceedings{roy2024convolutional,
  author = {Anurag Roy and Riddhiman Moulick and Vinay Kumar Verma and Saptarshi Ghosh and Abir Das},
  title = {{Convolutional Prompting meets Language Models for Continual Learning}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2024},
  url = {https://openreview.net/forum?id=3ygSPVR94g},
}
Figure