Skip to main content
QUICK REVIEW

[论文解读] The Internal State of an LLM Knows When It's Lying

Amos Azaria, Tom M. Mitchell|arXiv (Cornell University)|Apr 26, 2023
Topic Modeling被引用 15
一句话总结

本文提出 SAPLMA,一种轻量级分类器,使用大型语言模型(LLM)的隐藏层激活来预测陈述是真是假,在多个主题和模型上超越提示基线。

ABSTRACT

While Large Language Models (LLMs) have shown exceptional performance in various tasks, one of their most prominent drawbacks is generating inaccurate or false information with a confident tone. In this paper, we provide evidence that the LLM's internal state can be used to reveal the truthfulness of statements. This includes both statements provided to the LLM, and statements that the LLM itself generates. Our approach is to train a classifier that outputs the probability that a statement is truthful, based on the hidden layer activations of the LLM as it reads or generates the statement. Experiments demonstrate that given a set of test sentences, of which half are true and half false, our trained classifier achieves an average of 71\% to 83\% accuracy labeling which sentences are true versus false, depending on the LLM base model. Furthermore, we explore the relationship between our classifier's performance and approaches based on the probability assigned to the sentence by the LLM. We show that while LLM-assigned sentence probability is related to sentence truthfulness, this probability is also dependent on sentence length and the frequencies of words in the sentence, resulting in our trained classifier providing a more reliable approach to detecting truthfulness, highlighting its potential to enhance the reliability of LLM-generated content and its practical applicability in real-world scenarios.

研究动机与目标

  • 在由于自信表达导致的LLM中错误信息的风险方面进行动机化并量化。
  • 提出一种方法(SAPLMA),在不微调的情况下从LLM的内部状态中提取真实性信号。
  • 在不同主题和架构上评估 SAPLMA,以评估其泛化能力和鲁棒性。
  • 发布一个真假数据集并展示与LLM系统的实际集成潜力,以提高可靠性。

提出的方法

  • 在LLM的隐藏层激活上训练一个简单的三层前馈分类器。
  • 将多个候选层(最后一层、第28层、第24层、第20层、中间层)作为分类器的输入进行评估。
  • 使用跨六个主题的真假陈述数据集来训练,在训练时使用所有主题,测试时留出一个未见主题。
  • 将 SAPLMA 与基线方法进行比较,包括BERT嵌入和少量示例提示。
  • 在由LLM自身生成的陈述上进行测试,以评估内部真实性信号。

实验结果

研究问题

  • RQ1LLM 的隐藏层激活能否揭示某个陈述是真还是假?
  • RQ2在跨主题和模型家族中,SAPLMA 相对于基于提示的基线在真实性检测上的表现如何?
  • RQ3哪些隐藏层表示对不同LLM最能编码真实性信号?
  • RQ4当泛化到训练中未见的主题时,SAPLMA 是否仍能保持性能?
  • RQ5当对由LLM自身生成的陈述进行评估时,SAPLMA 相较于外部获得的真假陈述表现如何?

主要发现

  • 在保留主题 上,OPT-6.7b 的准确率为 60%–80%,LLAMA2-7b 为 70%–90%。
  • SAPLMA 在所有六个主题上都显著优于 BERT 嵌入和少样本提示基线。
  • 对于 OPT-6.7b,20层通常效果最好;而 LLAMA2-7b 模型则偏好中间层或更高层,取决于主题和设置。
  • 在 OPT-6.7b 上使用第20层时,SAPLMA 的平均训练准确率为 86.4%,提示在LLM中存在可检测的内部真实性表征。
  • LLM 对整句生成的概率高度受句法与长度影响,而 SAPLMA 的sigmoid输出则更符合真实性(例如,在一组14个未见陈述上)。
  • 应用于由LLM自身生成的句子时,SAPLMA 仍优于基线,但绝对准确性较低(某些设置为70%区间),低于外部来源的真假数据。

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

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