基于不确定性感知注意力头的高效大语言模型幻觉检测
Efficient Hallucination Detection for LLMs Using Uncertainty-Aware Attention Heads
AI总结:
提出RAUQ框架,利用不确定性感知注意力头与令牌级置信度,通过单次前向传递实现无监督、高效的序列级幻觉检测,在12个数据集上优于现有方法且额外计算少于1%。
摘要:
尽管大型语言模型(LLM)已经变得非常强大,但它们仍然容易出现事实性错误,通常称为“幻觉”。不确定性量化(UQ)为缓解这一问题提供了一种有前景的方法,但大多数现有方法计算量大且/或需要监督。在这项工作中,我们提出了基于循环注意力的不确定性量化(RAUQ),这是一种无监督且高效的幻觉识别框架。该方法利用了Transformer注意力行为的一个观察:当生成错误信息时,某些“不确定性感知”注意力头倾向于减少对前驱令牌的关注。RAUQ自动检测这些注意力头,并以循环方式将其激活模式与令牌级置信度度量相结合,仅通过一次前向传递即可生成序列级不确定性估计。通过在涵盖问答、摘要和翻译的十二个数据集上对九个不同LLM进行的实验,我们表明RAUQ始终优于最先进的UQ基线。重要的是,它产生的开销极小,所需的额外计算不到1%。由于它既不需要标记数据也不需要广泛的参数调整,RAUQ可作为白盒LLM中实时幻觉检测的轻量级即插即用解决方案。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。