Dual Prototype Evolving for Test-Time Generalization of Vision-Language Models

Ce Zhang, Simon Stepputtis, Katia P. Sycara, Yaqi Xie

Introduction

Large-scale Vision-Language Models (VLMs), such as CLIP, have demonstrated remarkable zero-shot capabilities across a wide array of visual recognition tasks. However, these models often encounter significant performance degradation when faced with "distribution shifts"—the gap between their massive pre-training datasets and specific real-world domains like sketches, satellite imagery, or medical scans.

To bridge this gap, researchers have turned to Test-Time Adaptation (TTA), a paradigm where a model adjusts its parameters using the unlabeled stream of data it encounters during inference. Despite their promise, current VLM adaptation methods face three primary hurdles: they are often "forgetful" (resetting after each sample), unimodal (focusing only on text or vision), and computationally expensive due to the need for backpropagation through massive encoders. Dual Prototype Evolving (DPE) is introduced as a novel framework to overcome these limitations by enabling models to accumulate knowledge continuously and efficiently.

The DPE Framework

DPE moves away from transient, per-sample optimization in favor of a "dual-track" approach that evolves the model's understanding of target classes over time.

Dual Prototype Evolution

Instead of relying on static embeddings, DPE maintains and updates class-specific "prototypes"—representative vectors in the embedding space—for both text and vision:

  • Textual Evolution: These prototypes are updated via a cumulative average of optimized text features, allowing the model to refine its linguistic understanding of classes as it sees more data.
  • Visual Evolution: To ensure visual prototypes are built from reliable data, DPE employs a Priority Queue strategy. It stores high-confidence (low-entropy) visual features for each class, ensuring the prototypes are not corrupted by noisy or ambiguous test samples.

Prototype Residual Learning

One of the most significant bottlenecks in TTA is the computational cost of backpropagating through large encoders. DPE bypasses this by introducing small, learnable residuals directly in the embedding space. For every new test sample, the model performs a single optimization step to nudge these residuals rather than tuning the entire encoder or input prompts. This architectural choice allows DPE to remain lightweight and suitable for high-throughput applications.

Optimization and Alignment

The model is optimized using two primary loss functions:

  1. Self-Entropy Minimization: This encourages the model to produce confident predictions across different augmented views of a single image.
  2. Cross-Modal Alignment (InfoNCE): This self-supervised loss forces the textual and visual prototypes of the same class to remain close in the embedding space while pushing different classes apart, leveraging the inherent cross-modal synergy of VLMs.

Experimental Results

The authors evaluated DPE across 15 diverse datasets, covering both natural distribution shifts (e.g., ImageNet-A, -R, -Sketch) and cross-dataset generalization (e.g., Caltech101, EuroSAT, OxfordPets).

  • Superior Accuracy: DPE consistently outperformed existing state-of-the-art methods. On ImageNet distribution shifts, it achieved an average accuracy improvement of 3.55% over TPT. In cross-dataset scenarios, the gain reached 4.30%.
  • Computational Efficiency: DPE is significantly faster than prompt-tuning competitors. It operates roughly 5x faster than TPT and over 10x faster than DiffTPT. While standard CLIP takes approximately 9 minutes to process 50k ImageNet samples, DPE completes the task in under 2 hours—a fraction of the 9+ hours required by TPT.
  • Knowledge Accumulation: Unlike previous methods that plateau, DPE showed steady performance gains as the number of processed samples increased, confirming that the evolving strategy successfully captures and retains task-specific knowledge.

Insights and Future Directions

The success of DPE highlights that TTA should be viewed as an online learning process rather than a series of isolated events. By optimizing in the embedding space and enforcing dual-modal alignment, DPE prevents the model from becoming overconfident in incorrect predictions—a common failure mode in entropy-based adaptation.

While DPE offers a massive speedup, it still requires a gradient update for every test sample, which may be a bottleneck in extreme latency-sensitive environments. Additionally, the memory overhead of maintaining priority queues for thousands of classes (like ImageNet-21K) remains a consideration for future optimization. Future work may explore gradient-free adaptation or the application of dual-prototype strategies to even larger foundational models beyond the CLIP architecture.

Summary updated

BibTeX
@inproceedings{zhang2024dual,
  author = {Ce Zhang and Simon Stepputtis and Katia P. Sycara and Yaqi Xie},
  title = {{Dual Prototype Evolving for Test-Time Generalization of Vision-Language Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=jsgYYXaSiS},
}
Figure