Skip to content
InfoResearchPreprintLLM-specific

Heads of Security: Learned Attention Gates Improve Prompt Injection Robustness

Published
Record updated
View JSON

Summary

Researchers introduce Heads of Security (HoS), a prompt injection defense that uses a small set of learned per-head attention gates to separate trusted instructions from untrusted data. Evaluated on Llama-3.3-70B-Instruct and GPT-OSS-20B, HoS cut the black-box RL-Hammer attack success rate to 10%, versus 97% on GPT-OSS-20B and 85% on SecAlign. It also preserved base-model utility on standard benchmarks, where SecAlign and ASIDE degraded in few-shot settings.