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

目标引导的生成式提示注入攻击针对大型语言模型

Goal-guided Generative Prompt Injection Attack on Large Language Models

Xi’an Jiaotong-Liverpool University(西交利物浦大学);University of Liverpool(利物浦大学)

Chong Zhang, Mingyu Jin, Qinkai Yu, Chengzhi Liu, Haochen Xue, Xiaobo Jin

AI总结:

针对LLM的提示注入攻击,提出目标引导生成式策略G2PIA,通过最大化KL散度等价于马氏距离,实现无查询黑盒攻击,实验验证有效。

摘要:

当前大型语言模型(LLMs)为大规模面向用户的自然语言任务提供了坚实基础。大量用户可以通过用户界面轻松注入对抗性文本或指令,从而引发LLMs模型的安全挑战。尽管目前已有大量关于提示注入攻击的研究,但大多数黑盒攻击采用启发式策略。尚不清楚这些启发式策略如何与攻击成功率相关,从而有效提升模型鲁棒性。为解决此问题,我们重新定义了攻击目标:最大化干净文本与对抗文本条件概率之间的KL散度。此外,我们证明了当条件概率为高斯分布时,最大化KL散度等价于最大化干净文本与对抗文本嵌入表示$x$和$x'$之间的马氏距离,并给出了关于$x$和$x'$的定量关系。然后,我们设计了一种简单有效的目标引导生成式提示注入策略(G2PIA),以寻找满足特定约束的注入文本,从而近似达到最优攻击效果。特别值得注意的是,我们的攻击方法是一种无查询的黑盒攻击方法,计算成本低。在七个LLM模型和四个数据集上的实验结果表明了我们攻击方法的有效性。

英文摘要:

Current large language models (LLMs) provide a strong foundation for large-scale user-oriented natural language tasks. A large number of users can easily inject adversarial text or instructions through the user interface, thus causing LLMs model security challenges. Although there is currently a large amount of research on prompt injection attacks, most of these black-box attacks use heuristic strategies. It is unclear how these heuristic strategies relate to the success rate of attacks and thus effectively improve model robustness. To solve this problem, we redefine the goal of the attack: to maximize the KL divergence between the conditional probabilities of the clean text and the adversarial text. Furthermore, we prove that maximizing the KL divergence is equivalent to maximizing the Mahalanobis distance between the embedded representation $x$ and $x'$ of the clean text and the adversarial text when the conditional probability is a Gaussian distribution and gives a quantitative relationship on $x$ and $x'$. Then we designed a simple and effective goal-guided generative prompt injection strategy (G2PIA) to find an injection text that satisfies specific constraints to achieve the optimal attack effect approximately. It is particularly noteworthy that our attack method is a query-free black-box attack method with low computational cost. Experimental results on seven LLM models and four datasets show the effectiveness of our attack method.

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

↑