arXiv:2410.09102cs.LGcs.AI2024-10ICLR被引 71

给指令分等级,让大模型更懂安全优先级。

Instructional Segment Embedding: Improving LLM Safety with Instruction Hierarchy

  • 用嵌入层显式编码指令优先级,区分系统指令与用户输入
  • 在基准测试中提升15.75%~18.68%的抗攻击鲁棒性
  • 适合关注模型安全与指令遵循能力的研究者

大型语言模型(LLMs)易受提示注入、提示提取和有害请求等安全威胁。主要原因是缺乏指令层级结构:现有架构对所有输入一视同仁,无法区分并优先处理系统消息、用户提示和数据等不同类型的指令,导致低优先级的用户输入可能覆盖关键的安全协议。现有方法如分隔符或基于指令的训练未从架构层面解决此问题。本文提出指令段嵌入(Instructional Segment Embedding, ISE),受BERT启发,将指令优先级信息直接嵌入模型中,使模型能明确区分并优先处理各类指令,显著提升对试图篡改优先级的恶意提示的防御能力。在结构化查询与指令层级基准测试中,平均鲁棒准确率分别提升15.75%和18.68%;在AlpacaEval上,指令遵循能力提升最高达4.1%。整体表明,该方法为提升LLM安全性与有效性提供了有效路径。

原文摘要 · Abstract (English)

Large Language Models (LLMs) are susceptible to security and safety threats, such as prompt injection, prompt extraction, and harmful requests. One major cause of these vulnerabilities is the lack of an instruction hierarchy. Modern LLM architectures treat all inputs equally, failing to distinguish between and prioritize various types of instructions, such as system messages, user prompts, and data. As a result, lower-priority user prompts may override more critical system instructions, including safety protocols. Existing approaches to achieving instruction hierarchy, such as delimiters and instruction-based training, do not address this issue at the architectural level. We introduce the Instructional Segment Embedding (ISE) technique, inspired by BERT, to modern large language models, which embeds instruction priority information directly into the model. This approach enables models to explicitly differentiate and prioritize various instruction types, significantly improving safety against malicious prompts that attempt to override priority rules. Our experiments on the Structured Query and Instruction Hierarchy benchmarks demonstrate an average robust accuracy increase of up to 15.75% and 18.68%, respectively. Furthermore, we observe an improvement in instruction-following capability of up to 4.1% evaluated on AlpacaEval. Overall, our approach offers a promising direction for enhancing the safety and effectiveness of LLM architectures.

大模型安全指令优先级嵌入技术

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。