arXiv:2505.20045cs.CL2025-05被引 14

无需标注数据,单次前向传播即可高效检测大模型幻觉。

Efficient Hallucination Detection for LLMs Using Uncertainty-Aware Attention Heads

  • 利用注意力头对错误信息的敏感性,自动识别不确定性区域。
  • 在12个数据集上超越现有方法,额外计算开销不足1%。
  • 适合需要实时检测的白盒大模型部署场景。

尽管大语言模型(LLMs)能力日益增强,仍易产生事实性错误,即“幻觉”。不确定性量化(UQ)是缓解此问题的潜在途径,但现有方法通常计算成本高且需监督。本文提出一种无监督、高效的框架RAUQ,通过观察变压器注意力行为:生成错误信息时,某些“不确定性感知”注意力头会减弱对先前标记的关注。RAUQ自动识别这些注意力头,结合其激活模式与词级别置信度,在递归结构中实现单次前向传播的序列级不确定性估计。在涵盖问答、摘要和翻译的12个数据集上,针对9种不同LLMs的实验表明,RAUQ持续优于现有先进UQ基线。重要的是,其额外计算开销低于1%,且无需标签数据或大量参数调优,可作为轻量级、即插即用的白盒大模型实时幻觉检测方案。

原文摘要 · Abstract (English)

While large language models (LLMs) have become highly capable, they remain prone to factual inaccuracies, commonly referred to as "hallucinations." Uncertainty quantification (UQ) offers a promising way to mitigate this issue, but most existing methods are computationally intensive and/or require supervision. In this work, we propose Recurrent Attention-based Uncertainty Quantification (RAUQ), an unsupervised and efficient framework for identifying hallucinations. The method leverages an observation about transformer attention behavior: when incorrect information is generated, certain "uncertainty-aware" attention heads tend to reduce their focus on preceding tokens. RAUQ automatically detects these attention heads and combines their activation patterns with token-level confidence measures in a recurrent scheme, producing a sequence-level uncertainty estimate in just a single forward pass. Through experiments on twelve datasets spanning question answering, summarization, and translation across nine different LLMs, we show that RAUQ consistently outperforms state-of-the-art UQ baselines. Importantly, it incurs minimal overhead, requiring less than 1\% additional computation. Since it requires neither labeled data nor extensive parameter tuning, RAUQ serves as a lightweight, plug-and-play solution for real-time hallucination detection in white-box LLMs.

幻觉检测不确定性量化注意力机制轻量化

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