从图结构视角揭示RAG失败根源并提出纠错方法
Why Retrieval-Augmented Generation Fails: A Graph Perspective

- 构建归因图追踪信息在模型中的流动路径
- 正确推理具深层、分散的证据流,错误则集中碎片化
- 基于图拓扑可检测错误,还能精准干预优化
检索增强生成(RAG)通过引入外部证据提升大语言模型表现,但依然频繁出错。本文通过电路追踪构建归因图,刻画生成过程中检索上下文、模型激活与生成标记之间的信息流动。在多个问答基准测试中发现:正确预测对应更深层推理路径、更分布式的证据传播和更有序的局部连接结构;而失败预测则呈现浅层、碎片化、高度集中的证据流。基于此,我们提出一种基于图拓扑特征的错误检测框架,并验证可通过强化问题约束的证据对齐,重构内部路由机制,使生成过程持续受问题引导,从而更有效融合检索信息,减少错误。
原文摘要 · Abstract (English)
Retrieval-Augmented Generation (RAG) has become a powerful and widely used approach for improving large language models by grounding generation in retrieved evidence. However, RAG systems still produce incorrect answers in many cases. Why RAG fails despite having access to external information remains poorly understood. We present a model-internal study of retrieval-augmented generation that examines how retrieved evidence influences answer generation. Using circuit tracing, we construct attribution graphs that model the flow of information through transformer layers during decoding. These graphs represent interactions among retrieved context, intermediate model activations, and generated tokens, providing a graph, circuit-level view of how external evidence is integrated into the model's reasoning process across multiple question answering benchmarks, we observe consistent structural differences: correct predictions exhibit deeper reasoning paths, more distributed evidence flow, and a more structured pattern of local connectivity, while failed predictions show shallower, fragmented, and overly concentrated evidence flow. Building on these findings, we develop a graph-based error detection framework that uses attribution-graph topology features. Furthermore, we show that attribution graphs enable targeted interventions. By reinforcing question-constrained evidence grounding, we reshape internal routing so that answer generation remains guided by the question, leading to more effective integration of retrieved information and fewer errors.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。