Dual-Modality Anchor-Guided Filtering for Test-Time Prompt Tuning

Jungwon Choi, Eunwoo KimCVPR 2026 Findings 2026

TL;DR

Test-Time Prompt Tuning (TPT) allows vision-language models to adapt to new domains on the fly, but it easily gets derailed by noisy, uninformative image crops. This paper introduces a dual-modality anchor framework that uses LLM-generated text descriptions and dynamic image prototypes to filter out bad views and stabilize prompt updates. The result is a highly robust, lightweight tuning method that achieves state-of-the-art performance across 15 benchmark datasets with virtually zero computational overhead.

What Problem Does This Paper Address?

Vision-Language Models (VLMs) like CLIP are incredibly powerful at zero-shot tasks, but their performance can degrade when faced with "distribution shifts"—unseen domains like sketches, adversarial images, or stylized renditions. Test-Time Prompt Tuning (TPT) fixes this by optimizing learnable prompt tokens directly on unlabeled test data during inference. To do this, TPT generates multiple augmented views (e.g., random crops) of a single test image and minimizes the prediction entropy across them.

However, TPT has a glaring vulnerability: standard image augmentations often generate noisy or uninformative views that miss the target object entirely or over-represent the background. Standard TPT relies on the model's internal confidence (entropy) to filter these views. Unfortunately, under distribution shifts, these confidence scores are often miscalibrated. The model can become highly confident about a completely wrong or empty crop, forcing the prompt to optimize in an incorrect direction, as illustrated below:

Figure 1. An example of how prompt quality varies depending on the selected views. When the (a) selected views are noisy and fail to capture key object features, the prompt is adapted in an incorrect direction, resulting in erroneous predictions. In contrast, (b) infor- mative views containing essential features guide the prompt to- ward the correct semantics, resulting in accurate predictions. This highlights the critical role of robust view selection.

Methods

To ground view selection in actual semantic evidence rather than unreliable confidence scores, the authors propose a Dual-Modality Anchor-Guided Filtering framework.

Figure 2. Overview of the proposed dual-modality anchor framework. The process begins with (a) text anchor construction. Multiple LLM-generated descriptions per class are encoded with the CLIP text encoder, and N augmented images are encoded with the CLIP image encoder. We then compute image–text alignment by measuring cosine similarity and perform alignment-weighted aggregation to form text anchors. Using these anchors, we compute joint alignment–confidence scores to each views and keep the top q% of N augmented views. (b) In the image anchor construction stage, the text-guided selected views are aggregated into a prototype bank that captures the visual distribution. The image anchor set is obtained by collecting the top-K class prototypes. We again compute joint alignment–confidence scores with the image anchors and retain the top p% of N augmented views. The final view set is the union of the two filters.

The method consists of three core components:

  1. Text-Guided Semantic Filtering: Instead of using coarse, generic prompts (like "a photo of a [CLASS]"), the authors use an LLM offline to generate attribute-rich descriptions for each class (e.g., "An aircraft has wide fixed wings, engines, and a streamlined fuselage"). At test time, these descriptions are adaptively weighted and aggregated based on their similarity to the image features, creating a fine-grained text anchor. Views are filtered using a joint score balancing text-anchor alignment and prediction confidence.
  2. Image-Guided Semantic Filtering: To capture visual domain statistics that text descriptions might miss, the framework maintains a class-wise prototype bank that continuously aggregates visual features during inference. The closest class prototypes form an image anchor, which filters out views that are visually inconsistent with how the target classes typically appear in the current test domain.
  3. Adaptive Ensemble & Target Sharpening: Instead of simple self-training on the filtered views, the authors treat the original prompt, the text anchor, and the image anchor as three distinct predictive heads. They combine their outputs using a confidence-weighted ensemble to form a highly stable target distribution. The prompt is then updated by minimizing the KL-divergence against this refined target.

Datasets

The authors evaluated their approach across 15 diverse benchmark datasets:

  • Domain Generalization: ImageNet and four of its distribution-shifted variants: ImageNet-A (adversarial), ImageNet-R (renditions), ImageNet-V2, and ImageNet-Sketch.
  • Cross-Dataset Transfer: 10 downstream datasets covering various specialized domains, including Flower102, DTD (textures), OxfordPets, StanfordCars, UCF101 (action clips), Caltech101, Food101, SUN397 (scenes), FGVC-Aircraft, and EuroSAT (satellite imagery).

Key Insights and Ideas

  • Semantics Over Blind Confidence: Relying solely on low prediction entropy can reinforce a model's existing biases. Grounding view selection in external semantic anchors (text and image) prevents the model from confidently adapting to background noise.
  • Smart Filtering Beats Heavy Augmentation: Prior state-of-the-art methods (like DiffTPT) relied on computationally heavy diffusion models to generate high-quality diverse views. This paper proves that if your selection mechanism is semantically aware, standard, lightweight augmentations (like random cropping) can actually outperform diffusion-based methods.
  • Qualitative Superiority: As shown in the visualization below, entropy-based and cosine-based methods frequently select background-dominated or completely uninformative crops (red boxes). The proposed anchor-guided approach consistently retains semantically faithful, object-focused views (green boxes).
Figure 3. Visualization of views selected by each anchor modal- ity. For each test image, we compare the augmented views selected by the text-guided and image-guided filters with the previous se- lection strategies. Green boxes indicate correctly selected views containing the target object, whereas red boxes mark views where the object is absent or unrecognizable.

Key Results

  • State-of-the-Art Accuracy: The proposed method achieved an average accuracy improvement of 3.36% over all compared methods across the 15 benchmarks. On ImageNet domain generalization, it achieved an out-of-distribution (OOD) average of 64.12%, outperforming vanilla TPT by +3.04%.
  • Synergy with Prompt Learning: When combined with existing prompt learning methods like CoOp and MaPLe, it pushed performance even further, setting a new state-of-the-art cross-dataset average of 69.36%.
  • Negligible Latency Overhead: While diffusion-based methods drastically slow down inference (>0.6 seconds per image), this method maintains a lightning-fast testing time of 0.2 seconds per image, matching vanilla TPT while delivering vastly superior accuracy.
Table 2. Comparison of test-time tuning methods. Accuracy, gain over the CLIP baseline, and test time are reported.

Limitations and Future Work

Not explicitly discussed in detail by the authors. However, two inherent limitations are worth noting:

  1. LLM Dependency: The text anchor generation relies on an offline preprocessing step with a large language model. If the LLM generates poor or inaccurate descriptions for highly niche classes, the text anchor's effectiveness could degrade.
  2. Sequential Drift Risk: The image prototype bank relies on cumulative averaging of test-time embeddings. If the model encounters a massive, continuous sequence of highly ambiguous or misclassified images early in inference, the visual prototypes could theoretically drift, though the text-anchor filtering serves as a strong counter-measure.

Summary updated

BibTeX
@inproceedings{choi2026dual,
  author = {Jungwon Choi and Eunwoo Kim},
  title = {{Dual-Modality Anchor-Guided Filtering for Test-Time Prompt Tuning}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2026},
  url = {https://openreview.net/forum?id=LYFAYf70LI},
}
Figure