What are Models Thinking about? Understanding Large Language Model Hallucinations "Psychology" through Model Inner State Analysis
Peiran Wang, Yang Liu, Yunfei Lu, Jue Hong, Ye Wu
TL;DR
This work addresses the challenge of hallucinations in large language models by moving beyond external knowledge-based detectors to internal-state analysis. It introduces HaluProbe, a framework that systematically extracts internal states from three inference stages (understanding, query, generation), computes diverse features from attention, activations, and logits, and evaluates five token-selection strategies for robust hallucination detection. Through experiments on CNNDM, HaluEval, and NQ, the authors show that certain features (e.g., Lookback Ratio, Joint Probability) are informative, that sliced-window token selection generally yields best performance, and that transferability across datasets is limited, motivating dataset-specific design. The work also analyzes the impact of retrieval augmentation (RAG) on internal states, highlighting opportunities for real-time, private, explainable hallucination detection with practical overhead considerations.
Abstract
Large language model (LLM) systems suffer from the models' unstable ability to generate valid and factual content, resulting in hallucination generation. Current hallucination detection methods heavily rely on out-of-model information sources, such as RAG to assist the detection, thus bringing heavy additional latency. Recently, internal states of LLMs' inference have been widely used in numerous research works, such as prompt injection detection, etc. Considering the interpretability of LLM internal states and the fact that they do not require external information sources, we introduce such states into LLM hallucination detection. In this paper, we systematically analyze different internal states' revealing features during inference forward and comprehensively evaluate their ability in hallucination detection. Specifically, we cut the forward process of a large language model into three stages: understanding, query, generation, and extracting the internal state from these stages. By analyzing these states, we provide a deep understanding of why the hallucinated content is generated and what happened in the internal state of the models. Then, we introduce these internal states into hallucination detection and conduct comprehensive experiments to discuss the advantages and limitations.
