为什么LLMs会在结构化知识上产生幻觉:对线性化表示推理的机制分析
Why LLMs Hallucinate on Structured Knowledge: A Mechanistic Analysis of Reasoning over Linearized Representations
AI总结:
本文通过机制分析发现,大型语言模型在结构化知识推理中产生幻觉是由于注意力过度集中于捷径式结构线索和前馈层未能将知识语义接地,导致模型依赖参数记忆。
摘要:
在许多推理任务中,大型语言模型(LLMs)依赖于结构化外部知识,如图和表格,这些知识通常被线性化为连续的令牌表示。然而,即使有足够的知识可用,LLMs仍然可能产生幻觉输出,这种失败背后的潜在机制仍然知之甚少。我们研究了这些机制,发现幻觉源于系统性的内部动态而非随机噪声。首先,注意力不成比例地集中在类似捷径的结构线索上,而不是分布在完整的上下文中。其次,前馈表示未能将提供的知识接地,导致模型回归到参数记忆。此外,我们的结果表明,幻觉始终与前馈层中的语义接地失败相关,而注意力分配表现出更大的任务依赖性。最后,我们展示了这些机制模式从单跳图推广到多跳和表格设置,从而能够在结构化知识格式中有效检测幻觉。
英文摘要:
In many reasoning tasks, large language models (LLMs) rely on structured external knowledge, such as graphs and tables, which is typically linearized into sequential token representations. However, even when sufficient knowledge is available, LLMs can still produce hallucinated outputs, and the underlying mechanisms behind such failures remain poorly understood. We investigate these mechanisms and find that hallucinations arise from systematic internal dynamics rather than random noise. First, attention disproportionately concentrates toward shortcut-like structural cues rather than distributing across the full context. Second, feed-forward representations fail to ground the provided knowledge, causing the model to revert to parametric memory. Moreover, our results indicate that hallucination is consistently associated with failures in semantic grounding within feed-forward layers, while attention allocation exhibits greater task-dependent variability. Finally, we show that these mechanistic patterns generalize beyond single-hop graphs to multi-hop and tabular settings, enabling effective hallucination detection across structured knowledge formats.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。