arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2512.08417cs.CR
收藏

注意力是所有你需要的:用于防御大语言模型中的间接提示注入攻击

Attention is All You Need to Defend Against Indirect Prompt Injection Attacks in LLMs

Zhejiang University(浙江大学)

Yinan Zhong, Qianhao Miao, Yanjiao Chen, Jiangyi Deng, Yushi Cheng, Wenyuan Xu

AI总结:

本文提出Rennervate框架,通过注意力机制在token级别检测并清除IPI攻击,有效提升LLM的安全性。

摘要:

大型语言模型(LLMs)已被集成到许多应用(例如网络代理)中,以执行更复杂的任务。然而,依赖LLMs的应用程序容易受到间接提示注入(IPI)攻击的攻击,其中指令通过不可信的外部数据源注入。本文提出了Rennervate,一种用于检测和防止IPI攻击的防御框架。Rennervate利用注意力特征在细粒度的token级别检测隐蔽注入,使能够精确地进行清理,以中和IPI攻击,同时保持LLM的功能。具体来说,token级别的检测器通过两步注意池化机制实现,该机制聚合注意力头和响应token以进行IPI检测和清理。此外,我们建立了一个细粒度的IPI数据集,FIPI,以开源支持进一步研究。广泛的实验验证了Rennervate优于15种商业和学术的IPI防御方法,在5个LLM和6个数据集上实现了高精度。我们还证明了Rennervate可以转移到未见过的攻击,并且对适应性对手具有鲁棒性。

英文摘要:

Large Language Models (LLMs) have been integrated into many applications (e.g., web agents) to perform more sophisticated tasks. However, LLM-empowered applications are vulnerable to Indirect Prompt Injection (IPI) attacks, where instructions are injected via untrustworthy external data sources. This paper presents Rennervate, a defense framework to detect and prevent IPI attacks. Rennervate leverages attention features to detect the covert injection at a fine-grained token level, enabling precise sanitization that neutralizes IPI attacks while maintaining LLM functionalities. Specifically, the token-level detector is materialized with a 2-step attentive pooling mechanism, which aggregates attention heads and response tokens for IPI detection and sanitization. Moreover, we establish a fine-grained IPI dataset, FIPI, to be open-sourced to support further research. Extensive experiments verify that Rennervate outperforms 15 commercial and academic IPI defense methods, achieving high precision on 5 LLMs and 6 datasets. We also demonstrate that Rennervate is transferable to unseen attacks and robust against adaptive adversaries.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑