Introduction
As text-to-image (T2I) models like Stable Diffusion and FLUX.1 become increasingly integrated into mainstream applications, the risk of generating harmful content—including nudity, violence, and hate speech—grows. Content moderation systems typically filter either the input prompt or the resulting image. However, these defenses are often vulnerable to sophisticated adversarial attacks. This paper introduces GenBreak, an automated framework that fine-tunes Large Language Models (LLMs) to act as adversarial prompt engineers, systematically bypassing safety filters while maintaining high toxicity in the generated output.
The Stealth-Effectiveness Trade-off
Existing red-teaming methods often struggle with a fundamental trade-off. Some techniques generate highly toxic images but use "loud" prompts that are easily flagged by keyword filters. Others successfully evade filters but fail to produce genuinely harmful content. GenBreak addresses this by discovering prompts that are both stealthy (evading filters) and effective (producing high-risk content).
The GenBreak Framework
The authors propose a two-stage training pipeline to transform a standard LLM (specifically Llama-3.2-1B-Instruct) into a specialized red-teaming agent.
1. Supervised Fine-Tuning (SFT)
The model is first trained on curated datasets to learn the basic task of rewriting harmful prompts into adversarial versions. These rewrites use metaphors and descriptive language instead of "blacklisted" words, employing strategies like prompt dilution (adding irrelevant details) and conceptual confusion (using safe but semantically similar concepts).
2. Reinforcement Learning (RL)
The model then undergoes RL using Group Relative Policy Optimization (GRPO). It interacts with a surrogate T2I model and receives rewards based on a multi-objective function designed to balance conflicting goals:
- Toxicity Reward: High scores for truly harmful images.
- Bypass Reward: Rewards for successfully passing through safety filters.
- Clean Reward: Penalties for using explicit blacklisted terms, forcing linguistic "cloaking."
- Diversity Rewards: Lexical, semantic, and image-based rewards (using metrics like DreamSim) to ensure a wide range of attack strategies and avoid style collapse.
Experimental Setup and Datasets
The researchers introduced two specialized datasets for this task:
- Category Rewrite Dataset: 15,000 pairs of seed prompts and adversarial rewrites generated using Gemini 2.0 Flash.
- Pre-Attack Dataset: ~2,000 high-risk prompt pairs per domain, collected by iteratively attacking Stable Diffusion 2.1.
Results
GenBreak significantly outperformed existing baselines like CRT and ART. On Stable Diffusion 2.1, it achieved a Toxic Bypass Rate (TBR) of 60.8% for nudity and 89.7% for violence.
Crucially, GenBreak demonstrated strong cross-model transferability. Prompts optimized against open-source models successfully attacked commercial, closed-source APIs, suggesting shared underlying vulnerabilities in safety filters.
As shown in the table above, GenBreak achieved alarming success rates in the nudity domain against commercial services: a 70% bypass rate on Leonardo.ai, 47% on Stability AI, and 30% on fal.ai. The framework also maintained a high Toxic Clean Bypass Rate (TCBR), proving its ability to generate harmful content without using blacklisted keywords.
Discussion and Ethical Considerations
The success of GenBreak highlights the ongoing "cat-and-mouse" game between model developers and adversarial attackers. While the tool is powerful, the authors emphasize its intended defensive use. By helping developers identify and patch vulnerabilities, GenBreak serves as a critical tool for improving the safety of generative AI. Future work will need to address the evolution of multi-modal filters that go beyond simple keyword matching.
Summary updated