Automatic Layer Selection for Hallucination Detection
Title: Automating Layer Selection for Enhanced Hallucination Detection
Abstract
Current research indicates that signals indicative of hallucinations are more prominently encoded within the intermediate layers of large language models (LLMs) rather than in the output layer. While an increasing number of studies aim to leverage this characteristic for detecting hallucinations, the process of automatically identifying the most effective layers remains an under-researched area, with a notable absence of robust, principled methodologies.
To bridge this gap, we initially formulated several hypotheses regarding the emergence of these signals in intermediate layers. We then evaluated various criteria for automatic layer selection across a wide range of LLM architectures, scales, and tasks, utilizing benchmarks for both summarization and question-answering hallucination detection. Our findings revealed that none of these initial criteria provided consistent, satisfactory performance.
Consequently, we introduce a novel selection metric: the First Effective Peak of Intrinsic Dimension (FEPoID). This approach reliably identifies optimal or near-optimal layers, surpassing both the previously tested criteria and existing hallucination detection baselines. Notably, FEPoID is training-free and adds negligible computational cost. Furthermore, we analyze LLM generation behaviors and propose a straightforward yet potent truncation strategy. This technique intensifies hallucination-related signals, leading to substantial improvements in overall detection accuracy. The source code is publicly accessible at https://github.com/DesoloYw/Automatic-Layer-Selection-for-Hallucination-Detection.git
Source: arXiv Generated at: 2026-06-03 00:00:00 UTC



