Align Your Prompts: Test-Time Prompting with Distribution Alignment for Zero-Shot Generalization

Jameel Hassan, Hanan Gani, Noor Hussein, Muhammad Uzair Khattak, Muzammal Naseer +2 more
2/12/2026

No official code found. Best implementation: jameelhassan/PromptAlign (107 stars, last commit 2024-02-11).

Abstract

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.

View on arXivView PDF

Code Implementations(1)

[NeurIPS 2023] Align Your Prompts: Test-Time Prompting with Distribution Alignment for Zero-Shot Generalization

10713Shell, PythonNov 2, 20232 years ago

Similar Papers

Cite this paper

@article{hassan2026align,
  title  = {Align Your Prompts: Test-Time Prompting with Distribution Alignment for Zero-Shot Generalization},
  author = {Jameel Hassan and Hanan Gani and Noor Hussein and Muhammad Uzair Khattak and Muzammal Naseer and F. Khan and Salman H. Khan},
  year   = {2026},
  eprint = {2311.01459},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2311.01459},
  journal = {NEURIPS 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2311.01459.svg)](https://codeofpaper.com/paper/2311.01459)

Discussion