Introduction
Pre-trained Vision-Language Models (VLMs) like CLIP have demonstrated remarkable zero-shot capabilities. However, their performance often degrades when encountering "distributional shifts"—real-world data that differs from the training set, such as recognizing a "car" in a sketch versus a high-resolution photo. Test-Time Adaptation (TTA) aims to mitigate this by updating the model on-the-fly using unlabeled data.
While existing TTA methods typically focus on a single target domain, real-world applications often involve a stream of data from multiple sources simultaneously. This "multi-task TTA" scenario presents unique challenges: models must capture the nuances of individual tasks without suffering from "negative transfer," where learning from one domain inadvertently harms performance in another. To address this, we introduce Hierarchical Knowledge Prompt Tuning (HKPT), a framework designed to balance global consistency with local specialization.
Methodology
HKPT organizes knowledge hierarchically to enable simultaneous adaptation across multiple domains. The architecture is built upon three primary pillars:
1. Multi-View Prompt Distillation
To prevent "model collapse"—a common failure in TTA where self-supervision leads to degenerate solutions—HKPT employs a teacher-student distillation strategy. A large, frozen "Teacher" model (e.g., ViT-L/14) provides a stable reference point. The smaller "Student" model (e.g., ViT-B/16) learns by matching the teacher’s predictions (logits) and internal textual/visual features. This allows the student to inherit broad source-domain knowledge while adapting to new data.
2. Dual Knowledge Graph (DKG)
To handle task-specific details, HKPT constructs a dynamic graph for every task. This DKG consists of a Visual Subgraph, which maintains a memory pool of class-specific image features, and a Textual Subgraph, which models semantic relationships between class labels. Virtual nodes link these subgraphs, facilitating real-time information exchange between visual and textual concepts.
3. Cross-Task Knowledge Sharing
Recognizing that not all tasks are related, HKPT uses an adaptive task grouping strategy. It calculates an "affinity matrix" to identify tasks with complementary knowledge. Similar tasks are grouped to share insights, while unrelated tasks are kept separate to avoid interference.
Experimental Results
HKPT was evaluated across several challenging benchmarks, including Office-Home and MiniDomainNet for multi-task TTA, and various ImageNet variants for out-of-distribution (OOD) robustness.
Performance Benchmarks
In multi-task scenarios, HKPT consistently outperformed state-of-the-art (SOTA) methods. On the MiniDomainNet dataset, HKPT achieved an average accuracy of 87.7%, surpassing the previous best multi-task method (MmAP) by 1.6%. The framework also showed strong "seamless migration" capabilities; despite being optimized for multi-tasking, it beat advanced single-task methods by 2.2% on cross-domain benchmarks and 2.3% on ImageNet OOD benchmarks.
Key Insights
- Hierarchy is Essential: Separating knowledge into task-shared (via distillation) and task-specific (via DKG) components allows the model to maintain mastery over specific domains while benefiting from shared wisdom.
- Dynamic Adaptation: The visual memory pool uses an entropy-based threshold to ensure only "reliable" test samples are added to the internal knowledge base, enhancing stability during adaptation.
Conclusion and Future Work
HKPT sets a new benchmark for multi-task test-time adaptation by effectively managing the trade-off between shared and specific knowledge. While the framework introduces some computational overhead due to the teacher model, its robustness across diverse scenarios makes it a powerful tool for real-world VLM deployment. Future research will explore integrating this hierarchical approach with generative models for data augmentation and optimizing the framework for resource-constrained edge devices.
Summary updated