跳到正文
原文
AI Security and Privacy Lab, Imperial College London·本站收录· 原文发表日期未标精选关注度38

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

Heads of Security: Learned Attention Gates Improve Prompt Injection Robustness

AI 导读

Imperial College London 等机构的研究者提出 Heads of Security(HoS)防御方法,在每个注意力头上训练学习型门控,使模型能读取工具输出而不执行其中注入的指令。每个 token 被标为 trusted、untrusted 或 template 通道,各头在 softmax 前按通道缩放注意力分数,从而阻止指令跟随头读取不可信内容,其他头仍可处理该内容。该方法只训练门控参数,在 GPT-OSS-20B 上为 18,432 个标量、Llama-3.3-70B 上为 46,080 个,采用 SecAlign++ DPO 配方训练,基座权重不变。

推荐理由

只训练注意力门控参数即可让模型不执行工具输出中注入的指令,与 SecAlign 和 ASIDE 相比对自适应攻击更稳健。

相关论文
阅读原文imperial-aisp.github.io