HoS: Learned Attention Gates Against Prompt Injection in Language Models

Paper / preprint arXiv cs.LG · Reported findings, not independently verified by us.

A research team presents Heads of Security (HoS), an architectural defense against prompt injection. Its learned attention gates are designed to help models distinguish trusted instructions from untrusted content. In the reported tests, HoS resisted adaptive attacks more effectively and retained performance on standard utility tasks better than some competing defenses.

HoS uses a small number of learned gates to adjust how individual attention heads distribute attention between trusted and untrusted tokens. The aim is to let models process external content without following instructions embedded in it. The team evaluated the method with Llama-3.3-70B-Instruct and GPT-OSS-20B, comparing it with approaches including SecAlign++ and ASIDE.

For the black-box RL-Hammer attack, the abstract reports an attack success rate of 97% against GPT-OSS-20B and 85% against SecAlign, compared with 10% against HoS. A strengthened white-box attack, Claudini, reportedly needed three times as many FLOPs to achieve the same success rate against HoS as against GPT-OSS-20B or SecAlign. HoS also preserved the base model’s performance on standard multiple-choice benchmarks. On agentic benchmarks with static attacks, HoS and SecAlign performed similarly; ASIDE achieved only 10% utility on tool use, according to the source.

These findings reflect the tests described in the abstract and do not establish protection against every prompt-injection attack. The paper provides further detail on the experiments and evaluations: original paper on arXiv

🇬🇧 https://arxiv.org/abs/2610.37657v1

Leave a Comment

The weekly brief: selected developments, projects and videos