Table of Contents
Fetching ...

Look Within, Why LLMs Hallucinate: A Causal Perspective

He Li, Haoang Chi, Mingyu Liu, Wenjing Yang

TL;DR

This work investigates how the self-attention mechanism in open-source LLMs contributes to hallucinations from a causal perspective. By constructing a structural causal model and applying front-door adjustment, the authors intervene in self-attention layers by zeroing their outputs during forward passes, leaving model architecture intact. They show that disabling certain front or tail layers can reduce fact-conflicting hallucinations on standard benchmarks, while disabling middle layers often harms factual accuracy, suggesting layer-specific roles in hallucination content. The results illuminate a new, architecture-centric path to understanding and mitigating hallucinations, with practical implications for safer deployment of LLMs.

Abstract

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.

Look Within, Why LLMs Hallucinate: A Causal Perspective

TL;DR

This work investigates how the self-attention mechanism in open-source LLMs contributes to hallucinations from a causal perspective. By constructing a structural causal model and applying front-door adjustment, the authors intervene in self-attention layers by zeroing their outputs during forward passes, leaving model architecture intact. They show that disabling certain front or tail layers can reduce fact-conflicting hallucinations on standard benchmarks, while disabling middle layers often harms factual accuracy, suggesting layer-specific roles in hallucination content. The results illuminate a new, architecture-centric path to understanding and mitigating hallucinations, with practical implications for safer deployment of LLMs.

Abstract

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.
Paper Structure (29 sections, 8 equations, 7 figures, 3 tables)

This paper contains 29 sections, 8 equations, 7 figures, 3 tables.

Figures (7)

  • Figure 1: Method overview. We disable self-attention layers within the LLMs and then evaluate original and intervened models using hallucination detection benchmarks. We use other SOTA LLM as evaluator LLM (e.g. GPT-3.5-turbo) to judge the correctness of generated contents. Finally, we compare the performance differences between the original and intervened models.
  • Figure 2: The structural causal model (SCM) depicting the text generation mechanism of LLMs with hallucinations.
  • Figure 3: Overview of our method and self-attention mechanism of LLMs, where the colorful blocks represent self-attention heads and the orange block wrapping the self-attention heads is the multi-head attention module. We define the attention layer closest to the text input as the first layer, and so on. Furthermore, for the layer we disable, we modify the output of all self-attention heads within this layer as zero tensors. In this figure, we disable the second layer of LLMs.
  • Figure 4: Instruction of automated evaluation.
  • Figure 5: Comparison of results for different models on the TruthfulQA dataset. The red bars in the bar chart represent a higher or close ACC compared with the original large language model ($z_o$), and the dashed line prefers the ACC of $z_o$.
  • ...and 2 more figures