Skip to main content
QUICK REVIEW

[Paper Review] Test-Time Prompt Tuning for Zero-Shot Generalization in Vision-Language Models

Manli Shu, Weili Nie|arXiv (Cornell University)|Sep 15, 2022
Multimodal Machine Learning ApplicationsComputer Science112 citations
TL;DR

This paper introduces Test-Time Prompt Tuning (TPT) that optimizes prompts on a single test sample to improve zero-shot generalization for vision-language models like CLIP, using entropy minimization across augmented views with confidence-based filtering.

ABSTRACT

Pre-trained vision-language models (e.g., CLIP) have shown promising zero-shot generalization in many downstream tasks with properly designed text prompts. Instead of relying on hand-engineered prompts, recent works learn prompts using the training data from downstream tasks. While effective, training on domain-specific data reduces a model's generalization capability to unseen new domains. In this work, we propose test-time prompt tuning (TPT), a method that can learn adaptive prompts on the fly with a single test sample. For image classification, TPT optimizes the prompt by minimizing the entropy with confidence selection so that the model has consistent predictions across different augmented views of each test sample. In evaluating generalization to natural distribution shifts, TPT improves the zero-shot top-1 accuracy of CLIP by 3.6% on average, surpassing previous prompt tuning approaches that require additional task-specific training data. In evaluating cross-dataset generalization with unseen categories, TPT performs on par with the state-of-the-art approaches that use additional training data. Project page: https://azshue.github.io/TPT.

Motivation & Objective

  • Enhance zero-shot generalization of CLIP without additional training data or annotations.
  • Develop a test-time objective that aligns predictions across augmented views of a single test image.
  • Introduce confidence selection to remove noisy augmentations during prompt tuning.
  • Demonstrate TPT on image classification under distribution shifts and on context-dependent visual reasoning.
  • Show that TPT matches or exceeds state-of-the-art prompt tuning that uses training data in various settings.

Proposed method

  • Represent the prompt as a learnable text embedding and optimize it at test time.
  • Generate N augmented views of the test image and minimize the marginal entropy of predictions across views.
  • Apply confidence selection by discarding augmented views with high self-entropy based on a percentile threshold.
  • For Bongard-HOI visual reasoning, learn both the prompt and binary label tokens from support images without using query annotations.
  • TPT uses the CLIP framework, focusing on updating only the text prompt to preserve zero-shot abilities.
  • One-step prompt optimization with AdamW on a single test example.

Experimental results

Research questions

  • RQ1Can test-time prompt tuning improve zero-shot CLIP performance under natural distribution shifts without any training data?
  • RQ2How does TPT compare to few-shot prompt tuning methods on cross-dataset generalization and unseen categories?
  • RQ3Can TPT be effectively extended to context-dependent visual reasoning tasks like Bongard-HOI without training data?
  • RQ4What is the impact of confidence-based view selection on prompt-tuning effectiveness?

Key findings

  • TPT improves zero-shot top-1 accuracy of CLIP by 3.6% on average over natural distribution shifts compared to hand-crafted prompts.
  • TPT matches or surpasses state-of-the-art prompt tuning methods that require downstream training data in several settings.
  • TPT achieves up to 6.9% improvement on ImageNet-A over hand-crafted prompts.
  • In cross-dataset generalization, TPT attains on-par performance with few-shot methods without using training data.
  • For Bongard-HOI visual reasoning, TPT outperforms the state-of-the-art by 4.1%.
  • Confidence selection helps suppress noisy augmentations and boosts entropy minimization efficacy.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.