COLA: Context-aware Language-driven Test-time Adaptation

Aiming Zhang, Tianyuan Yu, Liang Bai, Jun Tang, Yanming Guo, Yirun Ruan, Yun Zhou, Zhihe LuIEEE TIP 2025

Abstract

COLA (Context-aware Language-driven Test-time Adaptation) is a lightweight framework designed to adapt pre-trained vision-language models (VLMs) like CLIP to unlabeled target domains during inference. By updating only 0.3% of the model's parameters through a Context-aware Module (CAM) and employing a Class-Balanced Pseudo-Labeling (CBPL) strategy, COLA achieves state-of-the-art performance across diverse benchmarks while overcoming the "strict label space" constraints of traditional test-time adaptation methods.

Introduction

In machine learning, "distribution shift" occurs when a model trained on one domain (e.g., clean studio photos) fails in another (e.g., artistic sketches). Test-Time Adaptation (TTA) aims to mitigate this by adapting the model to new data during inference without requiring access to the original source training data.

However, most existing TTA methods assume a "strict label space" where the source and target domains share identical categories. Vision-Language Models (VLMs) like CLIP offer a solution by matching images to text descriptions, but they often lack the domain-specific context needed for high-accuracy recognition in novel environments. COLA addresses these gaps by making VLMs context-aware and reducing label bias during adaptation.

Methodology

COLA introduces two primary innovations to enhance VLM performance at test-time:

1. The Context-aware Module (CAM)

Rather than fine-tuning the entire backbone, COLA utilizes a tiny plug-in module consisting of three parts:

  • Task-aware Adapter: Two linear layers that extract features unique to specific target samples.
  • Context-aware Unit (CAU): This unit calculates a "prototype" (mean feature vector) for the entire batch, allowing the model to grasp global domain characteristics (e.g., recognizing that a whole set of images are sketches).
  • Residual Connection: This ensures the model retains the powerful zero-shot knowledge inherent in the pre-trained CLIP model.

2. Class-Balanced Pseudo-Labeling (CBPL)

TTA typically relies on "pseudo-labels"—the model's own predictions. Standard methods use a fixed confidence threshold, which often biases the model toward "easy" classes. CBPL implements individual thresholds for every class, ensuring that difficult categories are represented in the adaptation process and preventing the model from collapsing into a few majority-class predictions.

Overview of the COLA framework, illustrating the Context-aware Module (CAM) components and the Class-balanced pseudo labeling (CBPL) process.

Experimental Setup and Results

The researchers evaluated COLA on an extensive battery of domain adaptation benchmarks, including VisDA-C, DomainNet-126, VLCS, PACS, OfficeHome, and Terra Incognita.

Key Performance Metrics

  • State-of-the-Art Accuracy: On the VisDA-C benchmark, COLA achieved 98.3% accuracy with a ViT-B/16 backbone, representing a 7.6% improvement over previous top-tier methods.
  • Efficiency: COLA only updates 0.3% of the total parameters, making it significantly faster and more memory-efficient than methods requiring full backpropagation.
  • Robustness in Low-Shot Scenarios: In 16-shot scenarios, COLA outperformed standard prompt-tuning methods like CoOp across multiple datasets (Caltech101, Pets, and Flowers102).
Average Per-Class Top-1 Accuracy comparison between COLA and existing methods using ResNet-101 and ViT-B/16 backbones.

Conclusion

COLA provides a highly efficient and flexible solution for test-time adaptation of vision-language models. By focusing on batch-wise context and balanced pseudo-labeling, it breaks the limitations of shared label spaces and achieves superior results with minimal parameter overhead. Future work may explore single-pass integration and handling extremely long-tailed distributions where class imbalance is most severe.

Summary updated

BibTeX
@article{zhang2025cola,
  author = {Aiming Zhang and Tianyuan Yu and Liang Bai and Jun Tang and Yanming Guo and Yirun Ruan and Yun Zhou and Zhihe Lu},
  title = {{COLA: Context-aware Language-driven Test-time Adaptation}},
  journal = {IEEE Trans. Image Process.},
  year = {2025},
}
Figure