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

利用攻击技术防御提示注入攻击

Defense Against Prompt Injection Attack by Leveraging Attack Techniques

Yulin Chen, Haoran Li, Zihao Zheng, Yangqiu Song, Dekai Wu, Bryan Hooi

AI总结:

针对大语言模型面临的提示注入攻击漏洞,本文反转攻击思路,基于无需训练的攻击方法,通过重复攻击流程但使用原始输入指令构建防御方案,实验证明其效果优于现有同类防御方法,达到最优水平。

摘要:

随着技术的发展,大语言模型(LLM)在各类自然语言处理(NLP)任务中取得了卓越表现,为Microsoft Copilot等集成LLM的应用提供了支撑。然而,随着LLM不断演进,新的漏洞随之出现,尤其是提示注入攻击。这类攻击会诱骗LLM偏离原始输入指令,执行注入在数据内容(如检索结果)中的攻击者指令。近期的攻击方法利用LLM的指令遵循能力,以及其无法区分注入在数据内容中的指令的缺陷,实现了很高的攻击成功率(ASR)。在对比攻击与防御方法时,我们有趣地发现二者有着相似的设计目标:都是引导模型忽略不需要的指令,转而执行需要的指令。由此我们提出一个直观的问题:这些攻击技术能否被用于防御目的?本文中,我们反转提示注入方法的意图,基于此前无需训练的攻击方法开发了新型防御方法:重复攻击流程,但使用原始输入指令而非注入指令。我们的综合实验表明,所提出的防御技术优于现有无需训练的防御方法,取得了当前最优(SOTA)结果。

英文摘要:

With the advancement of technology, large language models (LLMs) have achieved remarkable performance across various natural language processing (NLP) tasks, powering LLM-integrated applications like Microsoft Copilot. However, as LLMs continue to evolve, new vulnerabilities, especially prompt injection attacks arise. These attacks trick LLMs into deviating from the original input instructions and executing the attacker's instructions injected in data content, such as retrieved results. Recent attack methods leverage LLMs' instruction-following abilities and their inabilities to distinguish instructions injected in the data content, and achieve a high attack success rate (ASR). When comparing the attack and defense methods, we interestingly find that they share similar design goals, of inducing the model to ignore unwanted instructions and instead to execute wanted instructions. Therefore, we raise an intuitive question: Could these attack techniques be utilized for defensive purposes? In this paper, we invert the intention of prompt injection methods to develop novel defense methods based on previous training-free attack methods, by repeating the attack process but with the original input instruction rather than the injected instruction. Our comprehensive experiments demonstrate that our defense techniques outperform existing training-free defense approaches, achieving state-of-the-art results.

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

↑