arXiv:2506.09886cs.CLcs.AI2025-06被引 2

用嵌入分布距离检测大模型幻觉,尤其适合RAG场景。

Probabilistic distances-based hallucination detection in LLMs with RAG

  • 通过对比提示词与回复词嵌入分布的几何距离,判断事实性。
  • 在多个数据集上达到领先或相当的检测效果。
  • 无需标注数据,可迁移用于不同任务,适合长文本处理。

大语言模型(LLMs)中的幻觉检测对其在各类应用中的安全性至关重要。若缺乏有效检测,系统常生成有害或不可靠的回答。近年来,LLMs广泛应用于检索增强生成(RAG)场景,但幻觉问题依然存在。尽管已有多种检测方法,多数未针对RAG设计。为此,本文提出一种基于提示词嵌入分布与模型回复嵌入分布间距离估计的幻觉检测方法。该方法通过分析嵌入隐藏状态的几何结构,可靠提取文本真实性的信号,同时对长序列友好。大量实验表明,该方法在多个基准上达到当前最优或具有竞争力的表现,并展现出从自然语言推理(NLI)任务到幻觉检测任务的可迁移性,实现完全无监督且高效的检测性能。

原文摘要 · Abstract (English)

Detecting hallucinations in large language models (LLMs) is critical for their safety in many applications. Without proper detection, these systems often provide harmful, unreliable answers. In recent years, LLMs have been actively used in retrieval-augmented generation (RAG) settings. However, hallucinations remain even in this setting, and while numerous hallucination detection methods have been proposed, most approaches are not specifically designed for RAG systems. To overcome this limitation, we introduce a hallucination detection method based on estimating the distances between the distributions of prompt token embeddings and language model response token embeddings. The method examines the geometric structure of token hidden states to reliably extract a signal of factuality in text, while remaining friendly to long sequences. Extensive experiments demonstrate that our method achieves state-of-the-art or competitive performance. It also has transferability from solving the NLI task to the hallucination detection task, making it a fully unsupervised and efficient method with a competitive performance on the final task.

幻觉检测RAG无监督学习

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。