[论文解读] An LLM can Fool Itself: A Prompt-Based Adversarial Attack
本文提出 PromptAttack,一种基于提示的方法,使大型语言模型生成能自我欺骗的对抗样本,在 GLUE 任务上优于 AdvGLUE/AdvGLUE++,并实现少量查询下的黑箱评估。
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.
研究动机与目标
- 在安全关键场景中推动对LLM对抗鲁棒性的稳健评估。
- 提出 PromptAttack,一种基于提示的框架,用以从受害LLM自身诱导对抗样本。
- 证明 PromptAttack 在 GLUE 任务上相比现有基线具有更高的攻击成功率。
- 通过提供黑盒访问和少量查询来演示该方法的实用性。
- 探索保真度控制和提升攻击力的策略(少样本、集成)。
提出的方法
- 构建包含三个组成部分的攻击提示:原始输入(OI)、攻击目标(AO)、以及攻击引导(AG)。
- 在字符、单词和句子层面定义扰动指令,以在保持语义的同时生成对抗样本。
- 应用保真度过滤器,使用单词修改比和 BERTScore 来保留语义相似性。
- 通过在 AG 中使用少样本示例以及在多个扰动水平上的集成策略来增强攻击力。
- 在 GLUE 任务上使用受害 LLM(Llama2-7B、Llama2-13B、GPT-3.5)进行评估。
- 与 AdvGLUE 和 AdvGLUE++ 进行比较,并报告带保真度过滤样本的攻击成功率(ASR)。
实验结果
研究问题
- RQ1所提出的 PromptAttack 是否能够通过提示模型生成使其自欺的对抗样本,可靠地发现黑箱 LLM 的失败模式?
- RQ2少样本和集成策略在保持高保真度的同时,是否显著提升攻击力?
- RQ3相较于现有鲁棒性基准,PromptAttack 在不同 LLMs 和 GLUE 任务中的表现如何?
- RQ4任务描述和扰动类型对 ASR 与转移性的影响如何?
主要发现
- PromptAttack 在 Llama2 和 GPT-3.5 的 GLUE 任务中对 AdvGLUE 和 AdvGLUE++ 具有更高的 ASR。
- PromptAttack-EN 与 PromptAttack-FS-EN 实现显著的 ASR 增益;对于 GPT-3.5,PromptAttack-EN 的平均 ASR 为 42.54%,PromptAttack-FS-EN 为 48.34%。
- 一个简单的表情符号也能让 GPT-3.5 误导,显示出令人惊讶的脆弱性。
- ASR 的提升在句子级扰动中最强,并受益于少样本引导和集成策略。
- PromptAttack 展示了对抗样本在 GPT-3.5 与 Llama2 变体之间的转移性。
- 在相同提示下,GPT-3.5 通常相对于 Llama2 模型显示出更高的鲁棒性,但 Llama2-13B 在 PromptAttack 下仍然高度脆弱。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。