Lune

AAAI2024Top-tier venue

Unsupervised Layer-Wise Score Aggregation for Textual OOD Detection

Maxime Darrin, Guillaume Staerman, Eduardo Dadalto Câmara Gomes, Jackie C. K. Cheung, Pablo Piantanida, Pierre Colombo

Abstract

Out-of-distribution (OOD) detection is a rapidly growing field due to new robustness and security requirements driven by an increased number of AI-based systems. Existing OOD textual detectors often rely on anomaly scores (e.g., Mahalanobis distance) computed on the embedding output of the last layer of the encoder. In this work, we observe that OOD detection performance varies greatly depending on the task and layer output. More importantly, we show that the usual choice (the last layer) is rarely the best one for OOD detection and that far better results can be achieved, provided that an oracle selects the best layer. We propose a data-driven, unsupervised method to leverage this observation to combine layer-wise anomaly scores. In addition, we extend classical textual OOD benchmarks by including classification tasks with a more significant number of classes (up to 150), which reflects more realistic settings. On this augmented benchmark, we show that the proposed post-aggregation methods achieve robust and consistent results comparable to using the best layer according to an oracle while removing manual feature selection altogether.

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.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Energy-based Out-of-distribution Detection cites Input Complexity and Out-of-distribution Detection with Likelihood-based Generative Models
  • Is Out-of-Distribution Detection Learnable? cites Energy-based Out-of-distribution Detection
  • ViM: Out-Of-Distribution with Virtual-logit Matching cites Energy-based Out-of-distribution 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 ViM: Out-Of-Distribution with Virtual-logit Matching
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers6

  1. SaulLM-54B & SaulLM-141B: Scaling Up Domain Adaptation for the Legal DomainPierre Colombo, Telmo Pessoa Pires, Malik Boudiaf, Rui Melo et al.NeurIPS 2024 · 58 citations
  2. What If the Input is Expanded in OOD Detection?Boxuan Zhang, Jianing Zhu, Zengmao Wang, Tongliang Liu et al.NeurIPS 2024 · 19 citations
  3. Transductive Learning for Textual Few-Shot Classification in API-based Embedding ModelsPierre Colombo, Victor Pellegrain, Malik Boudiaf, Myriam Tami et al.EMNLP 2023 · 7 citations
  4. A Layer Selection Approach to Test Time AdaptationSabyasachi Sahoo, Mostafa ElAraby, Jonas Ngnawé, Yann Batiste Pequignot et al.AAAI 2025 · 6 citations
  5. Hypothesis Transfer Learning with Surrogate Classification Losses: Generalization Bounds through Algorithmic StabilityAnass Aghbalou, Guillaume StaermanICML 2023 · 3 citations

Builds on21

  1. The Many Faces of Robustness: A Critical Analysis of Out-of-Distribution GeneralizationDan Hendrycks, Steven Basart, Norman Mu, Saurav Kadavath et al.ICCV 2021 · 2,294 citations
  2. Energy-based Out-of-distribution DetectionWeitang Liu, Xiaoyun Wang, John D. Owens, Yixuan LiNeurIPS 2020 · 2,213 citations
  3. Input Complexity and Out-of-distribution Detection with Likelihood-based Generative ModelsJoan Serrà, David Álvarez, Vicenç Gómez, Olga Slizovskaia et al.ICLR 2020 · 307 citations
  4. ViM: Out-Of-Distribution with Virtual-logit MatchingHaoqi Wang, Zhizhong Li, Litong Feng, Wayne ZhangCVPR 2022 · 227 citations
  5. Is Out-of-Distribution Detection Learnable?Zhen Fang, Yixuan Li, Jie Lu, Jiahua Dong et al.NeurIPS 2022 · 188 citations

Related papers

  1. Holistic Sentence Embeddings for Better Out-of-Distribution DetectionSishuo Chen, Xiaohan Bi, Rundong Gao, Xu SunEMNLP Findings 2022 · 9 citations
  2. Enhancing Two Steps Textual Anomaly Detection through Anisotropy MitigationPierre Fihey, Matthieu Labeau, Pavlo MozharovskyiACL 2026
  3. Discriminability-Driven Channel Selection for Out-of-Distribution DetectionYue Yuan, Rundong He, Yicong Dong, Zhongyi Han et al.CVPR 2024 · 7 citations
  4. Revisit PCA-based technique for Out-of-Distribution DetectionXiaoyuan Guan, Zhouwu Liu, Wei-Shi Zheng, Yuren Zhou et al.ICCV 2023 · 19 citations
  5. Gradient-Based Novelty Detection Boosted by Self-Supervised Binary ClassificationJingbo Sun, Li Yang, Jiaxin Zhang, Frank Liu et al.AAAI 2022 · 17 citations
Dusk over the sea between two cliffs drawn in fine vertical lines