TTL: Test-time Textual Learning for OOD Detection with Pretrained Vision-Language Models

Jinlun Ye, Jiang Liao, Runhe Lai, Xinhua Lu, Jiaxin Zhuang +2 more
4/17/2026
cs.CLcs.CV

Official code: figec/TTL (8 stars, last commit 2026-03-07).

Abstract

Vision-language models (VLMs) such as CLIP exhibit strong Out-of-distribution (OOD) detection capabilities by aligning visual and textual representations. Recent CLIP-based test-time adaptation methods further improve detection performance by incorporating external OOD labels. However, such labels are finite and fixed, while the real OOD semantic space is inherently open-ended. Consequently, fixed labels fail to represent the diverse and evolving OOD semantics encountered in test streams. To address this limitation, we introduce Test-time Textual Learning (TTL), a framework that dynamically learns OOD textual semantics from unlabeled test streams, without relying on external OOD labels. TTL updates learnable prompts using pseudo-labeled test samples to capture emerging OOD knowledge. To suppress noise introduced by pseudo-labels, we introduce an OOD knowledge purification strategy that selects reliable OOD samples for adaptation while suppressing noise. In addition, TTL maintains an OOD Textual Knowledge Bank that stores high-quality textual features, providing stable score calibration across batches. Extensive experiments on two standard benchmarks with nine OOD datasets demonstrate that TTL consistently achieves state-of-the-art performance, highlighting the value of textual adaptation for robust test-time OOD detection. Our code is available at https://github.com/figec/TTL.

View on arXivView PDF

Code Implementations(1)

figec/TTLOfficial100%

Official repository for our CVPR 2026 paper "TTL: Test-time Textual Learning for OOD Detection with Pretrained Vision-Language Models"

80Mar 7, 20267 months ago

Similar Papers

Cite this paper

@article{ye2026ttl,
  title  = {TTL: Test-time Textual Learning for OOD Detection with Pretrained Vision-Language Models},
  author = {Jinlun Ye and Jiang Liao and Runhe Lai and Xinhua Lu and Jiaxin Zhuang and Zhiyong Gan and Ruixuan Wang},
  year   = {2026},
  eprint = {2604.15756},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2604.15756v1}
}

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/2604.15756.svg)](https://codeofpaper.com/paper/2604.15756)

Discussion