Lune

EMNLP Findings2024

CED: Comparing Embedding Differences for Detecting Out-of-Distribution and Hallucinated Text

Hakyung Lee, Keon-Hee Park, Hoyoon Byun, Jeyoon Yeom, Jihee Kim, Gyeong-Moon Park, Kyungwoo Song

Abstract

Detecting out-of-distribution (OOD) samples is crucial for ensuring safety and robustness of models deployed in real-world scenarios. While most OOD detection studies focus on fine-tuned models trained on in-distribution (ID) data, detecting OOD in pre-trained models is also important due to computational limits and the widespread use of open-source models. However, pre-trained models often underperform in same domain shift scenarios, as both ID and OOD samples originate from the same domain, leading to high overlap in their embeddings. To address this issue, we propose CED, a training-free OOD detection method that enhances the distinction between ID and OOD samples. We theoretically validate that strategically selected auxiliary and oracle samples improve this separation. On the basis of our theoretical analysis, CED utilizes these specially designed samples to significantly improve the ability of pre-trained models to differentiate ID from OOD samples in text classification and hallucination detection tasks. We verify that CED is a plug-and-play method compatible with various backbone networks like RoBERTa, Llama, and OpenAI Embedding.

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.

3 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

  • SelfCheckGPT: Zero-Resource Black-Box Hallucination Detection for Generative Large Language Models cites Language Models are Few-Shot Learners
  • TPA: Next Token Probability Attribution for Detecting Hallucinations in RAG cites SelfCheckGPT: Zero-Resource Black-Box Hallucination Detection for Generative Large Language Models
  • TPA: Next Token Probability Attribution for Detecting Hallucinations in RAG cites Energy-based Out-of-distribution Detection
  • Robust Hallucination Detection in LLMs via Adaptive Token Selection cites SelfCheckGPT: Zero-Resource Black-Box Hallucination Detection for Generative Large Language Models
  • HaluEval: A Large-Scale Hallucination Evaluation Benchmark for Large Language Models cites SelfCheckGPT: Zero-Resource Black-Box Hallucination Detection for Generative Large Language Models
  • HaluEval: A Large-Scale Hallucination Evaluation Benchmark for Large Language Models cites Language Models are Few-Shot Learners
  • Beyond the Known: An Unknown-Aware Large Language Model for Open-Set Text Classification cites Energy-based Out-of-distribution Detection
  • Beyond the Known: An Unknown-Aware Large Language Model for Open-Set Text Classification cites HaluEval: A Large-Scale Hallucination Evaluation Benchmark for Large Language Models
  • Out-of-Distribution Detection with Deep Nearest Neighbors cites Energy-based Out-of-distribution Detection
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers3

  1. Robust Hallucination Detection in LLMs via Adaptive Token SelectionMengjia Niu, Hamed Haddadi, Guansong PangNeurIPS 2025 · 24 citations
  2. TPA: Next Token Probability Attribution for Detecting Hallucinations in RAGPengqian Lu, Jie Lu, Anjin Liu, Guangquan ZhangACL 2026 · 1 citation
  3. Beyond the Known: An Unknown-Aware Large Language Model for Open-Set Text ClassificationXi Chen, Chuan Qin, Ziqi Wang, Shasha Hu et al.ICLR 2026

Builds on14

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. Energy-based Out-of-distribution DetectionWeitang Liu, Xiaoyun Wang, John D. Owens, Yixuan LiNeurIPS 2020 · 2,213 citations
  3. Out-of-Distribution Detection with Deep Nearest NeighborsYiyou Sun, Yifei Ming, Xiaojin Zhu, Yixuan LiICML 2022 · 789 citations
  4. SelfCheckGPT: Zero-Resource Black-Box Hallucination Detection for Generative Large Language ModelsPotsawee Manakul, Adian Liusie, Mark J. F. GalesEMNLP 2023 · 331 citations
  5. HaluEval: A Large-Scale Hallucination Evaluation Benchmark for Large Language ModelsJunyi Li, Xiaoxue Cheng, Xin Zhao, Jian-Yun Nie et al.EMNLP 2023 · 224 citations

Related papers

  1. From Out-of-Distribution Detection to Hallucination Detection: A Geometric ViewLitian Liu, Reza Pourreza, Yubing Jian, Yao Qin et al.ICML 2026 · 1 citation
  2. Is Fine-tuning Needed? Pre-trained Language Models Are Near Perfect for Out-of-Domain DetectionRheeya Uppaal, Junjie Hu, Yixuan LiACL 2023 · 9 citations
  3. MASKER: Masked Keyword Regularization for Reliable Text ClassificationSeung Jun Moon, Sangwoo Mo, Kimin Lee, Jaeho Lee et al.AAAI 2021 · 39 citations
  4. In or Out? Fixing ImageNet Out-of-Distribution Detection EvaluationJulian Bitterwolf, Maximilian Müller, Matthias HeinICML 2023 · 154 citations
  5. Types of Out-of-Distribution Texts and How to Detect ThemUdit Arora, William Huang, He HeEMNLP 2021
Dusk over the sea between two cliffs drawn in fine vertical lines