Introduction: The Conflict of Knowledge
Large Language Models (LLMs) are trained on vast datasets, internalizing a massive amount of "Parametric Knowledge" (PK). However, in practical applications like Retrieval-Augmented Generation (RAG), they are often provided with "Contextual Knowledge" (CK) in the prompt. A critical challenge arises when these two sources conflict—for instance, if a prompt asserts a counterfactual fact like "The capital of France is London." This paper investigates the internal mechanisms that determine whether a model prioritizes its internal memory or the external context.
Methodology: Probing Internal Activations
To understand this decision-making process, the authors developed a probing framework designed to identify the knowledge source of a model's output based on its internal activations.
The researchers induced conflicts by providing prompts that contradicted known facts (e.g., "Brazil is located in Europe"). They then extracted activations from Multi-Layer Perceptron (MLP) modules and Multi-Head Self-Attention (MHSA) outputs across all layers. A simple linear classifier was trained on these activations to predict the model's final choice between the parametric and contextual answers. Crucially, the study targeted specific tokens within the sequence: the object in the context, and the subject and relation in the query.
Key Insights: The "Relation" Token as a Decision Hub
The study's most significant finding is that the activations at the relation token (e.g., "headquartered" or "located in") serve as the primary indicator of the model's knowledge selection.
As shown in the probing results across various models (Phi-1.5, Llama3-8B, Mistral-7B, and Pythia-1.4B), the success rate of the probes peaks in the middle layers, particularly for the relation token. This suggests that the "decision" to trust context or memory is not made at the very beginning or end of processing but is a mid-layer phenomenon associated with attribute extraction.
Furthermore, the research revealed that "familiarity breeds stubbornness." By analyzing subject frequency in training data proxies like The Pile, the authors found that models are significantly more likely to ignore contextual prompts in favor of parametric knowledge when the subject is highly frequent in their training data.
Results and Generalization
The linear probes achieved remarkably high predictive accuracy, reaching up to 87% for models like Pythia-1.4B. Importantly, these findings were consistent across different model architectures. The study also demonstrated that the knowledge selection mechanism is generalizable; a classifier trained on one type of relation (e.g., geography) could accurately predict knowledge sources for entirely different relations (e.g., corporate headquarters), indicating a fundamental internal process rather than fact-specific rules.
Conclusion and Future Directions
This work provides a window into the "black box" of LLM decision-making during knowledge conflicts. While the current study focuses on binary contradictions in decoder-only models, it sets the stage for future work in "activation steering." By identifying the specific signals that govern knowledge selection, researchers may eventually be able to manually adjust these activations to ensure models prioritize the most reliable information source in real-time.
Summary updated