Table of Contents
Fetching ...

Understanding and Mitigating Miscalibration in Prompt Tuning for Vision-Language Models

Shuoyuan Wang, Yixuan Li, Hongxin Wei

TL;DR

The paper addresses miscalibration in CLIP after prompt-tuning, where base-class calibration improves while novel-class calibration collapses (or vice versa). It introduces Dynamic Outlier Regularization (DOR), a regularizer that aligns novel textual label embeddings with zero-shot CLIP via dynamic WordNet-based outliers, while leaving base-class optimization largely untouched. Empirically, DOR consistently lowers calibration error (e.g., ~8% average ECE reduction for CoOp across 11 datasets) and improves base-new harmonic mean without sacrificing accuracy, also proving robust under covariate shifts and extendable to visual fine-tuning. The work offers a practical, easy-to-integrate approach to stabilize calibration in parametric-efficient fine-tuning of vision-language models, with broad applicability to downstream tasks and potential extension to other VLM architectures.

Abstract

Confidence calibration is critical for the safe deployment of machine learning models in the real world. However, such issue in vision-language models like CLIP, particularly after fine-tuning, has not been fully addressed. In this work, we demonstrate that existing prompt tuning methods usually lead to a trade-off of calibration between base and new classes: the cross-entropy loss in CoOp causes overconfidence in new classes by increasing textual label divergence, whereas the regularization of KgCoOp maintains the confidence level but results in underconfidence in base classes due to the improved accuracy. Inspired by the observations, we introduce Dynamic Outlier Regularization (DOR) to ensure the confidence calibration on both base and new classes after fine-tuning. In particular, we propose to minimize the feature deviation of novel textual labels (instead of base classes) sampled from a large vocabulary. In effect, DOR prevents the increase in textual divergence for new labels while easing restrictions on base classes. Extensive experiments demonstrate that DOR can enhance the calibration performance of current fine-tuning methods on base and new classes.

Understanding and Mitigating Miscalibration in Prompt Tuning for Vision-Language Models

TL;DR

The paper addresses miscalibration in CLIP after prompt-tuning, where base-class calibration improves while novel-class calibration collapses (or vice versa). It introduces Dynamic Outlier Regularization (DOR), a regularizer that aligns novel textual label embeddings with zero-shot CLIP via dynamic WordNet-based outliers, while leaving base-class optimization largely untouched. Empirically, DOR consistently lowers calibration error (e.g., ~8% average ECE reduction for CoOp across 11 datasets) and improves base-new harmonic mean without sacrificing accuracy, also proving robust under covariate shifts and extendable to visual fine-tuning. The work offers a practical, easy-to-integrate approach to stabilize calibration in parametric-efficient fine-tuning of vision-language models, with broad applicability to downstream tasks and potential extension to other VLM architectures.

Abstract

Confidence calibration is critical for the safe deployment of machine learning models in the real world. However, such issue in vision-language models like CLIP, particularly after fine-tuning, has not been fully addressed. In this work, we demonstrate that existing prompt tuning methods usually lead to a trade-off of calibration between base and new classes: the cross-entropy loss in CoOp causes overconfidence in new classes by increasing textual label divergence, whereas the regularization of KgCoOp maintains the confidence level but results in underconfidence in base classes due to the improved accuracy. Inspired by the observations, we introduce Dynamic Outlier Regularization (DOR) to ensure the confidence calibration on both base and new classes after fine-tuning. In particular, we propose to minimize the feature deviation of novel textual labels (instead of base classes) sampled from a large vocabulary. In effect, DOR prevents the increase in textual divergence for new labels while easing restrictions on base classes. Extensive experiments demonstrate that DOR can enhance the calibration performance of current fine-tuning methods on base and new classes.
Paper Structure (41 sections, 1 theorem, 18 equations, 11 figures, 20 tables)

This paper contains 41 sections, 1 theorem, 18 equations, 11 figures, 20 tables.

Key Result

Proposition 3.1

Let $\mathbb{E}[p_{\sigma}]$ denote the expected value of the maximum probability $p_i$ when the logits are distributed as $\mathcal{N}(\mu, \sigma^2)$. Then, for any $\sigma_1, \sigma_2 > 0$ and $\mu$, we have $\mathbb{E}[p_{\sigma_2}] > \mathbb{E}[p_{\sigma_{1}}]$, if $\sigma_2>\sigma_1$.

Figures (11)

  • Figure 1: Reliability diagram of fine-tuned CLIP (ViT-B/16) on StanfordCars dataset. ECE: Expected Calibration Error (lower is better). Miscalibration is depicted in pink for overconfidence and purple for underconfidence.
  • Figure 2: Results of zero-shot and fined-tuned CLIPs with different prompt tuning methods on UCF101 dataset.
  • Figure 3: Comparison between the maximum logit and the average of other logits, using different prompt tuning methods on DTD.
  • Figure 4: Parameter sensitivity between KgCoOp (KG) and DOR (w/ CoOp). Compared with KG, the accuracy and ECE of DOR are not sensitive to $\lambda$ base classes. Left: Accuracy. Right: ECE.
  • Figure 5: Comparison between zero-shot CLIP and different prompt tuning methods on UCF101 dataset. Fine-tuned CLIP tends to have higher confidence and FD score on both base and new classes.
  • ...and 6 more figures

Theorems & Definitions (3)

  • Definition 3.1: Feature Divergence
  • Proposition 3.1
  • proof