Look Within, Why LLMs Hallucinate: A Causal Perspective

He Li,Haoang Chi,Mingyu Liu,Wenjing Yang
2024-07-14
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.
Computation and Language,Artificial Intelligence
What problem does this paper attempt to address?
The paper attempts to address the issue of hallucination phenomena in large language models (LLMs) when generating text, where the generated content does not align with user needs or conflicts with objective facts. Although LLMs have achieved significant success in many downstream tasks, this hallucination problem severely affects their effectiveness in practical applications. The paper specifically focuses on the potential role of the self-attention mechanism in the hallucination of LLMs, an aspect that has been less explored in previous research. To investigate this issue, the authors propose a causality-based approach by intervening in the self-attention layers of LLMs to observe the impact on hallucination phenomena. Specifically, they disabled different self-attention layers in several popular open-source LLMs and compared them with the original models to evaluate the effectiveness of these operations in reducing hallucinations. Experimental results indicate that disabling certain specific front-end or back-end self-attention layers can mitigate the hallucination problem, while disabling intermediate layers may exacerbate the degree of hallucination. This provides new insights into understanding and alleviating the hallucination problem in LLMs.