mlsanityData to 7 Oct 2026

Holistic Sentence Embeddings for Better Out-of-Distribution Detection

arXiv 2210.07485 ↗First posted 14 Oct 2022cs.CL cs.AIcited by 6

Not on the map. Why?

Abstract (arXiv)

Detecting out-of-distribution (OOD) instances is significant for the safe deployment of NLP models. Among recent textual OOD detection works based on pretrained language models (PLMs), distance-based methods have shown superior performance. However, they estimate sample distance scores in the last-layer CLS embedding space and thus do not make full use of linguistic information underlying in PLMs. To address the issue, we propose to boost OOD detection by deriving more holistic sentence embeddings. On the basis of the observations that token averaging and layer combination contribute to improving OOD detection, we propose a simple embedding approach named Avg-Avg, which averages all token representations from each intermediate layer as the sentence embedding and significantly surpasses the state-of-the-art on a comprehensive suite of benchmarks by a 9.33% FAR95 margin. Furthermore, our analysis demonstrates that it indeed helps preserve general linguistic knowledge in fine-tuned PLMs and substantially benefits detecting background shifts. The simple yet effective embedding method can be applied to fine-tuned PLMs with negligible extra costs, providing a free gain in OOD detection. Our code is available at https://github.com/lancopku/Avg-Avg.

Key facts. Cited by 6 papers in the map (data through 7 Oct 2026). Builds on 30 of its 47 references that are in the map. First posted on arXiv 14 Oct 2022.

Builds on

30 of 47 references.

References · 30

  1. 2017Attention Is All You Needcited by 59,932
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  3. 2014Adam: A Method for Stochastic Optimizationcited by 36,960
  4. 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
  5. 2018GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understandingcited by 4,854
  6. 2019DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lightercited by 4,243
  7. 2019ALBERT: A Lite BERT for Self-supervised Learning of Language Representationscited by 2,772
  8. 2016A Baseline for Detecting Misclassified and Out-of-Distribution Examples in Neural Networkscited by 2,362
  9. 2021SimCSE: Simple Contrastive Learning of Sentence Embeddingscited by 2,168
  10. 2015A large annotated corpus for learning natural language inferencecited by 1,837
  11. 2018A Simple Unified Framework for Detecting Out-of-Distribution Samples and Adversarial Attackscited by 1,472
  12. 2017Enhancing The Reliability of Out-of-distribution Image Detection in Neural Networkscited by 1,325
18 more
  1. 2020Energy-based Out-of-distribution Detectioncited by 1,296
  2. 2021Generalized Out-of-Distribution Detection: A Surveycited by 796
  3. 2018What you can cram into a single vector: Probing sentence embeddings for linguistic propertiescited by 452
  4. 2020Generalized ODIN: Detecting Out-of-distribution Image without Learning from Out-of-distribution Datacited by 408
  5. 2019An Evaluation Dataset for Intent Classification and Out-of-Scope Predictioncited by 378
  6. 2015Skip-Thought Vectorscited by 321
  7. 2018SentEval: An Evaluation Toolkit for Universal Sentence Representationscited by 294
  8. 2020Pretrained Transformers Improve Out-of-Distribution Robustnesscited by 293
  9. 2021Exploring the Limits of Out-of-Distribution Detectioncited by 283
  10. 2016Multi30K: Multilingual English-German Image Descriptionscited by 250
  11. 2021Whitening Sentence Representations for Better Semantics and Faster Retrievalcited by 198
  12. 2017Unsupervised Learning of Sentence Embeddings using Compositional n-Gram Featurescited by 103
  13. 2021Types of Out-of-Distribution Texts and How to Detect Themcited by 80
  14. 2021WhiteningBERT: An Easy Unsupervised Sentence Embedding Approachcited by 68
  15. 2021Revisiting Mahalanobis Distance for Transformer-Based Out-of-Domain Detectioncited by 67
  16. 2019Deep Unknown Intent Detection with Margin Losscited by 66
  17. 2020Feature Space Singularity for Out-of-Distribution Detectioncited by 49
  18. 2022News Category Datasetcited by 42

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2023: 3; 2024: 2; 2025: 0; 2026: 1.

6 papers.