用注意力图的谱特征检测大模型幻觉,效果领先。
Hallucination Detection in LLMs Using Spectral Features of Attention Maps
- 将注意力图看作图结构邻接矩阵,提取拉普拉斯矩阵前k个特征值
- 在多个数据集上达到当前最优幻觉检测准确率
- 方法通用性强,适合安全敏感场景下的模型验证
大型语言模型在多项任务中表现优异,但仍易产生幻觉。检测幻觉对安全关键应用至关重要,现有方法虽利用注意力图特性,但效果有限。本文将注意力图视为图结构的邻接矩阵,提出基于拉普拉斯矩阵前k个特征值(LapEigvals)的检测方法。通过实证评估,该方法在基于注意力的幻觉检测中达到当前最优性能。大量消融实验进一步验证了其鲁棒性与泛化能力,为幻觉检测研究提供新方向。
原文摘要 · Abstract (English)
Large Language Models (LLMs) have demonstrated remarkable performance across various tasks but remain prone to hallucinations. Detecting hallucinations is essential for safety-critical applications, and recent methods leverage attention map properties to this end, though their effectiveness remains limited. In this work, we investigate the spectral features of attention maps by interpreting them as adjacency matrices of graph structures. We propose the $\text{LapEigvals}$ method, which utilises the top-$k$ eigenvalues of the Laplacian matrix derived from the attention maps as an input to hallucination detection probes. Empirical evaluations demonstrate that our approach achieves state-of-the-art hallucination detection performance among attention-based methods. Extensive ablation studies further highlight the robustness and generalisation of $\text{LapEigvals}$, paving the way for future advancements in the hallucination detection domain.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。