arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2310.13345cs.CR
收藏

LLM可以欺骗自己:一种基于提示的对抗攻击

An LLM can Fool Itself: A Prompt-Based Adversarial Attack

Xilie Xu, Keyi Kong, Ning Liu, Lizhen Cui, Di Wang, Jingfeng Zhang, Mohan Kankanhalli

AI总结:

本文提出基于提示的对抗攻击工具PromptAttack,通过让LLM生成对抗样本欺骗自身,结合保真度过滤和扰动集成,在Llama2和GPT-3.5上实现比AdvGLUE更高的攻击成功率。

摘要:

大型语言模型(LLMs)的广泛应用,尤其是在安全关键领域,使得对LLM对抗鲁棒性的适当评估成为必要。本文提出了一种高效的工具,通过基于提示的对抗攻击(PromptAttack)来审查LLM的对抗鲁棒性。PromptAttack将对抗性文本攻击转换为攻击提示,使受害LLM输出对抗样本以欺骗自身。该攻击提示由三个重要组件组成:(1)原始输入(OI),包括原始样本及其真实标签;(2)攻击目标(AO),说明生成一个能在不改变语义的情况下欺骗自身的新样本的任务描述;(3)攻击指导(AG),包含扰动指令,指导LLM如何在字符、词和句子级别分别扰动原始样本以完成任务。此外,我们使用保真度过滤器确保PromptAttack保持对抗样本的原始语义。进一步,我们通过集成不同扰动级别的对抗样本来增强PromptAttack的攻击力。使用Llama2和GPT-3.5的全面实证结果验证了,与AdvGLUE和AdvGLUE++相比,PromptAttack始终产生更高的攻击成功率。有趣的发现包括,一个简单的表情符号可以轻易误导GPT-3.5做出错误预测。

英文摘要:

The wide-ranging applications of large language models (LLMs), especially in safety-critical domains, necessitate the proper evaluation of the LLM's adversarial robustness. This paper proposes an efficient tool to audit the LLM's adversarial robustness via a prompt-based adversarial attack (PromptAttack). PromptAttack converts adversarial textual attacks into an attack prompt that can cause the victim LLM to output the adversarial sample to fool itself. The attack prompt is composed of three important components: (1) original input (OI) including the original sample and its ground-truth label, (2) attack objective (AO) illustrating a task description of generating a new sample that can fool itself without changing the semantic meaning, and (3) attack guidance (AG) containing the perturbation instructions to guide the LLM on how to complete the task by perturbing the original sample at character, word, and sentence levels, respectively. Besides, we use a fidelity filter to ensure that PromptAttack maintains the original semantic meanings of the adversarial examples. Further, we enhance the attack power of PromptAttack by ensembling adversarial examples at different perturbation levels. Comprehensive empirical results using Llama2 and GPT-3.5 validate that PromptAttack consistently yields a much higher attack success rate compared to AdvGLUE and AdvGLUE++. Interesting findings include that a simple emoji can easily mislead GPT-3.5 to make wrong predictions.

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

↑