arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2411.00348cs.CRcs.AIcs.LG
收藏

注意力追踪器:检测大型语言模型中的提示注入攻击

Attention Tracker: Detecting Prompt Injection Attacks in LLMs

IBM Research(IBM研究院);National Taiwan University(国立台湾大学)

Kuo-Han Hung, Ching-Yun Ko, Ambrish Rawat, I-Hsin Chung, Winston H. Hsu, Pin-Yu Chen

AI总结:

本文提出Attention Tracker,一种基于注意力分散效应的无需训练检测方法,通过追踪注意力模式检测LLM提示注入攻击,在多种模型和攻击类型上AUROC提升达10%,适用于小型LLM。

摘要:

大型语言模型(LLMs)彻底改变了各个领域,但仍然容易受到提示注入攻击,其中恶意输入操纵模型忽略原始指令并执行指定操作。在本文中,我们通过分析LLMs内部的注意力模式来研究这些攻击的潜在机制。我们引入了“注意力分散效应”的概念,即特定的注意力头(称为重要头)将注意力从原始指令转移到注入指令上。基于这一发现,我们提出了注意力追踪器(Attention Tracker),一种无需训练且无需额外LLM推理的检测方法,通过追踪指令上的注意力模式来检测提示注入攻击。我们的方法在多种模型、数据集和攻击类型上均能有效泛化,相比现有方法AUROC提升高达10.0%,即使在小型LLM上也能表现良好。我们通过广泛评估展示了我们方法的鲁棒性,并为保护LLM集成系统免受提示注入漏洞提供了见解。

英文摘要:

Large Language Models (LLMs) have revolutionized various domains but remain vulnerable to prompt injection attacks, where malicious inputs manipulate the model into ignoring original instructions and executing designated action. In this paper, we investigate the underlying mechanisms of these attacks by analyzing the attention patterns within LLMs. We introduce the concept of the distraction effect, where specific attention heads, termed important heads, shift focus from the original instruction to the injected instruction. Building on this discovery, we propose Attention Tracker, a training-free detection method that tracks attention patterns on instruction to detect prompt injection attacks without the need for additional LLM inference. Our method generalizes effectively across diverse models, datasets, and attack types, showing an AUROC improvement of up to 10.0% over existing methods, and performs well even on small LLMs. We demonstrate the robustness of our approach through extensive evaluations and provide insights into safeguarding LLM-integrated systems from prompt injection vulnerabilities.

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

↑