语言模型能提前预测自身行为,防失效、降成本。
Language Models Can Predict Their Own Behavior
- 仅用输入词的内部表征,就能提前预判输出行为。
- 提前预警可使越狱攻击减少91%,推理成本平均降低65%。
- 适用于大模型和未见数据,适合真实部署场景。
语言模型生成的文本可能表现出特定行为,如违背对齐训练或指令遵循失败,这些通常只能在输出生成后才能识别。我们证明,在生成任何输出前,有时可提前预测模型行为。通过仅基于输入词内部表示训练的探测器,可预测整个输出序列的多种行为。利用置信区间预测方法,我们为探测器提供可证明的误差边界,构建精确的早期预警系统。该系统可在无需生成任何词元的情况下识别导致对齐失败(越狱)和指令遵循失败的情况。基于探测器的预警系统使越狱攻击减少91%。探测器还具备预估模型响应置信度的能力,这是仅从输出无法察觉的行为。对于使用思维链(CoT)提示的模型,探测器可提前估计最终预测,从而加速推理。应用于基于CoT进行文本分类的模型时,平均推理成本降低65%(27个数据集),准确率损失极小。探测器在未见数据上表现良好,且大模型性能更优,表明其在真实世界大规模模型中的适用性。
原文摘要 · Abstract (English)
The text produced by language models (LMs) can exhibit specific `behaviors,' such as a failure to follow alignment training, that we hope to detect and react to during deployment. Identifying these behaviors can often only be done post facto, i.e., after the entire text of the output has been generated. We provide evidence that there are times when we can predict how an LM will behave early in computation, before even a single token is generated. We show that probes trained on the internal representation of input tokens alone can predict a wide range of eventual behaviors over the entire output sequence. Using methods from conformal prediction, we provide provable bounds on the estimation error of our probes, creating precise early warning systems for these behaviors. The conformal probes can identify instances that will trigger alignment failures (jailbreaking) and instruction-following failures, without requiring a single token to be generated. An early warning system built on the probes reduces jailbreaking by 91%. Our probes also show promise in pre-emptively estimating how confident the model will be in its response, a behavior that cannot be detected using the output text alone. Conformal probes can preemptively estimate the final prediction of an LM that uses Chain-of-Thought (CoT) prompting, hence accelerating inference. When applied to an LM that uses CoT to perform text classification, the probes drastically reduce inference costs (65% on average across 27 datasets), with negligible accuracy loss. Encouragingly, probes generalize to unseen datasets and perform better on larger models, suggesting applicability to the largest of models in real-world settings.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。