Beyond Mahalanobis Distance for Textual OOD Detection
Pierre Colombo, Eduardo Dadalto Câmara Gomes, Guillaume Staerman, Nathan Noiry, Pablo Piantanida
Abstract
Deep learning methods have boosted the adoption of NLP systems in real-life applications. However, they turn out to be vulnerable to distribution shifts over time which may cause severe dysfunctions in production systems, urging practitioners to develop tools to detect out-of-distribution (OOD) samples through the lens of the neural network. In this paper, we introduce TRUSTED, a new OOD detector for classifiers based on Transformer architectures that meets operational requirements: it is unsupervised and fast to compute. The efficiency of TRUSTED relies on the fruitful idea that all hidden layers carry relevant information to detect OOD examples. Based on this, for a given input, TRUSTED consists in (i) aggregating this information and (ii) computing a similarity score by exploiting the training distribution, leveraging the powerful concept of data depth. Our extensive numerical experiments involve 51k model configurations, including various checkpoints, seeds, and datasets, and demonstrate that TRUSTED achieves state-of-the-art performances. In particular, it improves previous AUROC over 3 points.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
6 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- EigenScore: OOD Detection using Posterior Covariance in Diffusion Models cites Energy-based Out-of-distribution Detection
- Revisiting Score Propagation in Graph Out-of-Distribution Detection cites Energy-based Out-of-distribution Detection
- Detecting Out-of-Distribution Examples with Gram Matrices cites Detecting Semantic Anomalies
- Unsupervised Layer-Wise Score Aggregation for Textual OOD Detection cites Revisiting Mahalanobis Distance for Transformer-Based Out-of-Domain Detection
- Unsupervised Layer-Wise Score Aggregation for Textual OOD Detection cites Energy-based Out-of-distribution Detection
- Hypothesis Transfer Learning with Surrogate Classification Losses: Generalization Bounds through Algorithmic Stability cites Unsupervised Layer-Wise Score Aggregation for Textual OOD Detection
- What If the Input is Expanded in OOD Detection? cites Energy-based Out-of-distribution Detection
- What If the Input is Expanded in OOD Detection? cites Unsupervised Layer-Wise Score Aggregation for Textual OOD Detection
Cited by top-tier papers6
- What If the Input is Expanded in OOD Detection?Boxuan Zhang, Jianing Zhu, Zengmao Wang, Tongliang Liu et al.NeurIPS 2024 · 19 citations
- Unsupervised Layer-Wise Score Aggregation for Textual OOD DetectionMaxime Darrin, Guillaume Staerman, Eduardo Dadalto Câmara Gomes, Jackie C. K. Cheung et al.AAAI 2024 · 18 citations
- Revisiting Score Propagation in Graph Out-of-Distribution DetectionLongfei Ma, Yiyou Sun, Kaize Ding, Zemin Liu et al.NeurIPS 2024 · 14 citations
- EigenScore: OOD Detection using Posterior Covariance in Diffusion ModelsShirin Shoushtari, Yi Wang, Xiao Shi, M. Salman Asif et al.ICLR 2026 · 5 citations
- Hypothesis Transfer Learning with Surrogate Classification Losses: Generalization Bounds through Algorithmic StabilityAnass Aghbalou, Guillaume StaermanICML 2023 · 3 citations
Builds on21
- Energy-based Out-of-distribution DetectionWeitang Liu, Xiaoyun Wang, John D. Owens, Yixuan LiNeurIPS 2020 · 2,213 citations
- Detecting Out-of-Distribution Examples with Gram MatricesChandramouli Shama Sastry, Sageev OoreICML 2020 · 275 citations
- The MultiBERTs: BERT Reproductions for Robustness AnalysisThibault Sellam, Steve Yadlowsky, Ian Tenney, Jason Wei et al.ICLR 2022 · 106 citations
- Revisiting Mahalanobis Distance for Transformer-Based Out-of-Domain DetectionAlexander Podolskiy, Dmitry Lipin, Andrey Bout, Ekaterina Artemova et al.AAAI 2021 · 100 citations
- Detecting Semantic AnomaliesFaruk Ahmed, Aaron C. CourvilleAAAI 2020 · 93 citations
Related papers
- Detection of Out-of-Distribution Samples Using Binary Neuron Activation PatternsBartlomiej Olber, Krystian Radlak, Adam Popowicz, Michal Szczepankiewicz et al.CVPR 2023
- Out-of-Distribution Detection by Leveraging Between-Layer Transformation SmoothnessFran Jelenic, Josip Jukic, Martin Tutek, Mate Puljiz et al.ICLR 2024 · 12 citations
- Contrastive Out-of-Distribution Detection for Pretrained TransformersWenxuan Zhou, Fangyu Liu, Muhao ChenEMNLP 2021 · 63 citations
- Understanding the Feature Norm for Out-of-Distribution DetectionJaewoo Park, Jacky Chen Long Chai, Jaeho Yoon, Andrew Beng Jin TeohICCV 2023 · 27 citations
- Holistic Sentence Embeddings for Better Out-of-Distribution DetectionSishuo Chen, Xiaohan Bi, Rundong Gao, Xu SunEMNLP Findings 2022 · 9 citations
