Just Shift It: Test-Time Prototype Shifting for Zero-Shot Generalization with Vision-Language Models

Elaine Sui, Xiaohan Wang, Serena Yeung-Levy
3/19/2024
cs.CVcs.AIcs.LG

No official code found. Best implementation: elaine-sui/TPS (24 stars, MIT, last commit 2025-12-15).

Abstract

Advancements in vision-language models (VLMs) have propelled the field of computer vision, particularly in the zero-shot learning setting. Despite their promise, the effectiveness of these models often diminishes due to domain shifts in test environments. To address this, we introduce the Test-Time Prototype Shifting (TPS) framework, a pioneering approach designed to adapt VLMs to test datasets using unlabeled test inputs. Our method is based on the notion of modulating per-class prototypes in the shared embedding space. By pre-computing and caching prototypes generated with the pre-trained text encoder, TPS not only facilitates optimization-free prototype reuse for subsequent predictions but also enables seamless integration with current advancements in prompt engineering. At test-time, TPS dynamically learns shift vectors for each prototype based solely on the given test sample, effectively bridging the domain gap and enhancing classification accuracy. A notable aspect of our framework is its significantly reduced memory and computational demands when compared to conventional text-prompt tuning methods. Extensive evaluations across 15 image classification datasets involving natural distribution shifts and cross-dataset generalization, as well as in context-dependent visual reasoning, demonstrate TPS's superior performance, achieving state-of-the-art results while reducing resource requirements.

View on arXivView PDF

Code Implementations(1)

elaine-sui/TPSCommunity100%
MIT
241Shell, PythonNov 24, 202310 months agoMIT

Similar Papers

Cite this paper

@article{sui2024just,
  title  = {Just Shift It: Test-Time Prototype Shifting for Zero-Shot Generalization with Vision-Language Models},
  author = {Elaine Sui and Xiaohan Wang and Serena Yeung-Levy},
  year   = {2024},
  eprint = {2403.12952},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2403.12952v2}
}

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/2403.12952.svg)](https://codeofpaper.com/paper/2403.12952)

Discussion