用图信号处理分析大模型注意力,识别幻觉类型
A Graph Signal Processing Framework for Hallucination Detection in Large Language Models
- 将注意力层建模为动态图,用信号能量检测推理模式
- 逻辑矛盾导致谱不稳定,准确率比基线高13.75%
- 适合研究模型可信性与幻觉机制的AI从业者
大型语言模型虽表现优异,但区分事实推理与幻觉仍具挑战。本文提出一种谱分析框架,将Transformer层视为由注意力诱导的动态图,词元嵌入作为图上的信号。通过图信号处理定义了狄利克雷能量、谱熵和高频能量比等诊断指标,并建立其与计算稳定性的理论联系。在GPT系列模型上的实验表明,存在普遍的谱模式:事实陈述呈现稳定的“能量山”特征,低频收敛;不同类型的幻觉具有独特谱签名:逻辑矛盾使谱显著失稳(效应量g>1.0),语义错误保持稳定但出现连通性漂移,替换型幻觉表现为中等扰动。基于谱特征的简单检测器达到88.75%准确率,优于困惑度基线(75%),验证了其实用价值。结果表明,谱几何可能捕捉推理模式与错误行为,为大模型幻觉检测提供新框架。
原文摘要 · Abstract (English)
Large language models achieve impressive results but distinguishing factual reasoning from hallucinations remains challenging. We propose a spectral analysis framework that models transformer layers as dynamic graphs induced by attention, with token embeddings as signals on these graphs. Through graph signal processing, we define diagnostics including Dirichlet energy, spectral entropy, and high-frequency energy ratios, with theoretical connections to computational stability. Experiments across GPT architectures suggest universal spectral patterns: factual statements exhibit consistent "energy mountain" behavior with low-frequency convergence, while different hallucination types show distinct signatures. Logical contradictions destabilize spectra with large effect sizes ($g>1.0$), semantic errors remain stable but show connectivity drift, and substitution hallucinations display intermediate perturbations. A simple detector using spectral signatures achieves 88.75% accuracy versus 75% for perplexity-based baselines, demonstrating practical utility. These findings indicate that spectral geometry may capture reasoning patterns and error behaviors, potentially offering a framework for hallucination detection in large language models.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。