mlsanityData to 7 Oct 2026

How Good Are LLMs at Out-of-Distribution Detection?

arXiv 2308.10261 ↗First posted 20 Aug 2023cs.CLcited by 15

Not on the map. Why?

Abstract (arXiv)

Out-of-distribution (OOD) detection plays a vital role in enhancing the reliability of machine learning (ML) models. The emergence of large language models (LLMs) has catalyzed a paradigm shift within the ML community, showcasing their exceptional capabilities across diverse natural language processing tasks. While existing research has probed OOD detection with relative small-scale Transformers like BERT, RoBERTa and GPT-2, the stark differences in scales, pre-training objectives, and inference paradigms call into question the applicability of these findings to LLMs. This paper embarks on a pioneering empirical investigation of OOD detection in the domain of LLMs, focusing on LLaMA series ranging from 7B to 65B in size. We thoroughly evaluate commonly-used OOD detectors, scrutinizing their performance in both zero-grad and fine-tuning scenarios. Notably, we alter previous discriminative in-distribution fine-tuning into generative fine-tuning, aligning the pre-training objective of LLMs with downstream tasks. Our findings unveil that a simple cosine distance OOD detector demonstrates superior efficacy, outperforming other OOD detectors. We provide an intriguing explanation for this phenomenon by highlighting the isotropic nature of the embedding spaces of LLMs, which distinctly contrasts with the anisotropic property observed in smaller BERT family models. The new insight enhances our understanding of how LLMs detect OOD data, thereby enhancing their adaptability and reliability in dynamic environments. We have released the source code at urlhttps://github.com/Awenbocc/LLM-OOD for other researchers to reproduce our results.

Key facts. Cited by 15 papers in the map (data through 7 Oct 2026). Builds on 30 of its 51 references that are in the map. First posted on arXiv 20 Aug 2023.

Builds on

30 of 51 references.

References · 30

  1. 2021Learning Transferable Visual Models From Natural Language Supervisioncited by 33,456
  2. 2020Language Models are Few-Shot Learnerscited by 32,199
  3. 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,084
  4. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
  5. 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
  6. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
  7. 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,304
  8. 2018GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understandingcited by 4,854
  9. 2022OPT: Open Pre-trained Transformer Language Modelscited by 3,464
  10. 2022Scaling Instruction-Finetuned Language Modelscited by 2,997
  11. 2018UMAP: Uniform Manifold Approximation and Projection for Dimension Reductioncited by 2,841
  12. 2017A Broad-Coverage Challenge Corpus for Sentence Understanding through Inferencecited by 2,665
18 more
  1. 2016A Baseline for Detecting Misclassified and Out-of-Distribution Examples in Neural Networkscited by 2,362
  2. 2018A Simple Unified Framework for Detecting Out-of-Distribution Samples and Adversarial Attackscited by 1,472
  3. 2020Energy-based Out-of-distribution Detectioncited by 1,296
  4. 2021GLM: General Language Model Pretraining with Autoregressive Blank Infillingcited by 1,026
  5. 2021Generalized Out-of-Distribution Detection: A Surveycited by 796
  6. 2019How Contextual are Contextualized Word Representations? Comparing the Geometry of BERT, ELMo, and GPT-2 Embeddingscited by 770
  7. 2021SLAKE: A Semantically-Labeled Knowledge-Enhanced Dataset for Medical Visual Question Answeringcited by 444
  8. 2019An Evaluation Dataset for Intent Classification and Out-of-Scope Predictioncited by 378
  9. 2020Pretrained Transformers Improve Out-of-Distribution Robustnesscited by 293
  10. 2016Multi30K: Multilingual English-German Image Descriptionscited by 250
  11. 2019Representation Degeneration Problem in Training Natural Language Generation Modelscited by 250
  12. 2021MOOD: Multi-level Out-of-distribution Detectioncited by 94
  13. 2021Types of Out-of-Distribution Texts and How to Detect Themcited by 80
  14. 2021Contrastive Out-of-Distribution Detection for Pretrained Transformerscited by 70
  15. 2021Revisiting Mahalanobis Distance for Transformer-Based Out-of-Domain Detectioncited by 67
  16. 2022X-Risk Analysis for AI Researchcited by 60
  17. 2021Out-of-Scope Intent Detection with Self-Supervision and Discriminative Trainingcited by 42
  18. 2023Is Fine-tuning Needed? Pre-trained Language Models Are Near Perfect for Out-of-Domain Detectioncited by 29

Built on by

Cited by year (2026 to 7 Oct)

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

15 papers.

Sort:

By area: