通过分析注意力高频变化,高效检测大模型生成中的幻觉问题。
Detecting Contextual Hallucinations in LLMs with Frequency-Aware Attention
- 将注意力分布视为信号,提取高频成分捕捉生成时的不稳定性。
- 在RAGTruth和HalluRAG上优于现有方法,提升幻觉检测准确率。
- 轻量级设计,适用于多种模型与任务,适合追求可靠生成的场景。
幻觉检测对保障大语言模型在上下文生成中的可靠性至关重要。以往工作利用生成过程中的内在信号,其中注意力机制可直接反映模型的指代行为。然而,现有方法通常依赖粗粒度摘要,难以捕捉注意力的细微波动。受信号处理启发,我们从频率角度分析注意力变化:将注意力分布建模为离散信号,提取反映注意力快速局部变动的高频成分。分析表明,幻觉词汇对应高频率注意力能量,体现碎片化与不稳定的指代行为。基于此,我们提出一种基于高频注意力特征的轻量级幻觉检测器。在RAGTruth和HalluRAG基准上的实验表明,该方法在不同模型与任务中均优于基于验证、内部表示及注意力的方法。
原文摘要 · Abstract (English)
Hallucination detection is critical for ensuring the reliability of large language models (LLMs) in context-based generation. Prior work has explored intrinsic signals available during generation, among which attention offers a direct view of grounding behavior. However, existing approaches typically rely on coarse summaries that fail to capture fine-grained instabilities in attention. Inspired by signal processing, we introduce a frequency-aware perspective on attention by analyzing its variation during generation. We model attention distributions as discrete signals and extract high-frequency components that reflect rapid local changes in attention. Our analysis reveals that hallucinated tokens are associated with high-frequency attention energy, reflecting fragmented and unstable grounding behavior. Based on this insight, we develop a lightweight hallucination detector using high-frequency attention features. Experiments on the RAGTruth and HalluRAG benchmarks show that our approach achieves performance gains over verification-based, internal-representation-based, and attention-based methods across models and tasks.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。