Respecting Modality Gap in Post-hoc Out-of-distribution Detection with Pre-trained Vision-Language Models

Yuanwei Hu, Bo Peng, Yadan Luo, Zhen Fang, Ling Chen +1 more
5/26/2026
cs.CVcs.AI

No confident code implementation found for this paper.

Abstract

Out-of-distribution (OOD) detection has emerged as a popular technique to enhance the reliability of machine learning models by identifying unexpected inputs from unknown classes. Recent progress in pre-trained vision-language models (VLMs) has enabled zero-shot OOD detection without access to in-distribution (ID) training data; in this setting, existing methods commonly treat text embeddings of class names as class prototypes.

Show full abstract

In this paper, we challenge the widely adopted text-as-prototype paradigm by theoretically showing that off-the-shelf textual prototypes are generally misaligned with the optimal visual prototypes, yielding an intrinsic modality gap that cannot be eliminated by prompt engineering alone. To mitigate this gap under the post-hoc constraint, this paper presents an online pseudo-supervised framework that directly learns class prototypes in the visual feature space using unlabeled test-time data streams and soft predictions from the pre-trained VLMs. We provide theoretical guarantees for the convergence of the online optimization procedure. Extensive experiments empirically demonstrate that our method achieves a new state of the art across a variety of OOD detection setups.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{hu2026respecting,
  title  = {Respecting Modality Gap in Post-hoc Out-of-distribution Detection with Pre-trained Vision-Language Models},
  author = {Yuanwei Hu and Bo Peng and Yadan Luo and Zhen Fang and Ling Chen and Jie Lu},
  year   = {2026},
  eprint = {2605.26661},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2605.26661v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2605.26661.svg)](https://codeofpaper.com/paper/2605.26661)

Discussion