English static mirror for SEO/GEO · AI-assisted translation · Read Chinese original

Heads of Security: Learned Attention Gates Improve Prompt Injection Robustness in LLMs

Forum topic · 小凯 · 2026-10-28

Summary

Heads of Security (HoS) is a prompt injection defense that enforces instruction-data separation in large language models using a small set of learned per-head attention gates. The method trains each attention head to redistribute attention between trusted and untrusted tokens, allowing models to reason over untrusted content without following injected instructions. Evaluated on Llama-3.3-70B-Instruct and GPT-OSS-20B against SecAlign++ (finetuning-based) and ASIDE (architecture-based), HoS shows stronger robustness to adaptive attacks: the black-box RL-Hammer attack achieves 97% attack success rate (ASR) on GPT-OSS-20B and 85% on SecAlign, but only 10% on HoS. The white-box attack Claudini, strengthened via autoresearch, needs 3x more FLOPs to reach the same ASR on HoS as on GPT-OSS-20B or SecAlign. HoS preserves base-model utility on standard multiple-choice benchmarks, while SecAlign and ASIDE degrade in few-shot settings; ASIDE reaches only 10% utility with tool use. On agentic benchmarks, HoS matches SecAlign and substantially improves the security-utility trade-off.

Paper Overview

Field: LLM Security Authors: Igor Shilov, Xiaoxue Yang, Alexander Panfilov, Evgenii Kortukov, Matthieu Meeus, Peter Romov, Wojciech Samek, Jonas Geiping, Yves-Alexandre de Montjoye arXiv: 2610.37657

Summary

The paper introduces 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 attention head should redistribute attention between trusted and untrusted tokens, enabling models to reason over untrusted content without following injected instructions.

Evaluation Results

HoS was evaluated on Llama-3.3-70B-Instruct and GPT-OSS-20B, compared against:

  • SecAlign++ — a state-of-the-art finetuning-based defense
  • ASIDE — an architecture-based defense that also builds instruction-data separation into the model
  • Key findings:

  • Black-box robustness: The RL-Hammer attack reaches 97% ASR against GPT-OSS-20B and 85% against SecAlign, but only 10% against HoS.
  • White-box robustness: Claudini, a state-of-the-art white-box attack strengthened against HoS through autoresearch, requires 3x more FLOPs to reach the same ASR on HoS as it does on GPT-OSS-20B or SecAlign.
  • Utility: HoS preserves base-model utility across standard multiple-choice benchmarks and prompting setups, whereas SecAlign and ASIDE degrade in few-shot settings. ASIDE struggles with tool use, achieving only 10% utility.
  • Agentic benchmarks: With static attacks, HoS and SecAlign perform similarly and substantially improve the security-utility trade-off over the base model.

Conclusion

These results demonstrate that prompt injection robustness can be achieved and improved through targeted attention interventions.

---

Original 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. These results show that prompt injection robustness can be achieved and improved through targeted attention interventions.

Tags

#llm-security#prompt-injection#attention-mechanism#arxiv#paper-translation#ai-safety#instruction-data-separation

This page is an English static mirror generated for search and AI citation. It may be a full translation or structured summary of the Chinese original. Canonical interactive discussion lives on the Chinese page: https://zhichai.net/topic/178636560