SourceReDeEP: Detecting Hallucination in Retrieval-Augmented Generation via Mechanistic Interpretability
The paper identifies the internal mechanism of RAG hallucination in LLaMA2-7B-Chat using mechanistic interpretability. Correlation analysis shows 1006/1024 attention heads have higher external context scores on truthful vs hallucinated responses, and copying heads are strongly associated with hallucinations (PCC 0.41 and 0.46). Causal intervention (noise on copying head attention scores, 10x amplification of knowledge FFN contributions) confirms the causal link: the experimental group's NLL difference is significantly larger than the control group's. Further analysis shows 77.5% of the time attention heads correctly attend to the relevant context, meaning the hallucination arises from the model losing that information during generation rather than from mis-attending. The parametric knowledge injection is concentrated in mid-to-upper layers: removing the 16th layer FFN reduces parametric knowledge bias by 3.05% on HotpotQA versus only 0.11% for the 1st layer. Modulating these components via AARF reduces hallucinations across LLaMA2-7B, LLaMA2-13B, and LLaMA3-8B as judged by GPT-4o.