[Paper Review] Prompting4Debugging: Red-Teaming Text-to-Image Diffusion Models by Finding Problematic Prompts
The paper introduces Prompting4Debugging (P4D), an automated red-teaming tool that uses prompt engineering to find safety-evasive prompts for text-to-image diffusion models with safeguards, revealing substantial vulnerabilities in deployed safety mechanisms.
Text-to-image diffusion models, e.g. Stable Diffusion (SD), lately have shown remarkable ability in high-quality content generation, and become one of the representatives for the recent wave of transformative AI. Nevertheless, such advance comes with an intensifying concern about the misuse of this generative technology, especially for producing copyrighted or NSFW (i.e. not safe for work) images. Although efforts have been made to filter inappropriate images/prompts or remove undesirable concepts/styles via model fine-tuning, the reliability of these safety mechanisms against diversified problematic prompts remains largely unexplored. In this work, we propose Prompting4Debugging (P4D) as a debugging and red-teaming tool that automatically finds problematic prompts for diffusion models to test the reliability of a deployed safety mechanism. We demonstrate the efficacy of our P4D tool in uncovering new vulnerabilities of SD models with safety mechanisms. Particularly, our result shows that around half of prompts in existing safe prompting benchmarks which were originally considered "safe" can actually be manipulated to bypass many deployed safety mechanisms, including concept removal, negative prompt, and safety guidance. Our findings suggest that, without comprehensive testing, the evaluations on limited safe prompting benchmarks can lead to a false sense of safety for text-to-image models.
Motivation & Objective
- Motivate robust testing of safety mechanisms in text-to-image diffusion models due to potential misuse and copyrighted/NSFW content risks.
- Propose P4D as an automated, scalable debugging tool that uses prompt engineering to discover safety-evasive prompts.
- Evaluate P4D across multiple safe T2I models (SD with negative prompts, SLD, ESD) and datasets (I2P, car, French-horn) to quantify vulnerabilities.
- Demonstrate that many prompts deemed safe can be manipulated to bypass safety, and analyze phenomena like information obfuscation and prompt length effects.
Proposed method
- Provide an automated red-teaming workflow using prompt engineering to bypass safety mechanisms in T2I diffusion models.
- Operate prompts in latent space by optimizing a continuous prompt and then projecting to discrete tokens for the safe model’s input.
- Minimize L = || εθ(z_t, W(P), t) − εθ'(z_t, P*_disc, t) ||^2 to align noise predictions between unconstrained and safety-enabled models.
- Develop two prompt variants, P4D-N (fixed length) and P4D-K (insert tokens every K tokens) to handle prompts of varying complexity.
- Compare against baselines Random-N, Random-K, and Shuffling, and propose P4D-UNION by merging prompts from N and K to maximize coverage.
- Use NudeNet, Q16, YOLOv5, and ResNet-18 as detectors/classifiers to evaluate unsafe outputs and compute failure rates as the evaluation metric.

Experimental results
Research questions
- RQ1Can P4D automatically discover prompts that bypass safety mechanisms in SD, SLD, and ESD models?
- RQ2How do P4D variants (N and K) compare to baselines in finding safety-evasive prompts across concept- and object-related categories?
- RQ3Does disabling safety text filters during debugging increase the discovered prompts, indicating information obfuscation effects?
- RQ4Do prompts found by P4D generalize across different safe T2I models, and what is the level of universal robustness?
Key findings
- P4D-N and P4D-K provide promising and comparable debugging performance across safe T2I models and categories, with P4D-K maintaining interpretability.
- P4D-UNION substantially increases the failure rate by aggregating prompts found by P4D-N and P4D-K.
- ESD offers strong initial protection against nudity before red-teaming, but finetuning-based removal can still be bypassed by optimized prompts.
- Guidance-based models (SLD, SD-NEGP) show lower failure rates due to text filters; turning off safety text filters during training increases discovered problematic prompts, illustrating information obfuscation.
- Prompt generalizability analysis shows over 50% of prompts found by P4D can red-team multiple safe T2I models, with more than 30% being universal problematic prompts (intersection).

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.