[论文解读] GPTFUZZER: Red Teaming Large Language Models with Auto-Generated Jailbreak Prompts
GPTFUZZER 通过对黑盒模糊测试自动化 jailbreak 提示生成,以稳健地对 LLM 进行红队测试,在多模型上实现高攻击成功率。
Large language models (LLMs) have recently experienced tremendous popularity and are widely used from casual conversations to AI-driven programming. However, despite their considerable success, LLMs are not entirely reliable and can give detailed guidance on how to conduct harmful or illegal activities. While safety measures can reduce the risk of such outputs, adversarial jailbreak attacks can still exploit LLMs to produce harmful content. These jailbreak templates are typically manually crafted, making large-scale testing challenging. In this paper, we introduce GPTFuzz, a novel black-box jailbreak fuzzing framework inspired by the AFL fuzzing framework. Instead of manual engineering, GPTFuzz automates the generation of jailbreak templates for red-teaming LLMs. At its core, GPTFuzz starts with human-written templates as initial seeds, then mutates them to produce new templates. We detail three key components of GPTFuzz: a seed selection strategy for balancing efficiency and variability, mutate operators for creating semantically equivalent or similar sentences, and a judgment model to assess the success of a jailbreak attack. We evaluate GPTFuzz against various commercial and open-source LLMs, including ChatGPT, LLaMa-2, and Vicuna, under diverse attack scenarios. Our results indicate that GPTFuzz consistently produces jailbreak templates with a high success rate, surpassing human-crafted templates. Remarkably, GPTFuzz achieves over 90% attack success rates against ChatGPT and Llama-2 models, even with suboptimal initial seed templates. We anticipate that GPTFuzz will be instrumental for researchers and practitioners in examining LLM robustness and will encourage further exploration into enhancing LLM safety.
研究动机与目标
- 通过自动化越狱提示生成,推动对 LLM 安全性的稳健评估。
- 解决手动越狱提示在可扩展性、覆盖范围和适应性方面的局限性。
- 利用模糊测试概念探索更广泛的越狱模板空间。
- 提供一个可复现的框架,包含公开代码和模型,用于 LLM 的鲁棒性测试。
提出的方法
- 以人工编写的越狱模板作为种子并对其进行变体,以生成新的模板。
- 使用种子选择策略(随机、轮询、UCB 和 MCTS-Explore)来在效率与多样性之间取得平衡。
- 用五种操作符对模板进行变异:Generate、Crossover、Expand、Shorten、Rephrase。
- 将变异后的模板与目标问题结合,向 LLM 进行查询以评估越狱成功。
- 使用本地微调的基于 RoBERTa 的判决模型来判断回答是否越狱。
实验结果
研究问题
- RQ1RQ1:人工编写的越狱模板对流行的 LLM 有多有效?
- RQ2RQ2:GPTFUZZER 在攻击性能上是否优于人工设计的模板?
- RQ3RQ3:GPTFUZZER 是否能够跨未见问题和未见 LLM 生成通用模板?
- RQ4RQ4:哪些因素显著影响 GPTFUZZER 的攻击性能?
主要发现
- GPTFUZZER 在商业和开源 LLM 上始终实现高攻击成功率。
- 该框架在 ChatGPT 和 Llama-2 上的攻击成功率超过 90%,即使种子较差时也如此。
- 生成的提示对未见 LLM 显示出较强的迁移性,影响了 Bard (61%)、Claude-2 (90%) 和 PaLM2 (95%)。
- GPTFUZZER 在有效性方面通常优于人工设计的模板。
- 种子选择策略(包括 MCTS-Explore)增强了越狱模板的探索性和多样性。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。