Why Retrieval-Augmented Generation Fails: A Graph Perspective

Kai Guo, Xinnan Dai, Zhibo Zhang, Nuohan Lin, Shenglai Zeng, Jie Ren, Haoyu Han, Jiliang TangarXiv 2026

TL;DR

Retrieval-Augmented Generation (RAG) often fails even when the correct evidence is successfully retrieved. By mapping internal LLM information flow into "attribution graphs," this paper reveals that correct answers rely on deep, question-guided routing, whereas failures stem from shallow, surface-level pattern matching. Leveraging these insights, the authors develop a graph-based error detector and an on-the-fly attention intervention that boosts RAG accuracy by 9%.

What Problem Does This Paper Address?

Retrieval-Augmented Generation (RAG) is the industry standard for grounding Large Language Models (LLMs) in external knowledge bases to reduce hallucinations. However, RAG systems remain frustratingly brittle: models frequently output incorrect answers even when the exact supporting evidence is present in the retrieved context.

Why does this happen? Traditional diagnostic methods treat the LLM as a black box, evaluating only inputs and outputs, or they look at static, single-layer hidden states. These approaches fail to capture the dynamic, multi-layer journey that information takes during decoding. This paper addresses this gap by peering inside the transformer's internal circuits to see exactly how retrieved evidence is propagated, transformed, and integrated across layers.

Methods

The authors introduce a graph-based framework to analyze the internal mechanics of RAG reasoning:

  • Circuit Tracing & Attribution Graphs: The authors construct token-level directed attribution graphs $G=(V,E)$. Nodes represent token activations at specific layers, and edge weights quantify their causal contribution to the final predicted token (target logit).
  • Linearization via Transcoders: To make the highly non-linear transformer math tractable, they replace MLP blocks with trained transcoders and fix attention patterns. This creates a locally linearized model where attributions can be cleanly decomposed and aggregated.
  • Graph-Structural Error Detection: They train a 2-layer Graph Transformer Encoder on these attribution graphs to classify whether a model's internal reasoning structure points to a correct or incorrect answer.
  • Layer-Wise Routing Control (Intervention): Instead of retraining the model or re-retrieving documents, they introduce forward hooks to dynamically alter attention weights during inference. This control amplifies question-focus in early layers, suppresses premature reliance on external context, and maintains question guidance in later decoding stages.

Datasets

The authors evaluate their approach across three standard multi-hop question-answering benchmarks where answering requires composing evidence across multiple passages:

  • HotpotQA
  • 2WikiMultihopQA
  • MuSiQue

To test the model's resilience to noise, they introduce Mix-MuSiQue, a challenging mixed-context variant where each question is deliberately paired with a blend of both supporting and distracting (non-supporting) passages.

Key Insights and Ideas

  • Structural Signatures of Truth: Correct answers leave a distinct topological footprint. Their attribution graphs feature deeper propagation paths, denser cross-token connectivity, and more distributed information flow. Conversely, incorrect answers are shallow, fragmented, and bottlenecked through a few dominant nodes.
Figure 1: Radar comparison of attribution-graph structural metrics between correct and wrong predictions across three QA datasets (2Wiki, HotpotQA, and MuSiQue).
  • The Mid-Layer Sweet Spot: Correct predictions allocate significantly more attribution mass to the middle layers (layers 8–18), where the model synthesizes complex representations. Failed predictions spike in early layers, indicating a superficial, knee-jerk matching of text patterns without deeper integration.
Figure 2: Layer-wise attribution mass for correct and wrong predictions (left) and their difference on MuSiQue (right).
  • SAEG vs. QCEG: In mixed-context environments, failures follow a pattern the authors call Surface-Aligned Evidence Grounding (SAEG)—the model gets distracted by context that superficially resembles the question and loses its grip on the actual prompt constraints. Successes rely on Question-Constrained Evidence Grounding (QCEG), where the question continuously anchors and filters the evidence throughout the network.

Key Results

  • Better Error Detection: The Graph Transformer detector outperformed standard logit-based self-evaluation (asking the model "Is this answer correct?") by 11.53% on average across all benchmarks, proving that internal structural coherence is a highly reliable signal for truthfulness.
  • Inference-Time Boost: Applying the layer-wise attention intervention on the challenging Mix-MuSiQue dataset raised the baseline model's accuracy from 56.5% to 61.6% (a 9% relative improvement) without changing a single model weight or requiring retraining.

Limitations and Future Work

  • Hyperparameter Tuning: The intervention scales ($\alpha_{QQ}, \alpha_{ctx}, \alpha_{QIn}$) are currently static hyperparameters that require manual tuning; developing dynamic or automated scaling methods would improve flexibility.
  • Model Scale: The study focused primarily on 8B parameter models (LLaMA-3 and Qwen-3). Scaling these graph-circuit analyses to larger models (e.g., 70B+) remains an open challenge.
  • Computational Overhead of Graph Construction: While the inference intervention itself is lightweight, constructing the initial attribution graphs requires transcoder passes, which adds computational complexity during the diagnostic phase.

Summary updated

Abstract

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.
BibTeX
@misc{guo2026why,
  author = {Kai Guo and Xinnan Dai and Zhibo Zhang and Nuohan Lin and Shenglai Zeng and Jie Ren and Haoyu Han and Jiliang Tang},
  title = {{Why Retrieval-Augmented Generation Fails: A Graph Perspective}},
  year = {2026},
  eprint = {2605.14192},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.14192},
}

Loading related content...

Figure