mlsanityData to 7 Oct 2026

Your Finetuned Large Language Model is Already a Powerful Out-of-distribution Detector

arXiv 2404.08679 ↗First posted 7 Apr 2024cs.CL cs.AI cs.LGcited by 11

Not on the map. Why?

Abstract (arXiv)

We revisit the likelihood ratio between a pretrained large language model (LLM) and its finetuned variant as a criterion for out-of-distribution (OOD) detection. The intuition behind such a criterion is that, the pretrained LLM has the prior knowledge about OOD data due to its large amount of training data, and once finetuned with the in-distribution data, the LLM has sufficient knowledge to distinguish their difference. Leveraging the power of LLMs, we show that, the likelihood ratio can serve as an effective OOD detection criterion. Moreover, we apply the proposed LLM-based likelihood ratio to detect OOD questions in question-answering (QA) systems, which can be used to improve the performance of specialized LLMs for general questions. Given that likelihood can be easily obtained by the loss functions within contemporary neural network frameworks, it is straightforward to implement this approach in practice. Since both the pretrained LLMs and its various finetuned models are widely available from online platforms such as Hugging Face, our proposed criterion can be effortlessly incorporated for OOD detection without the need for further training. We conduct comprehensive evaluation across on multiple settings, including far OOD, near OOD, spam detection, and QA scenarios, to demonstrate the effectiveness of the method. Code can be found at https://github.com/andiac/LLMOODratio

Key facts. Cited by 11 papers in the map (data through 7 Oct 2026). Builds on 38 of its 49 references that are in the map. First posted on arXiv 7 Apr 2024.

Builds on

38 of 49 references.

References · 38

  1. 2020Language Models are Few-Shot Learnerscited by 32,199
  2. 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,084
  3. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
  4. 2021Training Verifiers to Solve Math Word Problemscited by 9,743
  5. 2021Measuring Mathematical Problem Solving With the MATH Datasetcited by 5,203
  6. 2021On the Opportunities and Risks of Foundation Modelscited by 3,961
  7. 2023Mistral 7Bcited by 3,065
  8. 2019PIQA: Reasoning about Physical Commonsense in Natural Languagecited by 2,818
  9. 2020Supervised Contrastive Learningcited by 2,803
  10. 2016A Baseline for Detecting Misclassified and Out-of-Distribution Examples in Neural Networkscited by 2,362
  11. 2019BoolQ: Exploring the Surprising Difficulty of Natural Yes/No Questionscited by 2,140
  12. 2020Don't Stop Pretraining: Adapt Language Models to Domains and Taskscited by 1,548
26 more
  1. 2018Know What You Don't Know: Unanswerable Questions for SQuADcited by 1,538
  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. 2019PubMedQA: A Dataset for Biomedical Research Question Answeringcited by 1,271
  5. 2023MetaMath: Bootstrap Your Own Mathematical Questions for Large Language Modelscited by 724
  6. 2022Out-of-Distribution Detection with Deep Nearest Neighborscited by 596
  7. 2019Likelihood Ratios for Out-of-Distribution Detectioncited by 451
  8. 2018Do Deep Generative Models Know What They Don't Know?cited by 443
  9. 2022ViM: Out-Of-Distribution with Virtual-logit Matchingcited by 404
  10. 2019An Evaluation Dataset for Intent Classification and Out-of-Scope Predictioncited by 378
  11. 2018Snips Voice Platform: an embedded Spoken Language Understanding system for private-by-design voice interfacescited by 376
  12. 2022OpenOOD: Benchmarking Generalized Out-of-Distribution Detectioncited by 267
  13. 2021When Does Pretraining Help? Assessing Self-Supervised Learning for Law and the CaseHOLD Datasetcited by 199
  14. 2019Input complexity and out-of-distribution detection with likelihood-based generative modelscited by 186
  15. 2021Contrastive Out-of-Distribution Detection for Pretrained Transformerscited by 70
  16. 2021Revisiting Mahalanobis Distance for Transformer-Based Out-of-Domain Detectioncited by 67
  17. 2020Understanding Anomaly Detection with Deep Invertible Networks through Hierarchies of Distributions and Featurescited by 64
  18. 2022Boosting Out-of-distribution Detection with Typical Featurescited by 48
  19. 2019Likelihood Ratios and Generative Classifiers for Unsupervised Out-of-Domain Detection In Task Oriented Dialogcited by 33
  20. 2021On the Out-of-distribution Generalization of Probabilistic Image Modellingcited by 32
  21. 2020Wat zei je? Detecting Out-of-Distribution Translations with Variational Transformerscited by 31
  22. 2023Is Fine-tuning Needed? Pre-trained Language Models Are Near Perfect for Out-of-Domain Detectioncited by 29
  23. 2021Entropic Issues in Likelihood-Based OOD Detectioncited by 16
  24. 2022Towards Textual Out-of-Domain Detection without In-Domain Labelscited by 14
  25. 2023Spam-T5: Benchmarking Large Language Models for Few-Shot Email Spam Detectioncited by 12
  26. 2022Falsehoods that ML researchers believe about OOD detectioncited by 8

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 3; 2025: 4; 2026: 4.

11 papers.