Enhancing Near OOD Detection in Prompt Learning: Maximum Gains, Minimal Costs
Myong Chol Jung, He Zhao, Joanna Dipnall, Belinda Gabbe, Lan Du
TL;DR
This paper tackles the challenging problem of near OOD detection in CLIP-based prompt learning, a setting where in-distribution and near OOD samples share the same domain but have disjoint labels. It introduces a simple, fast post-hoc framework that augments existing logit-based scores with an Empty-Class score and derives Relative Energy/MaxLogit scores by subtracting a margin-scaled Empty-Class term, with the tightening margin $eta$ estimated from ID data via a bivariate normal MLE to minimize score correlation. Empirically, the method consistently improves near OOD AUROC and reduces FPR95 across 13 datasets and 8 prompt-learning models (including CoOp, CoCoOp, LoCoOp, and others), achieving up to 11.67% AUROC gains without retraining. The approach also sheds light on the relationship between dataset distance and OOD detector performance, shows applicability to far OOD detection with broad improvements, and discusses limitations and potential extensions to MCM and other OOD settings. Overall, the work provides a practical, architecture-agnostic tool to bolster near OOD detection in vision-language prompts, with clear implications for safer deployment of CLIP-style systems.
Abstract
Prompt learning has shown to be an efficient and effective fine-tuning method for vision-language models like CLIP. While numerous studies have focused on the generalisation of these models in few-shot classification, their capability in near out-of-distribution (OOD) detection has been overlooked. A few recent works have highlighted the promising performance of prompt learning in far OOD detection. However, the more challenging task of few-shot near OOD detection has not yet been addressed. In this study, we investigate the near OOD detection capabilities of prompt learning models and observe that commonly used OOD scores have limited performance in near OOD detection. To enhance the performance, we propose a fast and simple post-hoc method that complements existing logit-based scores, improving near OOD detection AUROC by up to 11.67% with minimal computational cost. Our method can be easily applied to any prompt learning model without change in architecture or re-training the models. Comprehensive empirical evaluations across 13 datasets and 8 models demonstrate the effectiveness and adaptability of our method.
