From Inference to Adaptation: Vision-Language Model Test-Time Adaptation via a Unified Optimal Transport View

Yu, Qi, Zeng, Zhichen, Tieu, Katherine, Chen, Lingjie, Yang, Xiyuan, Qiu, Ruizhong, Yan, Yuchen, Liu, Lihui, Zhao, Yanjun, Wang, Ziao, Ying, Lei, He, Jingrui, Tong, Hanghang

–arXiv.org Artificial Intelligence 

Vision-language models (VLMs) have demonstrated remarkable zero-shot capabilities yet remain sensitive to real-world distribution shifts. Although significant efforts are devoted to adapting VLMs at test time, they rely heavily on noisy pseudo-labels predicted from cross-modal embedding similarities during inference, which are unreliable under distribution shifts and mislead the adaptation. Moreover, existing methods largely overlook the critical relational structures across different modalities during test-time adaptation, whose supervision signals remain surprisingly robust under distribution shifts. In this work, we aim to jointly align the cross-modal semantics and intra-modal relational structures across modalities at test time to improve VLM adaptation. At the inference stage, we formulate the zero-shot image classification task as a cross-modal alignment problem via a Fused Gromov-Wasserstein (FGW) formulation, which considers both cross-modal semantics and intra-modal structures to generate robust pseudo-labels. At the adaptation stage, we propose a multi-level InfoNCE loss to leverage both the semantical and relational alignment supervision from the inference stage, empowering fine-grained adaptation of VLMs under distribution shifts with additional structural consistency. Finally, we bridge the inference and adaptation stages of our method by proving a mathematical equivalence between their objective functions, thereby revealing the mutual benefits of these two stages from a theoretical perspective. Extensive experiments demonstrate the effectiveness and efficiency of our methods, outperforming the best-performing methods by up to 3% while maintaining a superior balance between effectiveness and efficiency.