[Paper Review] Look Within, Why LLMs Hallucinate: A Causal Perspective
This paper investigates how self-attention layers in large language models (LLMs) contribute to hallucinations using a causal inference framework. By selectively disabling specific attention layers while preserving model architecture, the authors find that disabling certain front or tail layers reduces hallucination rates—demonstrating that these layers are primary sources of factually incorrect generations, while middle layers preserve factual knowledge.
The emergence of large language models (LLMs) is a milestone in generative artificial intelligence, achieving significant success in text comprehension and generation tasks. Despite the tremendous success of LLMs in many downstream tasks, they suffer from severe hallucination problems, posing significant challenges to the practical applications of LLMs. Most of the works about LLMs' hallucinations focus on data quality. Self-attention is a core module in transformer-based LLMs, while its potential relationship with LLMs' hallucination has been hardly investigated. To fill this gap, we study this problem from a causal perspective. We propose a method to intervene in LLMs' self-attention layers and maintain their structures and sizes intact. Specifically, we disable different self-attention layers in several popular open-source LLMs and then compare their degrees of hallucination with the original ones. We evaluate the intervened LLMs on hallucination assessment benchmarks and conclude that disabling some specific self-attention layers in the front or tail of the LLMs can alleviate hallucination issues. The study paves a new way for understanding and mitigating LLMs' hallucinations.
Motivation & Objective
- To investigate the causal role of self-attention mechanisms in LLM hallucinations, moving beyond data-centric explanations.
- To determine whether selective intervention in self-attention layers can mitigate hallucination without altering model size or architecture.
- To identify which specific layers are most responsible for generating hallucinated content versus preserving factual knowledge.
- To establish a causal framework for understanding hallucination in LLMs through structural causal modeling and front-door adjustment.
Proposed method
- The authors construct a structural causal model (SCM) to represent the generation process of hallucinated outputs in LLMs.
- They apply the front-door criterion from causal inference to identify self-attention layers as mediating variables between input and hallucinated outputs.
- They intervene by disabling specific self-attention layers in open-source LLMs such as LLaMA-2, Gemma, and Mistral, while keeping model architecture and size unchanged.
- They evaluate the modified models on hallucination detection benchmarks, including TruthfulQA and HaluEval, using GPT-3.5-turbo as a judge model to assess factual correctness.
- Performance is measured via accuracy (ACC) on benchmark datasets, comparing original models (z₀) with intervened models (zᵢ) where specific layers are disabled.
- The analysis focuses on layer-specific impacts, comparing ACC changes across different layer positions (front, middle, tail) to infer causal roles.
Experimental results
Research questions
- RQ1Do different self-attention layers in an LLM have equal influence on hallucination rates?
- RQ2Can disabling specific self-attention layers reduce hallucination while preserving model performance?
- RQ3Which layers—front, middle, or tail—are most responsible for generating hallucinated content?
- RQ4Do middle layers primarily store factual knowledge, as suggested by performance degradation when disabled?
Key findings
- Disabling the 3rd self-attention layer in LLaMA 2-7B-Chat increased accuracy on the TruthfulQA benchmark by approximately 2 percentage points.
- Disabling the 13th layer in Gemma-2B-instruct improved performance on the HaluEval benchmark by 4 percentage points.
- Front and tail layers are most prone to propagate hallucinations, as disabling them consistently reduced hallucination rates across multiple models.
- Middle layers, such as the 12th and 16th layers in LLaMA 2-7B-Chat, are critical for factual knowledge; disabling them significantly degraded performance on hallucination benchmarks.
- The 8th layer in both LLaMA 2-7B-Chat and Gemma-2B-instruct produced correct answers when disabled, indicating that specific layer interventions can correct hallucinatory outputs.
- The study confirms that different attention layers play distinct roles: front/tail layers amplify hallucinations, while middle layers preserve factual consistency.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.