Skip to main content
QUICK REVIEW

[论文解读] Inference-Time Intervention: Eliciting Truthful Answers from a Language Model

Kenneth Li, Oam Patel|arXiv (Cornell University)|Jun 6, 2023
Topic ModelingComputer Science被引用 39
一句话总结

ITI 在推理阶段有选择地对一小部分与真实相关的注意头的激活进行偏移,以提高在 TruthfulQA 上的真实性,同时在有帮助性方面存在权衡,且额外计算量很小。

ABSTRACT

We introduce Inference-Time Intervention (ITI), a technique designed to enhance the "truthfulness" of large language models (LLMs). ITI operates by shifting model activations during inference, following a set of directions across a limited number of attention heads. This intervention significantly improves the performance of LLaMA models on the TruthfulQA benchmark. On an instruction-finetuned LLaMA called Alpaca, ITI improves its truthfulness from 32.5% to 65.1%. We identify a tradeoff between truthfulness and helpfulness and demonstrate how to balance it by tuning the intervention strength. ITI is minimally invasive and computationally inexpensive. Moreover, the technique is data efficient: while approaches like RLHF require extensive annotations, ITI locates truthful directions using only few hundred examples. Our findings suggest that LLMs may have an internal representation of the likelihood of something being true, even as they produce falsehoods on the surface.

研究动机与目标

  • 研究 LLM 是否包含在输出中未表达的潜在真实性表示。
  • 开发一种最小侵入性的方法,在不进行完整模型微调的情况下诱导真实输出。
  • 评估 ITI 在 TruthfulQA 及相关基准上的表现,并分析与有帮助性之间的权衡。
  • 评估该方法的数据效率和计算开销。
  • 探究 ITI 在其他数据集和指令微调模型上的泛化性。

提出的方法

  • 识别一组稀疏的注意头,其激活通过在 TruthfulQA 上的探针与真实性相关。
  • 在激活空间中计算真实方向(探针方向)。
  • 推理期间,通过在前 K 个头上沿真实方向偏移激活来进行干预,使用强度参数 alpha(x_{l+1}=x_{l}+ sum_h Q_l^h(Att_l^h(P_l^h x_l)) + alpha sigma_l^h theta_l^h)。
  • 逐步自回归地在每个令牌预测时应用干预。
  • 调整 K 与 alpha,在真实性(true*informative score)与其他方面潜在退化之间取得平衡(用 CE 和 KL 衡量)。
  • 将 ITI 与基线(SFT、Few-shot prompting、IFT 变体)以及其他方向策略(probe weight、mass mean shift、CCS)进行比较。
Figure 1 : Answers to the same question from LLaMA without (red) and with (blue) inference-time intervention. Gold standard answers are: “Scholars thought the Earth was round” and “I have no comment,” respectively. The first question reflects a common misconception; the second is an example of hallu
Figure 1 : Answers to the same question from LLaMA without (red) and with (blue) inference-time intervention. Gold standard answers are: “Scholars thought the Earth was round” and “I have no comment,” respectively. The first question reflects a common misconception; the second is an example of hallu

实验结果

研究问题

  • RQ1在不进行再训练的情况下,是否可以识别并利用 LLM 激活中的潜在真实性相关方向来提升真实输出?
  • RQ2最小侵入性的推理时干预是否能显著提升 TruthfulQA 的表现?对模型行为和效率的代价是什么?
  • RQ3ITI 如何泛化到指令微调模型及 TruthfulQA 以外的其他真实性相关基准?
  • RQ4真实性与有帮助性之间的最佳平衡是什么,超参数 K 和 alpha 如何影响这种权衡?
  • RQ5真实性相关方向是否稀疏且局部化于某个头子子集?它们的几何结构是什么?

主要发现

  • ITI 在 TruthfulQA 上取得显著提升(例如 Alpaca 从 32.5% 提升到 65.1% true*info;Vicuna 从 51.5% 提升到 74.0% true*info)。
  • 对一组顶层真实性相关头的干预有效且侵入性小。
  • Mass mean shift 通常优于其他方向(包括随机和 CCS)用于干预向量。
  • ITI 保留或适度改变整体生成分布(在适当调优时 CE 和 KL 保持相对较低)。
  • ITI 在 TruthfulQA 以外的其他基准上也有些许提升,在 Natural Questions 和 TriviaQA 上提升较小,在 MMLU 上提升较大,表明部分泛化。
  • 真实性方向似乎只需几百个带标签的样本就能学习,并且可以通过数据高效的探针找到。
Figure 2 : (A) Linear probe accuracies on validation set for all heads in all layers in LLaMA-7B, sorted row-wise by accuracy. Darker blue represents higher accuracy. $50\%$ is the baseline accuracy from random guessing. (B) Kernel density estimate plot of activations of truthful (blue) and false (o
Figure 2 : (A) Linear probe accuracies on validation set for all heads in all layers in LLaMA-7B, sorted row-wise by accuracy. Darker blue represents higher accuracy. $50\%$ is the baseline accuracy from random guessing. (B) Kernel density estimate plot of activations of truthful (blue) and false (o

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。