[Paper Review] Unsupervised Real-Time Hallucination Detection based on the Internal States of Large Language Models
This paper proposes MIND, an unsupervised, real-time hallucination detection framework that leverages internal states (e.g., contextual embeddings, attention, activations) of large language models (LLMs) during inference to detect factual inaccuracies without requiring manual annotations. MIND achieves state-of-the-art performance on the new HELM benchmark, demonstrating high accuracy with low latency and full compatibility with existing LLMs.
Hallucinations in large language models (LLMs) refer to the phenomenon of LLMs producing responses that are coherent yet factually inaccurate. This issue undermines the effectiveness of LLMs in practical applications, necessitating research into detecting and mitigating hallucinations of LLMs. Previous studies have mainly concentrated on post-processing techniques for hallucination detection, which tend to be computationally intensive and limited in effectiveness due to their separation from the LLM's inference process. To overcome these limitations, we introduce MIND, an unsupervised training framework that leverages the internal states of LLMs for real-time hallucination detection without requiring manual annotations. Additionally, we present HELM, a new benchmark for evaluating hallucination detection across multiple LLMs, featuring diverse LLM outputs and the internal states of LLMs during their inference process. Our experiments demonstrate that MIND outperforms existing state-of-the-art methods in hallucination detection.
Motivation & Objective
- To address the limitations of post-processing hallucination detection methods, which are computationally expensive and lack integration with LLM inference.
- To develop a real-time, unsupervised framework that detects hallucinations during LLM inference using only internal model states.
- To improve reproducibility and benchmarking in hallucination detection by introducing HELM, a multi-LLM benchmark with generated outputs and internal activations.
- To eliminate reliance on costly human-annotated data for training hallucination detectors.
- To enable lightweight, compatible integration of hallucination detection into any Transformer-based LLM.
Proposed method
- MIND extracts pseudo-training data directly from Wikipedia to train a detector without human annotations, enabling unsupervised learning.
- The framework uses a lightweight multi-layer perceptron (MLP) classifier that operates on contextual embeddings, self-attention maps, and hidden-layer activations from each token during LLM inference.
- Hallucination detection is performed in real time by analyzing the internal states of the LLM as it generates responses, avoiding post-processing delays.
- The method is compatible with any Transformer-based LLM, as it only requires access to intermediate model states during generation.
- The framework is trained end-to-end to predict hallucination likelihood per token using self-supervised signals from Wikipedia.
- A new benchmark, HELM, is introduced, providing six LLMs' outputs and their full internal states (embeddings, attention, activations) for evaluation.
Experimental results
Research questions
- RQ1Can hallucination detection be performed in real time without relying on post-processing or ground-truth annotations?
- RQ2How effective is an unsupervised method based solely on internal LLM states in detecting hallucinations compared to supervised or post-processing baselines?
- RQ3What is the impact of different internal states (e.g., attention, hidden states) on hallucination detection performance?
- RQ4Can a lightweight, general-purpose detector be effectively integrated into diverse LLM architectures without retraining?
- RQ5How does the performance of MIND vary with different classifier depths and training data sizes?
Key findings
- MIND achieves state-of-the-art hallucination detection performance on the HELM benchmark without requiring any human-annotated data.
- The model's accuracy peaks at 0.7291 with a four-layer classifier, showing minimal sensitivity to depth beyond that.
- Performance plateaus after 4,096 training data points, indicating diminishing returns beyond this threshold.
- The framework enables real-time detection with significantly reduced latency compared to post-processing methods using large LLMs.
- The HELM benchmark provides a comprehensive evaluation platform with diverse LLM outputs and full internal state recordings, enhancing reproducibility and cross-model comparison.
- The unsupervised pre-training on Wikipedia data enables strong generalization across multiple LLMs without fine-tuning.
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.