[Paper Review] Align Your Prompts: Test-Time Prompting with Distribution Alignment for Zero-Shot Generalization
PromptAlign adds test-time token distribution alignment to multi-modal prompting for CLIP, combining distribution alignment with entropy minimization to improve zero-shot generalization under domain shifts and across datasets.
The promising zero-shot generalization of vision-language models such as CLIP has led to their adoption using prompt learning for numerous downstream tasks. Previous works have shown test-time prompt tuning using entropy minimization to adapt text prompts for unseen domains. While effective, this overlooks the key cause for performance degradation to unseen domains -- distribution shift. In this work, we explicitly handle this problem by aligning the out-of-distribution (OOD) test sample statistics to those of the source data using prompt tuning. We use a single test sample to adapt multi-modal prompts at test time by minimizing the feature distribution shift to bridge the gap in the test domain. Evaluating against the domain generalization benchmark, our method improves zero-shot top- 1 accuracy beyond existing prompt-learning techniques, with a 3.08% improvement over the baseline MaPLe. In cross-dataset generalization with unseen categories across 10 datasets, our method improves consistently across all datasets compared to the existing state-of-the-art. Our source code and models are available at https://jameelhassan.github.io/promptalign.
Motivation & Objective
- Motivate addressing distribution shift between pretraining and test distributions in vision-language models.
- Extend test-time prompt tuning to explicitly align token distributions using a proxy source dataset.
- Demonstrate that combining distribution alignment with entropy minimization yields stronger zero-shot generalization.
- Show that ImageNet can serve as a practical proxy source dataset for CLIP-like models in distribution alignment.
- Evaluate PromptAlign on domain generalization and cross-dataset benchmarks to establish state-of-the-art performance.
Proposed method
- Use multi-modal prompt learning (MaPLe) to update prompts on both text and vision branches.
- Generate multiple augmented views per test sample and compute layer-wise token distributions (mean and variance) of prompted image tokens.
- Compute offline source distribution statistics from a proxy dataset (ImageNet) for each visual transformer layer.
- Minimize a joint loss: entropy of predictions (per-view ensemble) and L1 token distribution alignment between test-view statistics and proxy source statistics across layers.
- Optimize prompts with AdamW to balance entropy and alignment losses (β controls alignment weight).
Experimental results
Research questions
- RQ1Can test-time prompt tuning be enhanced by explicitly aligning test-token distributions with a proxy source distribution?
- RQ2Does combining token distribution alignment with entropy minimization improve zero-shot generalization under domain shifts?
- RQ3Is ImageNet a viable proxy source dataset for CLIP-like models in distribution alignment at test time?
- RQ4How does PromptAlign perform in domain generalization and cross-dataset transfer compared to existing prompt-learning methods?
Key findings
- PromptAlign improves zero-shot top-1 accuracy beyond MaPLe by 3.08% on average in domain generalization.
- PromptAlign achieves the highest average Top-1 accuracy across ImageNet variants compared to prior methods (Table 2 shows MaPLe 60.28, MaPLe+TPT 62.31, PromptAlign 63.55).
- In cross-dataset generalization, PromptAlign consistently improves across 10 datasets and outperforms MaPLe+TPT with an average gain of 0.71% over prior best.
- Across cross-datasets, PromptAlign attains an average 66.92% Top-1 vs. MaPLe 66.30% and MaPLe+TPT 66.50% (Table 4).
- Using ImageNet as proxy source data yields effective distribution alignment and robust generalization.
- Ablations show that combining entropy with token distribution alignment yields the best performance, while higher-order statistics provide limited gains.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.