Abstract
Recent large vision-language models such as CLIP have shown remarkable out-of-distribution (OOD) detection and generalization performance. However, their zero-shot in-distribution (ID) accuracy is often limited for downstream datasets. Recent CLIP-based fine-tuning methods such as prompt learning have demonstrated significant improvements in ID classification and OOD generalization where OOD labels are available. Nonetheless, it remains unclear whether the model is reliable to semantic shifts without OOD labels. In this paper, we aim to bridge the gap and present a comprehensive study to understand how fine-tuning impact OOD detection for few-shot downstream tasks. By framing OOD detection as multi-modal concept matching, we establish a connection between fine-tuning methods and various OOD scores. Our results suggest that a proper choice of OOD scores is essential for CLIP-based fine-tuning. In particular, the maximum concept matching (MCM) score provides a promising solution consistently. We also show that prompt learning demonstrates the state-of-the-art OOD detection performance over the zero-shot counterpart.
Introduction
Large-scale Vision-Language Models (VLMs) like CLIP have revolutionized computer vision by enabling "zero-shot" classification. However, their accuracy on specific downstream tasks is often lower than desired. To address this, researchers employ parameter-efficient fine-tuning (PEFT)—methods like prompt learning (tuning text instructions) or adaptors (adding small tunable layers)—to boost performance using just a few examples.
A critical safety concern arises: does this fine-tuning make the model "brittle" to out-of-distribution data? In real-world deployments, a model trained to recognize specific in-distribution (ID) classes must reliably flag out-of-distribution (OOD) samples as "unknown" rather than confidently misclassifying them. While zero-shot OOD detection has been studied, the impact of fine-tuning on this capability remained largely unexplored.
Methodology: PEFT-MCM
The authors propose framing OOD detection as multi-modal concept matching. They evaluate several fine-tuning strategies, including Prompt Learning (CoOp, CoCoOp) and Adaptors (Tip-Adapter), alongside different OOD scoring functions.
The core of the approach, PEFT-MCM, applies the Maximum Concept Matching (MCM) score to a model after it has undergone parameter-efficient fine-tuning. Unlike the standard Maximum Softmax Probability (MSP), which often suffers from overconfidence in fine-tuned models, MCM utilizes temperature-scaled cosine similarities between image features and textual prototypes to produce a more reliable OOD score.
Experimental Results
The study utilizes a robust suite of benchmarks, including ImageNet-1k and Caltech-101 for in-distribution data, and iNaturalist, SUN, Places, and Textures for OOD evaluation. The findings reveal that PEFT is a "win-win" for VLMs: it improves both classification accuracy and OOD detection performance. Fine-tuning refines the feature space, decreasing the angular distance for ID samples to their prototypes while increasing it for OOD samples, thereby widening the separability gap.
As shown in the results, the choice of scoring function is critical. While fine-tuned models can become overconfident using standard softmax (MSP), the MCM score consistently yields state-of-the-art results. For instance, on the Caltech-101 benchmark, CoCoOp combined with MCM achieved an average FPR95 of 5.02%, a significant improvement over the zero-shot CLIP's 15.28%. Furthermore, a smaller fine-tuned model (CLIP-B/16) using PEFT-MCM outperformed a much larger zero-shot model (CLIP-L/14) in OOD detection.
Conclusion
This study demonstrates that parameter-efficient fine-tuning significantly enhances the OOD detection capabilities of Vision-Language Models, provided a similarity-based score like MCM is used. Future work may explore fine-tuning objectives that explicitly optimize for OOD separability to further bolster model reliability.
Summary updated