跳到正文
arXiv cs.CL· Igor Shilov, Xiaoxue Yang, Alexander Panfilov, Evgenii Kortukov, Matthieu Meeus, Peter Romov, Wojciech Samek, Jonas Geiping, Yves-Alexandre de Montjoye·· 13 小时前AI 评分58

Heads of Security:学习式注意力门控提升提示词注入鲁棒性

Heads of Security: Learned Attention Gates Improve Prompt Injection Robustness

AI 导读

研究提出 Heads of Security(HoS),通过一小组可学习的逐头注意力门控强制指令与数据分离,在 Llama-3.3-70B-Instruct 和 GPT-OSS-20B 上评估。

正文 · 原文

View PDF HTML (experimental)

Abstract: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.
Subjects: Machine Learning (cs.LG); Computation and Language (cs.CL); Cryptography and Security (cs.CR)
Cite as: arXiv:2610.37657 [cs.LG]
  (or arXiv:2610.37657v1 [cs.LG] for this version)
  https://doi.org/10.48550/arXiv.2610.37657

arXiv-issued DOI via DataCite (pending registration)

Submission history

From: Igor Shilov [view email]
[v1] Tue, 27 Oct 2026 17:58:52 UTC (392 KB)

来源:arXiv cs.CL · arxiv.org