TL;DR This paper introduces a novel "entity-aware" probing framework to trace how Large Language Models (LLMs) reconcile their internal "parametric" knowledge with external "contextual" information (like that provided by Retrieval-Augmented Generation, or RAG). The researchers discovered that LLMs use distinct sets of attention heads for these two sources. Furthermore, conflicting information isn't simply erased; it is reconciled through a process of signal accumulation and "superposition."
The Challenge of Knowledge Conflicts
Retrieval-Augmented Generation (RAG) has become the industry standard for mitigating LLM hallucinations and updating outdated information. However, a significant challenge arises when the retrieved context contradicts the model’s internal training data. For instance, if the model's internal parameters "know" one person is a CEO, but an injected document states it is someone else, the model faces a knowledge conflict.
Until now, the internal mechanics of how an LLM's layers decide which source to trust have remained largely opaque. Previous attempts to study this using "linear probes"—small classifiers trained to find information in hidden layers—were too rigid, unable to adapt to new, arbitrary entities on the fly. This paper aims to open the "black box" of knowledge reconciliation by tracing the flow of specific entities through the model's architecture.
Methodology: Entity-Aware Probing
To overcome the limitations of static probes, the authors propose a dynamic framework called Entity-Aware Probing.
- The Probe: Instead of a static target, the researchers append a specific triple—
[START] {target_entity} [END]—to the prompt. - Lightweight Adaptation: They utilize a tiny, rank-8 LoRA (Low-Rank Adaptation) update specifically for the input embedding layer. This allows the probe to "focus" on the target entity markers without altering the underlying weights of the LLM.
- Residual Stream Analysis: The transformer's computation is decomposed into three critical points per layer: the Attention Update, the MLP Update, and the Layer Output. By probing these points, the researchers can pinpoint exactly when and where a specific piece of knowledge emerges or gets suppressed.
Experimental Setup
The study utilized several datasets to train and evaluate the probe:
- HotpotQA: The primary source for training the probe and conducting sentence-level attribution.
- TriviaQA & SQuAD: Used to evaluate the probe's ability to identify relevant passages in attribution tasks.
- Counterfactual HotpotQA: The authors used DeepSeek-v3 to rewrite factual evidence into fictional "counterfactual" scenarios, intentionally triggering knowledge conflicts for their analysis.
Key Insights
The entity-aware probing revealed several fascinating mechanisms about internal LLM behavior:
- Specialized Routing (Division of Labor): Contextual knowledge and parametric knowledge are processed by entirely different sets of attention heads. "Contextual heads" act like retrievers pulling from the prompt, while "memory heads" access internal parameters. Notably, there is almost no competition between these two types of heads.
- Asymmetric Propagation: Contextual knowledge tends to appear abruptly in early layers via attention mechanisms. In contrast, parametric knowledge builds up gradually across layers through the MLP modules, which function similarly to key-value memories.
- Superpositional Reconciliation: When faced with conflicting information, the model rarely "erases" the incorrect signal from its hidden states. Instead, both the "correct" and "incorrect" signals coexist. The model's final output is determined by accumulation magnitude: if multiple sources align, that signal is reinforced (superpositioned) until it dominates the final prediction.
- Intra-type Competition: Competition for attention happens within a knowledge type (e.g., two conflicting documents fighting for dominance) but rarely across types (e.g., a document versus the model's internal memory).
Key Results
- High Probe Accuracy: The entity-aware probe successfully identified relevant entities in hidden states, outperforming standard Prompting and Chain-of-Thought methods on attribution tasks for open-source models like LLaMA 3.1 and Qwen 2.5.
- Causal Intervention: By artificially "zeroing out" the top-10 identified context heads, the researchers forced the model to ignore the RAG document and rely solely on its internal memory (increasing factual answers from 22.7% to 34.9%). Conversely, zeroing out memory heads made the model stubbornly reliant on the provided context.
- Validation of Internal Beliefs: Probing a randomly initialized model resulted in a total collapse of performance. This proves that the probe extracts the model's actual internal beliefs rather than just learning the task via the LoRA update.
Limitations and Future Work
While groundbreaking, the study has limitations. It focused exclusively on decoder-only transformers (LLaMA and Qwen series), leaving it an open question whether encoder-decoder models or massive models like GPT-4 follow the same routing logic. Additionally, the experiments relied primarily on entity substitution (swapping names). Real-world conflicts are often more nuanced, involving complex logic, temporal changes, or numerical discrepancies. Finally, the authors acknowledge the "observer effect"—the act of probing might slightly alter the model's natural internal behavior. Future work will likely focus on developing even less intrusive tracing methods.
Summary updated