How Good Are LLMs at Out-of-Distribution Detection?
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
- 2021Learning Transferable Visual Models From Natural Language Supervisioncited by 33,456
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,084
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
- 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,304
- 2018GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understandingcited by 4,854
- 2022OPT: Open Pre-trained Transformer Language Modelscited by 3,464
- 2022Scaling Instruction-Finetuned Language Modelscited by 2,997
- 2018UMAP: Uniform Manifold Approximation and Projection for Dimension Reductioncited by 2,841
- 2017A Broad-Coverage Challenge Corpus for Sentence Understanding through Inferencecited by 2,665
18 more
- 2016A Baseline for Detecting Misclassified and Out-of-Distribution Examples in Neural Networkscited by 2,362
- 2018A Simple Unified Framework for Detecting Out-of-Distribution Samples and Adversarial Attackscited by 1,472
- 2020Energy-based Out-of-distribution Detectioncited by 1,296
- 2021GLM: General Language Model Pretraining with Autoregressive Blank Infillingcited by 1,026
- 2021Generalized Out-of-Distribution Detection: A Surveycited by 796
- 2019How Contextual are Contextualized Word Representations? Comparing the Geometry of BERT, ELMo, and GPT-2 Embeddingscited by 770
- 2021SLAKE: A Semantically-Labeled Knowledge-Enhanced Dataset for Medical Visual Question Answeringcited by 444
- 2019An Evaluation Dataset for Intent Classification and Out-of-Scope Predictioncited by 378
- 2020Pretrained Transformers Improve Out-of-Distribution Robustnesscited by 293
- 2016Multi30K: Multilingual English-German Image Descriptionscited by 250
- 2019Representation Degeneration Problem in Training Natural Language Generation Modelscited by 250
- 2021MOOD: Multi-level Out-of-distribution Detectioncited by 94
- 2021Types of Out-of-Distribution Texts and How to Detect Themcited by 80
- 2021Contrastive Out-of-Distribution Detection for Pretrained Transformerscited by 70
- 2021Revisiting Mahalanobis Distance for Transformer-Based Out-of-Domain Detectioncited by 67
- 2022X-Risk Analysis for AI Researchcited by 60
- 2021Out-of-Scope Intent Detection with Self-Supervision and Discriminative Trainingcited by 42
- 2023Is Fine-tuning Needed? Pre-trained Language Models Are Near Perfect for Out-of-Domain Detectioncited by 29
Built on by
Citing papers per year: 2023: 1; 2024: 2; 2025: 9; 2026: 3.
15 papers.
Sort:
By area:
- 2024Non-Determinism of "Deterministic" LLM Settingscited by 84
- 2025An Empirical Analysis of Uncertainty in Large Language Model Evaluationscited by 20
- 2023A Baseline Analysis of Reward Models' Ability To Accurately Analyze Foundation Models Under Distribution Shiftcited by 17
- 2025Differentially Private Steering for Large Language Model Alignmentcited by 15
- 2024Rethinking the Uncertainty: A Critical Review and Analysis in the Era of Large Language Modelscited by 6
- 2025Evaluating and Improving Robustness in Large Language Models: A Survey and Future Directionscited by 5
- 2025Ensembling Pruned Attention Heads For Uncertainty-Aware Efficient Transformerscited by 5
- 2025Torch-Uncertainty: A Deep Learning Framework for Uncertainty Quantificationcited by 4
- 2026Trust The Typicalcited by 3
- 2025MiST: Understanding the Role of Mid-Stage Scientific Training in Developing Chemical Reasoning Modelscited by 2
- 2025Hypercone Assisted Contour Generation for Out-of-Distribution Detectioncited by 1
- 2025Generative KI f"ur TAcited by 0
3 more
- 2025EPT Benchmark: Evaluation of Persian Trustworthiness in Large Language Modelscited by 0
- 2026Scaling Pretrained Representations Enables Label-Free Out-of-Distribution Detection Without Fine-Tuningcited by 0
- 2026Micro-Macro Retrieval: Reducing Long-Form Hallucination in Large Language Modelscited by 0
- 2026Scaling Pretrained Representations Enables Label-Free Out-of-Distribution Detection Without Fine-Tuning7 May 2026
- 2026Micro-Macro Retrieval: Reducing Long-Form Hallucination in Large Language Models10 Apr 2026
- 2026Trust The Typical4 Feb 2026
- 2025MiST: Understanding the Role of Mid-Stage Scientific Training in Developing Chemical Reasoning Models24 Dec 2025
- 2025Torch-Uncertainty: A Deep Learning Framework for Uncertainty Quantification13 Nov 2025
- 2025Ensembling Pruned Attention Heads For Uncertainty-Aware Efficient Transformers21 Oct 2025
- 2025EPT Benchmark: Evaluation of Persian Trustworthiness in Large Language Models8 Sep 2025
- 2025Generative KI f"ur TA2 Sep 2025
- 2025Evaluating and Improving Robustness in Large Language Models: A Survey and Future Directions8 Jun 2025
- 2025An Empirical Analysis of Uncertainty in Large Language Model Evaluations15 Feb 2025
- 2025Differentially Private Steering for Large Language Model Alignment30 Jan 2025
- 2025Hypercone Assisted Contour Generation for Out-of-Distribution Detection17 Jan 2025
3 more
- 2024Rethinking the Uncertainty: A Critical Review and Analysis in the Era of Large Language Modelscited by 6
- 2025MiST: Understanding the Role of Mid-Stage Scientific Training in Developing Chemical Reasoning Modelscited by 2
- 2026Micro-Macro Retrieval: Reducing Long-Form Hallucination in Large Language Modelscited by 0
- 2026Micro-Macro Retrieval: Reducing Long-Form Hallucination in Large Language Models10 Apr 2026
- 2025MiST: Understanding the Role of Mid-Stage Scientific Training in Developing Chemical Reasoning Models24 Dec 2025
- 2024Rethinking the Uncertainty: A Critical Review and Analysis in the Era of Large Language Models26 Oct 2024
- 2026Trust The Typicalcited by 3
- 2026Trust The Typical4 Feb 2026
- 2024Non-Determinism of "Deterministic" LLM Settingscited by 84
- 2025An Empirical Analysis of Uncertainty in Large Language Model Evaluationscited by 20
- 2025Evaluating and Improving Robustness in Large Language Models: A Survey and Future Directionscited by 5
- 2025Ensembling Pruned Attention Heads For Uncertainty-Aware Efficient Transformerscited by 5
- 2025Torch-Uncertainty: A Deep Learning Framework for Uncertainty Quantificationcited by 4
- 2025Hypercone Assisted Contour Generation for Out-of-Distribution Detectioncited by 1
- 2025Generative KI f"ur TAcited by 0
- 2025EPT Benchmark: Evaluation of Persian Trustworthiness in Large Language Modelscited by 0
- 2026Scaling Pretrained Representations Enables Label-Free Out-of-Distribution Detection Without Fine-Tuningcited by 0
- 2026Scaling Pretrained Representations Enables Label-Free Out-of-Distribution Detection Without Fine-Tuning7 May 2026
- 2025Torch-Uncertainty: A Deep Learning Framework for Uncertainty Quantification13 Nov 2025
- 2025Ensembling Pruned Attention Heads For Uncertainty-Aware Efficient Transformers21 Oct 2025
- 2025EPT Benchmark: Evaluation of Persian Trustworthiness in Large Language Models8 Sep 2025
- 2025Generative KI f"ur TA2 Sep 2025
- 2025Evaluating and Improving Robustness in Large Language Models: A Survey and Future Directions8 Jun 2025
- 2025An Empirical Analysis of Uncertainty in Large Language Model Evaluations15 Feb 2025
- 2025Hypercone Assisted Contour Generation for Out-of-Distribution Detection17 Jan 2025
- 2024Non-Determinism of "Deterministic" LLM Settings6 Aug 2024