Skip to main content
QUICK REVIEW

[论文解读] LLMs Know More Than They Show: On the Intrinsic Representation of LLM Hallucinations

Hadas Orgad, Michael Toker|arXiv (Cornell University)|Oct 3, 2024
Blockchain Technology Applications and Security被引用 4
一句话总结

该论文揭示了大型语言模型(LLMs)在其内部表征中编码了远超以往认知的内在真实性信息,尤其集中在精确答案标记上。通过在这些表征上训练探测分类器,作者实现了更优的错误检测效果,并发现真实性信号具有任务特异性而非普适性,从而能够预测错误类型,并揭示了内部知识与外部生成行为之间存在的关键脱节。

ABSTRACT

Large language models (LLMs) often produce errors, including factual inaccuracies, biases, and reasoning failures, collectively referred to as "hallucinations". Recent studies have demonstrated that LLMs' internal states encode information regarding the truthfulness of their outputs, and that this information can be utilized to detect errors. In this work, we show that the internal representations of LLMs encode much more information about truthfulness than previously recognized. We first discover that the truthfulness information is concentrated in specific tokens, and leveraging this property significantly enhances error detection performance. Yet, we show that such error detectors fail to generalize across datasets, implying that -- contrary to prior claims -- truthfulness encoding is not universal but rather multifaceted. Next, we show that internal representations can also be used for predicting the types of errors the model is likely to make, facilitating the development of tailored mitigation strategies. Lastly, we reveal a discrepancy between LLMs' internal encoding and external behavior: they may encode the correct answer, yet consistently generate an incorrect one. Taken together, these insights deepen our understanding of LLM errors from the model's internal perspective, which can guide future research on enhancing error analysis and mitigation.

研究动机与目标

  • 探究 LLM 中幻觉的内在表征,超越表面层面的错误检测。
  • 确定模型内部状态中真实性信息最集中的位置。
  • 评估真实性信号是否能在不同任务和数据集间泛化。
  • 探索内部表征是否不仅能预测错误,还能预测错误类型。
  • 检查模型内部知识与实际行为之间的一致性,特别是当正确答案被编码但未被生成时。

提出的方法

  • 在 LLM 的中间层表征上训练探测分类器,特别聚焦于生成输出中对应精确答案的标记。
  • 使用多个数据集(TriviaQA、Math、Winobias)在多样化任务上评估错误检测性能。
  • 将探测分类器的性能与基于 logits 的不确定性预测器进行对比,以评估泛化能力和鲁棒性。
  • 分析重复生成结果,对错误模式(如一致错误、偶发错误、竞争性答案)进行分类,并在内部表征上训练分类器以预测这些类型。
  • 基于多份样本中响应一致性的错误类型分类法,将内部表征与行为模式关联起来。
  • 测量正确答案在内部编码与实际模型输出之间的差异,以揭示内部-外部不一致。
Figure 1: Example for the input and LLM output from the TriviaQA dataset, and the names of the tokens that can be probed.
Figure 1: Example for the input and LLM output from the TriviaQA dataset, and the names of the tokens that can be probed.

实验结果

研究问题

  • RQ1在 LLM 的内部表征中,真实性信息最集中于何处?
  • RQ2在内部表征上训练的探测分类器是否比现有方法更有效地检测幻觉?
  • RQ3LLM 中的真实性信号是否在不同任务间泛化,还是具有任务特异性?
  • RQ4内部表征能否预测模型可能生成的错误类型?
  • RQ5模型内部对正确答案的知识与其实际输出之间,存在多大程度的脱节?

主要发现

  • 真实性信息最强烈地编码在精确答案标记中,聚焦于这些标记可显著提升错误检测性能。
  • 在答案标记上训练的探测分类器实现了最先进水平的检测性能,在 TriviaQA 上 F1 得分最高达 0.79,在 Winobias 上达 0.83。
  • 错误检测模型在不同任务间无法泛化,表明真实性编码并非普遍适用,而是与特定技能相关。
  • 内部表征能够预测错误类型(如持续错误、竞争性答案),从而支持针对性的缓解策略。
  • 内部对正确答案的编码与实际模型生成之间存在显著差异,即模型可能知道真相,但仍会产生幻觉输出。
(a) TriviaQA
(a) TriviaQA

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。