幻觉检测的自动层选择
Automatic Layer Selection for Hallucination Detection
AI总结:
针对大语言模型中幻觉检测的层选择问题,提出无需训练的FEPoID准则,自动识别最优中间层,并结合截断策略提升检测性能。
摘要:
最近关于幻觉检测的研究表明,在大语言模型(LLMs)中,与幻觉相关的信号在中间层比在最后一层编码得更强。尽管越来越多的研究试图利用这一特性进行幻觉检测,但如何自动选择高性能层仍未得到充分探索,且缺乏针对此目的的原则性方法。为填补这一空白,我们首先提出了几个关于为何这些信号出现在中间层的假设,并评估了相应的自动层选择准则,这些准则适用于不同的LLM架构、规模和任务,涵盖了问答和摘要幻觉检测基准。然而,我们发现这些准则均不能持续提供令人满意的性能。因此,我们提出了一种新的选择准则——第一有效本征维度峰值(FEPoID),它能够一致地识别最优或接近最优的层,并优于上述准则和现有的幻觉检测基线。FEPoID无需训练,且计算开销可忽略不计。此外,我们研究了LLM的生成行为,并引入了一种简单而有效的截断策略,该策略进一步放大了与幻觉相关的信号,并显著提高了整体检测性能。代码公开于 https://github.com/DesoloYw/Automatic-Layer-Selection-for-Hallucination-Detection.git
英文摘要:
Recent studies on hallucination detection have shown that hallucination-related signals are more strongly encoded in intermediate layers than in the final layer of large language models (LLMs). Although a growing body of work has sought to exploit this property for hallucination detection, how to automate the selection of high-performing layers remains underexplored, and principled methods for this purpose are still lacking. To address this gap, we first propose several hypotheses for why such signals emerge in intermediate layers and evaluate corresponding criteria for automatic layer selection across diverse LLM architectures, scales, and tasks, covering both question answering and summarization hallucination detection benchmarks. However, we find that none of these criteria consistently delivers satisfactory performance. We therefore propose a new selection criterion, First Effective Peak of Intrinsic Dimension (FEPoID), which consistently identify optimal or near-optimal layers and outperforms both the aforementioned criteria and existing hallucination detection baselines. FEPoID is training-free and incurs negligible computational overhead. In addition, we study the generation behaviors of LLMs and introduce a simple yet effective truncation strategy, which further amplifies hallucination-related signals and substantially improves overall detection performance. Code is publicly available at https://github.com/DesoloYw/Automatic-Layer-Selection-for-Hallucination-Detection.git
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。