Skip to main content
QUICK REVIEW

[论文解读] The Instruction Hierarchy: Training LLMs to Prioritize Privileged Instructions

Eric Wallace, Kai Xiao|arXiv (Cornell University)|Apr 19, 2024
Legal Education and Practice Innovations被引用 6
一句话总结

本文提出一种指令层级,使 LLMs 将优先级更高的系统提示置于用户和第三方内容之上,训练模型忽略低优先级指令,并展示在提示注入、越狱和提示提取攻击上的鲁棒性显著提升,同时对通用能力的损失很小。

ABSTRACT

Today's LLMs are susceptible to prompt injections, jailbreaks, and other attacks that allow adversaries to overwrite a model's original instructions with their own malicious prompts. In this work, we argue that one of the primary vulnerabilities underlying these attacks is that LLMs often consider system prompts (e.g., text from an application developer) to be the same priority as text from untrusted users and third parties. To address this, we propose an instruction hierarchy that explicitly defines how models should behave when instructions of different priorities conflict. We then propose a data generation method to demonstrate this hierarchical instruction following behavior, which teaches LLMs to selectively ignore lower-privileged instructions. We apply this method to GPT-3.5, showing that it drastically increases robustness -- even for attack types not seen during training -- while imposing minimal degradations on standard capabilities.

研究动机与目标

  • 说明为什么由于系统、用户和第三方内容被赋予同等优先级,LLMs 容易受到提示注入及相关攻击的影响。
  • 引入一种指令层级,为不同类型的消息赋予不同的特权(系统 > 用户 > 第三方)。
  • 开发自动化数据生成方法(上下文综合/context synthesis 与上下文无知/context ignorance)以训练模型遵循特权指令。
  • 证明该层级对攻击的鲁棒性有提升,并能泛化到未见过的提示,同时对能力的下降有限。
  • 概述局限性及未来工作,扩展到其他模态并精炼拒绝边界。

提出的方法

  • 定义一个指令层级,使更高特权的系统消息优先于较低特权的输入。
  • 使用上下文综合通过分解复杂提示来创建对齐指令,并训练模型再现真实答案。
  • 使用上下文无知来训练模型忽略不对齐的低特权指令,包括对抗性红队攻击。
  • 从对齐与不对齐场景生成训练数据,包括开放域和封闭域任务、越狱以及系统消息提取。
  • 在层级数据与能力数据上对 GPT-3.5 Turbo 进行监督微调和 RLHF;并在安全基准及标准 NLP 任务上评估。
  • 通过在训练中未见过的攻击上进行测试并衡量过度拒绝行为来评估泛化能力。

实验结果

研究问题

  • RQ1该指令层级是否在开放域和封闭域任务中提升对提示注入、越狱和系统消息提取攻击的鲁棒性?
  • RQ2模型是否能够对训练数据中未出现的攻击进行泛化,同时维持基线能力?
  • RQ3鲁棒性与对合法指令执行之间的权衡是什么(过度拒绝)?
  • RQ4在对抗性场景中使用工具或浏览时,该层级如何影响回答?
  • RQ5该方法是否可扩展到文本之外的多模态输入?

主要发现

  • 该指令层级在各项评估中带来显著的安全性提升,鲁棒性提升最高可达 63%。
  • 对训练中未建模的保留攻击的泛化显示鲁棒性提升高达34%。
  • 对系统提示提取的防护提升了63%。
  • 在某些评估中,越狱鲁棒性提升超过30%。
  • 在某些对抗场景中存在过度拒绝的退化,但通用能力基本不受影响。

更好的研究,从现在开始

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

无需绑定信用卡

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