arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2610.37657cs.LGcs.CLcs.CR
收藏

安全之头:学习型注意力门提升提示注入鲁棒性

Heads of Security: Learned Attention Gates Improve Prompt Injection Robustness

Imperial College London(伦敦帝国学院);Tübingen AI Center(蒂宾根人工智能中心);ELLIS Institute Tübingen(ELLIS蒂宾根研究所);Max Planck Institute for Intelligent Systems(马克斯·普朗克智能系统研究所);Fraunhofer HHI(弗劳恩霍夫海因里希·赫兹研究所)

Igor Shilov, Xiaoxue Yang, Alexander Panfilov, Evgenii Kortukov, Matthieu Meeus, Peter Romov, Wojciech Samek, Jonas Geiping, Yves-Alexandre de Montjoye

AI总结:

本研究提出安全之头(HoS)防御方法,通过学习型注意力门实现指令-数据分离,在Llama-3.3-70B-Instruct等模型上验证其对提示注入攻击的鲁棒性优于SecAlign++、ASIDE等方法,且能保留模型效用。

摘要:

我们提出了安全之头(Heads of Security, HoS),这是一种提示注入防御方法,通过少量学习得到的每头注意力门来强制实现指令-数据分离。HoS学习每个注意力头应如何在可信与不可信令牌之间重新分配注意力,使模型能够在不遵循注入指令的情况下对不可信内容进行推理。我们在Llama-3.3-70B-Instruct和GPT-OSS-20B上评估HoS,将其与最先进的基于微调的防御方法SecAlign++,以及同样在模型架构中构建指令-数据分离的防御方法ASIDE进行对比。结果表明,HoS对自适应攻击具有更强的鲁棒性,在标准效用基准上表现更好,且在标准智能体提示注入基准上达到顶级性能。更具体而言,针对GPT-OSS-20B的黑盒RL-Hammer攻击的攻击成功率(ASR)达97%,针对SecAlign的ASR达85%,但针对HoS的ASR仅为10%。最先进的白盒攻击Claudini通过自动研究强化后,要达到与在GPT-OSS-20B或SecAlign上相同的ASR,在HoS上需要多3倍的浮点运算量(FLOPs)。HoS在标准多项选择基准和提示设置中保留了基础模型的效用,而SecAlign和ASIDE在少样本设置中效用下降。在静态攻击的智能体基准上,HoS与SecAlign表现相似,且相比基础模型大幅改善了安全-效用权衡;ASIDE在工具使用方面存在困难,仅达到10%的效用。这些结果表明,可通过针对性的注意力干预实现并提升提示注入鲁棒性。

英文摘要:

We introduce Heads of Security (HoS), a prompt injection defense that enforces instruction-data separation via a small set of learned per-head attention gates. HoS learns how each head should redistribute attention between trusted and untrusted tokens, enabling models to reason over untrusted content without following injected instructions. We evaluate HoS on Llama-3.3-70B-Instruct and GPT-OSS-20B. We compare it against SecAlign++, a state-of-the-art finetuning-based defense, and ASIDE, a defense that, like ours, builds instruction-data separation into the model architecture. We show that HoS offers greater robustness to adaptive attacks, better performance on standard utility benchmarks, and matches top performance on standard agentic prompt injection benchmarks. More specifically, the black-box RL-Hammer attack reaches 97% ASR against GPT-OSS-20B and 85% against SecAlign, but only 10% against HoS. Claudini, a state-of-the-art white-box attack, strengthened against HoS through autoresearch, requires 3 times more FLOPs to reach the same ASR on HoS as it does on GPT-OSS-20B or SecAlign. HoS preserves base-model utility across standard multiple-choice benchmarks and prompting setups, whereas SecAlign and ASIDE degrade in few-shot settings. On agentic benchmarks with static attacks, HoS and SecAlign perform similarly and substantially improve the security-utility trade-off over the base model. ASIDE struggles with tool use, achieving only 10% utility. These results show that prompt injection robustness can be achieved and improved through targeted attention interventions.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑