[Paper Review] C-TPT: Calibrated Test-Time Prompt Tuning for Vision-Language Models via Text Feature Dispersion
This paper proposes C-TPT, a novel test-time prompt tuning method for vision-language models that improves model calibration by maximizing Average Text Feature Dispersion (ATFD) without requiring labeled data. By leveraging CLIP's intrinsic properties, C-TPT optimizes prompts during inference to reduce overconfidence, achieving significantly lower Expected Calibration Error (ECE) while maintaining or improving accuracy across multiple datasets and CLIP architectures.
In deep learning, test-time adaptation has gained attention as a method for model fine-tuning without the need for labeled data. A prime exemplification is the recently proposed test-time prompt tuning for large-scale vision-language models such as CLIP. Unfortunately, these prompts have been mainly developed to improve accuracy, overlooking the importance of calibration, which is a crucial aspect for quantifying prediction uncertainty. However, traditional calibration methods rely on substantial amounts of labeled data, making them impractical for test-time scenarios. To this end, this paper explores calibration during test-time prompt tuning by leveraging the inherent properties of CLIP. Through a series of observations, we find that the prompt choice significantly affects the calibration in CLIP, where the prompts leading to higher text feature dispersion result in better-calibrated predictions. Introducing the Average Text Feature Dispersion (ATFD), we establish its relationship with calibration error and present a novel method, Calibrated Test-time Prompt Tuning (C-TPT), for optimizing prompts during test-time with enhanced calibration. Through extensive experiments on different CLIP architectures and datasets, we show that C-TPT can effectively improve the calibration of test-time prompt tuning without needing labeled data. The code is publicly accessible at https://github.com/hee-suk-yoon/C-TPT.
Motivation & Objective
- To address the lack of calibration in test-time prompt tuning for vision-language models like CLIP, despite improvements in accuracy.
- To identify intrinsic, data-free indicators of model calibration that can be used during test-time adaptation.
- To develop a method that enhances calibration during test-time prompt tuning without relying on labeled data.
- To establish a quantitative link between text feature dispersion and calibration error in CLIP models.
- To demonstrate the generalizability and effectiveness of the proposed method across diverse vision-language benchmarks and CLIP architectures.
Proposed method
- The method introduces Average Text Feature Dispersion (ATFD) as a proxy for model calibration, measuring the spread of class-embedded text features in the CLIP text encoder's output space.
- C-TPT optimizes prompts during test time by maximizing ATFD as a regularizer, using gradient descent to improve calibration without access to labels.
- The approach leverages the observation that higher text feature dispersion correlates with lower Expected Calibration Error (ECE), enabling data-free calibration.
- The method is applied during inference, adapting the prompt per input image to improve both accuracy and calibration simultaneously.
- C-TPT is validated across multiple CLIP variants (ViT-B/16, RN50) and datasets (ImageNet, ImageNet-A, ImageNet-V2, etc.), showing consistent gains in calibration.
- The method is also extended to training-time prompt tuning (e.g., CoOp), where C-TPT acts as a regularizer to improve ECE, demonstrating broad applicability.
Experimental results
Research questions
- RQ1Can test-time prompt tuning be enhanced to improve model calibration without using labeled data?
- RQ2Is there a data-free, intrinsic property of CLIP that correlates with calibration performance?
- RQ3Does increasing the dispersion of text features in the CLIP embedding space lead to better-calibrated predictions?
- RQ4Can the proposed method generalize across different datasets and CLIP architectures?
- RQ5Can C-TPT be adapted for use in training-time prompt tuning as a regularizer?
Key findings
- C-TPT reduces Expected Calibration Error (ECE) by up to 50% on average across multiple datasets, including ImageNet-A and ImageNet-V2, without using labeled data.
- On ImageNet-A, C-TPT reduces ECE from 3.00 to 1.48 when applied to CoOp, demonstrating its effectiveness as a regularizer in training-time tuning.
- The method achieves a 1.48 ECE on Caltech and 1.79 on Cars, significantly outperforming baseline CoOp in calibration while maintaining competitive accuracy.
- A strong negative correlation (Spearman ρ = 0.92) is observed between ATFD rankings on ImageNet and other datasets, indicating that high dispersion in one dataset generalizes to others.
- C-TPT improves calibration across all evaluated datasets, including challenging distribution shifts like ImageNet-Sketch and EuroSAT, with ECE reductions of up to 40%.
- The method maintains or slightly improves accuracy while significantly reducing overconfidence, confirming that better calibration does not come at the cost of performance.
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.