In-Context Experience Replay Facilitates Safety Red-Teaming of Text-to-Image Diffusion Models
Zhi-Yi Chin, Mario Fritz, Pin-Yu Chen, Wei-Chen Chiu
TL;DR
This work tackles the challenge of evaluating safety mechanisms in deployed text-to-image diffusion models by proposing ICER, an in-context experience replay framework. ICER uses a large language model as a surrogate to generate jailbreaking prompts, guided by a bandit-based exemplar selection drawn from a growing playbook of past red-teaming successes, enabling efficient black-box probing without internal model access. Across nudity and violence prompts and multiple safety mechanisms, ICER outperforms existing prompt-attacks and variant strategies, producing fluent, semantically aligned prompts that reveal vulnerabilities. The study also uncovers that knowledge transfer from historical jailbreaks facilitates the discovery of new weaknesses and discusses implications for defense and the risk of misuse when attackers leverage this transferability.
Abstract
Text-to-image (T2I) models have shown remarkable progress, but their potential to generate harmful content remains a critical concern in the ML community. While various safety mechanisms have been developed, the field lacks systematic tools for evaluating their effectiveness against real-world misuse scenarios. In this work, we propose ICER, a novel red-teaming framework that leverages Large Language Models (LLMs) and a bandit optimization-based algorithm to generate interpretable and semantic meaningful problematic prompts by learning from past successful red-teaming attempts. Our ICER efficiently probes safety mechanisms across different T2I models without requiring internal access or additional training, making it broadly applicable to deployed systems. Through extensive experiments, we demonstrate that ICER significantly outperforms existing prompt attack methods in identifying model vulnerabilities while maintaining high semantic similarity with intended content. By uncovering that successful jailbreaking instances can systematically facilitate the discovery of new vulnerabilities, our work provides crucial insights for developing more robust safety mechanisms in T2I systems.
