[Paper Review] GPTFUZZER: Red Teaming Large Language Models with Auto-Generated Jailbreak Prompts
GPTFUZZER automates jailbreak prompt generation through black-box fuzzing to robustly red-team LLMs, achieving high attack success rates across multiple models.
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.
Motivation & Objective
- Motivate robust evaluation of LLM safety by automated jailbreak prompt generation.
- Address scalability, coverage, and adaptability limitations of manual jailbreak prompts.
- Leverage fuzzing concepts to explore a broader space of jailbreak templates.
- Provide a reproducible framework with public code and models for LLM robustness testing.
Proposed method
- Start with human-written jailbreak templates as seeds and mutate them to produce new templates.
- Use seed selection strategies (Random, Round Robin, UCB, and MCTS-Explore) to balance efficiency and diversity.
- Mutate templates with five operators: Generate, Crossover, Expand, Shorten, Rephrase.
- Combine mutated templates with target questions and query the LLM to assess jailbreak success.
- Employ a locally fine-tuned RoBERTa-based judgment model to determine if a response is jailbroken.
Experimental results
Research questions
- RQ1RQ1: How effective are human-written jailbreak templates against popular LLMs?
- RQ2RQ2: Does GPTFUZZER outperform human-crafted templates in attack performance?
- RQ3RQ3: Is GPTFUZZER capable of generating universal templates across unseen questions and LLMs?
- RQ4RQ4: Which factors significantly influence the attack performance of GPTFUZZER?
Key findings
- GPTFUZZER consistently achieves high attack success rates across commercial and open-source LLMs.
- The framework yields over 90% attack success against ChatGPT and Llama-2, even with suboptimal seeds.
- Generated prompts show strong transfer to unseen LLMs, with Bard (61%), Claude-2 (90%), and PaLM2 (95%) affected.
- GPTFUZZER often outperforms human-crafted templates in effectiveness.
- The seed selection strategy (including MCTS-Explore) enhances exploration and diversity of jailbreak templates.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.