Groot: Adversarial Testing for Generative Text-to-Image Models with Tree-based Semantic Transformation

Yi Liu, Guowei Yang, Gelei Deng, Feiyue Chen, Yuqi Chen, Ling Shi, Tianwei Zhang, Yang LiuarXiv 2024

Abstract

With the prevalence of text-to-image generative models, their safety becomes a critical concern. Adversarial testing techniques have been developed to probe whether such models can be prompted to produce Not-Safe-For-Work (NSFW) content. However, existing solutions face several challenges, including low success rate and inefficiency. We introduce Groot, the first automated framework leveraging tree-based semantic transformation for adversarial testing of text-to-image models. Groot employs semantic decomposition and sensitive element drowning strategies in conjunction with LLMs to systematically refine adversarial prompts. Our comprehensive evaluation confirms the efficacy of Groot, which not only exceeds the performance of current state-of-the-art approaches but also achieves a remarkable success rate (93.66%) on leading text-to-image models such as DALL-E 3 and Midjourney.

1. Introduction

As text-to-image (T2I) models like DALL-E 3 and Midjourney become ubiquitous in creative industries, their safety mechanisms—designed to prevent the generation of Not-Safe-For-Work (NSFW) content—have become a primary focus. These models typically employ a two-tier defense: a text filter that screens the user's prompt and an image filter that inspects the generated output.

Despite these safeguards, existing adversarial testing (or "jailbreaking") methods face a "trilemma" of challenges: efficiency, intent preservation, and scalability. Many automated methods require hundreds of queries to find a single loophole, often distorting the prompt so much that the resulting image no longer matches the user's original goal. Groot addresses these gaps by providing an automated, efficient framework that preserves semantic intent.

2. The Groot Framework

Groot operates on the insight that safety filters are often "brittle" when faced with structured, granular descriptions rather than direct keywords. The framework uses two primary strategies to bypass the two-tier defense system.

The Groot framework architecture, illustrating the Text Compliance Reviewer and Feedback Collector modules.

2.1 Semantic Decomposition (The "Tree" Approach)

Instead of sending a direct sensitive prompt, Groot uses a Large Language Model (LLM) to build a Prompt Parse Tree (PPT). This tree breaks the scene down into hierarchical nodes: Objects, Attributes, and Relations. By recursively rephrasing sensitive terms into benign, descriptive components (e.g., changing "blood" to "red liquid" or "fighting" to "intense boxing"), Groot "dilutes" the sensitivity of the prompt. This allows the request to slip past text filters while still guiding the image generator toward the intended NSFW scene.

Semantic decomposition via Prompt Parse Trees (PPT), showing how sensitive terms like "blood" are transformed into granular, benign formatted statements.

2.2 Sensitive Element Drowning

To bypass the secondary image safety filter, Groot employs a "drowning" tactic. It instructs the T2I model to generate an image with multiple "canvases." One canvas contains the sensitive content, while others are filled with highly detailed, harmless imagery (such as a serene landscape). This overloads the image filter's attention, making it more likely to overlook prohibited elements in the corner of the frame.

3. Evaluation and Results

The researchers created a benchmark of 300 adversarial prompts across 10 prohibited categories, including violence, sexual content, and illegal activities. Groot was evaluated against these prompts on DALL-E 3, Midjourney, and Stable Diffusion XL.

Key findings include:

  • Superior Success Rate: Groot achieved an overall success rate of 93.66%, significantly outperforming the previous state-of-the-art method, SneakyPrompt (25.45%).
  • Perfect Bypass: In categories like "Illegal Activity" and "Political" content, Groot achieved a 100% bypass rate.
  • Complexity Correlation: There is a direct link between tree depth and success; as the number of nodes in the PPT increases, the success rate climbs toward 100%.

4. Discussion and Conclusion

Groot demonstrates that current T2I safety filters are vulnerable to logically structured semantic transformations. While highly effective, the framework's success can be influenced by the stochastic nature of generative models. Future work suggests that as developers move toward multimodal safety filters, simple decomposition may need to evolve. However, the specific patterns of semantic refinement identified by Groot provide a valuable signature for developers to build more resilient detection systems.

Summary updated

Abstract

With the prevalence of text-to-image generative models, their safety becomes a critical concern. adversarial testing techniques have been developed to probe whether such models can be prompted to produce Not-Safe-For-Work (NSFW) content. However, existing solutions face several challenges, including low success rate and inefficiency. We introduce Groot, the first automated framework leveraging tree-based semantic transformation for adversarial testing of text-to-image models. Groot employs semantic decomposition and sensitive element drowning strategies in conjunction with LLMs to systematically refine adversarial prompts. Our comprehensive evaluation confirms the efficacy of Groot, which not only exceeds the performance of current state-of-the-art approaches but also achieves a remarkable success rate (93.66%) on leading text-to-image models such as DALL-E 3 and Midjourney.
BibTeX
@misc{liu2024groot,
  author = {Yi Liu and Guowei Yang and Gelei Deng and Feiyue Chen and Yuqi Chen and Ling Shi and Tianwei Zhang and Yang Liu},
  title = {{Groot: Adversarial Testing for Generative Text-to-Image Models with Tree-based Semantic Transformation}},
  year = {2024},
  eprint = {2402.12100},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2402.12100},
}
Figure