Robust Calibration of Large Vision-Language Adapters
Balamurali Murugesan, Julio Silva-Rodriguez, Ismail Ben Ayed, Jose Dolz
TL;DR
The paper investigates severe miscalibration in CLIP-based adaptations (adapters, prompts, and test-time prompt tuning) under distribution shifts. It identifies logit-range magnification, not logit-norm, as a key driver of miscalibration and proposes three model-agnostic remedies—Zero-shot Logit Normalization (ZS-Norm), a penalty-based constraint, and Sample-adaptive Logit Scaling (SaLS)—that can be applied during training or inference. Across multiple CLIP backbones and a suite of OOD benchmarks, these methods substantially reduce calibration errors (ECE) while preserving or improving accuracy, demonstrating strong, model-agnostic improvements for zero-shot and few-shot CLIP adaptation. The work provides a practical, scalable approach to produce reliable uncertainty estimates in CLIP adapters, prompting safer deployment in real-world, open-world tasks.
Abstract
This paper addresses the critical issue of miscalibration in CLIP-based model adaptation, particularly in the challenging scenario of out-of-distribution (OOD) samples, which has been overlooked in the existing literature on CLIP adaptation. We empirically demonstrate that popular CLIP adaptation approaches, such as Adapters, Prompt Learning, and Test-Time Adaptation, substantially degrade the calibration capabilities of the zero-shot baseline in the presence of distributional drift. We identify the increase in logit ranges as the underlying cause of miscalibration of CLIP adaptation methods, contrasting with previous work on calibrating fully-supervised models. Motivated by these observations, we present a simple and model-agnostic solution to mitigate miscalibration, by scaling the logit range of each sample to its zero-shot prediction logits. We explore three different alternatives to achieve this, which can be either integrated during adaptation or directly used at inference time. Comprehensive experiments on popular OOD classification benchmarks demonstrate the effectiveness of the proposed approaches in mitigating miscalibration while maintaining discriminative performance, whose improvements are consistent across the three families of these increasingly popular approaches. The code is publicly available at: https://github.com/Bala93/CLIPCalib
