potentialpaper

Transformers Know When They Don’t Know: Layer-Wise Distance Awareness for OOD Detection

Khoa Duong, Tien-Phat Nguyen, Tri Cao, Sy-Tuyen Ho, Ngai-Man Cheung

ICLR 2026 submission

Edit this page

Or clone it with git

The page gets its repository with its first edit, so start in the web editor.

Or let your agent set it up

It checks and sets up everything: signing in, git, the clone, credentials and an SSH key.

Abstract. Out-of-distribution object detection (OOD-OD) is essential for building robust vision systems in safety-critical applications. While transformer-based architectures have become dominant in object detection, existing work on OOD-OD has primarily focused on OOD object synthesis or OOD detection scores, with limited understanding of the internal feature representations of transformers. In this work, we present the first in-depth analysis of transformer features for OOD-OD. Motivated by theoretical insights that input distance awareness – the ability of feature representations to reflect the distance from the training distribution – is a key property for predictive uncertainty estimation and reliable OOD detection, we systematically evaluate this property across transformer layers. Our analysis reveals that certain transformer layers exhibit heightened input distance awareness. Leveraging this observation, we develop simple yet effective OOD detection methods based on features from these layers, achieving state-ofthe-art performance across multiple OOD-OD benchmarks. Our findings provide new insights into the role of transformer representations in OOD detection. Code and additional experiments are in the Supp.

Are you an author? Claim this paper to see who's reading it, with views and other statistics, and to write about it here.

Claim this paper
How does this paper connect to your work? Write how you built on it, compared with it or reproduced it, or add a summary, a critique or errata.
Or make it interactive:
Start writing

add · history

No versions are recorded yet: its preprint, the venues it went to and what they decided, the camera-ready. Missing a version?

We don't know of a submission of this paper to a venue with open reviews. Missing a submission?

Loading the discussion…