TL;DR
CPS-Prompt is a resource-efficient framework designed for prompt-based continual learning directly on edge hardware. By combining task-aware token reduction with a decoupled training strategy, it slashes training-time memory, time, and energy consumption by roughly 1.6× compared to standard baselines while maintaining highly competitive accuracy.
What Problem Does This Paper Address?
Deploying continual learning (CL) systems directly onto edge devices—like home robots, drones, or smartphones—requires models to adapt to new tasks sequentially without forgetting previous ones. Prompt-based continual learning (PCL) has emerged as a powerful solution; it freezes a large pre-trained Vision Transformer (ViT) backbone and only updates lightweight, task-specific "prompts."
However, prior PCL research has focused almost entirely on maximizing accuracy or inference speed, ignoring the massive memory and computational footprint required during on-device training. Storing intermediate activations during backpropagation can easily overwhelm the strict memory limits of edge hardware, causing training failures. While standard ViT token-reduction methods (like dropping or merging image patches) can save memory, they are task-agnostic and often discard critical visual features, severely degrading model accuracy.
Methods
The authors introduce CPS-Prompt, which optimizes the standard two-stage PCL training pipeline through two complementary modules:
- Critical Patch Sampling (CPS): Instead of randomly discarding image patches, CPS leverages the attention maps and value activations from the final block of the frozen query encoder. It calculates a "critical patch score" to identify which parts of the image are most relevant to the current task. Using a temperature-scaled softmax, it stochastically samples a sparse subset of these informative patches to pass into the prompt-injected backbone. This significantly reduces stored activations and peak training memory.
- Decoupled Prompt and Classifier Training (DPCT): Training on sparse patches but evaluating on full images creates a representation mismatch. To fix this, DPCT splits training into two sequential phases:
- Phase 1 (Prompt Training): Jointly optimizes the prompts and the classifier using the sparse patch inputs from CPS.
- Phase 2 (Classifier Alignment): Freezes the prompt parameters and fine-tunes only the classifier using full-patch inputs. Because gradients do not propagate through the backbone or prompt layers in this phase, backpropagation overhead drops sharply.
Datasets
The authors evaluated their approach on three widely used class-incremental learning benchmarks, each partitioned into ten disjoint tasks:
- CIFAR-100
- ImageNet-R
- CUB-200
Crucially, to validate realistic on-device training scenarios, efficiency metrics (memory, time, and energy) were measured directly on real edge hardware: an NVIDIA Jetson Orin Nano.
Key Insights and Ideas
- Task-Awareness is Essential for Sparsity: Task-agnostic token reduction methods like Token Merging (ToMe) fail in continual learning because they accidentally discard task-critical patches. Reusing the query encoder's attention patterns provides an efficient, training-free signal to guide patch selection.
- Stochasticity Beats Determinism: Interestingly, stochastically sampling patches based on importance probabilities outperforms deterministically picking the top-$k$ patches. This controlled randomness acts as a regularizer, encouraging the model to explore diverse features and generalize better to complex images.
- Decoupling Restores Accuracy: Separating prompt training from classifier alignment successfully mitigates the accuracy drop typically caused by input sparsity, while simultaneously shortening wall-clock training time.
Key Results
- Resource Efficiency: When tested on the Jetson Orin Nano, CPS-Prompt achieved a 1.6× improvement in peak memory usage, training time, and energy efficiency over the balanced CODA-Prompt baseline.
- Balanced Trade-offs: CPS-Prompt maintained accuracy within 2% on average of the state-of-the-art C-Prompt method. However, C-Prompt consumes roughly 4.3× more memory and 3.1× longer training times, making it impractical for edge deployment.
- Robustness to High Sparsity: Even under aggressive token reduction (reducing patches by over 60%), CPS-Prompt retained over 90% of its baseline accuracy, far outperforming alternative token-reduction techniques.
Limitations and Future Work
The current implementation of CPS-Prompt relies on a fixed, pre-defined patch-reduction ratio across all tasks and datasets. The authors note that future work will focus on exploring dynamic resource settings, allowing the framework to adaptively adjust its token sparsity based on real-time hardware constraints or varying task complexities. Additionally, they plan to extend this task-aware token sparsity concept to broader, non-vision continual learning scenarios.
Summary updated