Transstratal Adversarial Attack: Compromising Multi-Layered Defenses in Text-to-Image Models

Chunlong Xie, Kangjie Chen, Shangwei Guo, Shudong Zhang, Tianwei Zhang, Tao XiangNeurIPS 2025

TL;DR

The Transstratal Adversarial Attack (TAA) is a novel black-box framework designed to systematically dismantle the multi-layered safety nets of modern Text-to-Image (T2I) models. By utilizing Large Language Models (LLMs) to craft metaphorical prompts and specific "artistic" styles, TAA exploits overlapping vulnerabilities to bypass prompt filters, concept erasers, and image classifiers simultaneously. This approach achieves a staggering 85.6% success rate across prominent models like DALL·E 3 and Midjourney.

The Problem with Defense-in-Depth

To prevent the generation of Not-Safe-For-Work (NSFW) content, modern T2I systems employ a "defense-in-depth" strategy. This pipeline typically involves three sequential layers:

  1. Prompt Filters: Blocking explicit or "dirty" words in the user's text input.
  2. Concept Erasers: Modifying the model's internal weights to "forget" how to generate forbidden concepts.
  3. Image Filters: Scanning the final visual output to block harmful imagery before it reaches the user.
Multi-layered T2I defense system and adversarial bypass

The authors identify a critical "complementary effect" between these layers that often renders existing single-layer attacks useless. For example, an attack that bypasses a prompt filter using obfuscated characters might fail to trigger the image generator's forbidden concepts. Conversely, a prompt that successfully triggers a forbidden concept often relies on explicit words easily caught by the first-layer filter. TAA addresses this gap by targeting the entire "strata" (layers) of defense simultaneously.

Methodology: The TAA Framework

The TAA framework operates as a black-box attack, requiring no knowledge of the target T2I model's internal weights. It relies on two primary innovations:

The Transstratal Adversarial Attack (TAA) framework
  • Transstratal Adversarial Candidate Generation: TAA uses LLMs to generate two types of prompt substitutions:
  • Implicit Candidates: Replacing explicit NSFW terms with metaphors (e.g., using "birthday suit" instead of "nude"). This evades prompt filters and concept erasers tuned for explicit keywords.
  • Subjective Candidates: Adding stylistic descriptors (e.g., "documentary photography" or "Caravaggio style") that shift the image features away from the objective decision boundaries of automated image filters, while ensuring the result remains subjectively harmful to a human viewer.
  • Adversarial Genetic Optimization: To find the optimal combination of these candidates, TAA employs a failure-driven genetic algorithm. It iteratively refines the prompt based on feedback from the T2I system, utilizing "fitness" scores that combine the bypass rate and the harmfulness of the resulting image.

Datasets and Evaluation

The study utilizes several datasets for benchmarking:

  • nsfw_190: A curated set of 190 NSFW-related prompts, combining existing prompts with new LLM-generated ones confirmed to fail against standard filters.
  • NSFW-4000: A new dataset introduced to test adaptive defenses, containing 1,000 TAA-generated NSFW images, 1,000 benign COCO images, and 2,000 harmful images from other sources.
  • Midjourney-v6 dataset: Used to ensure that proposed defenses do not accidentally degrade the quality of benign image generation.

Key Insights and Results

  • The "Isolated Design" Flaw: Current safety mechanisms are designed in isolation. The authors prove that while each layer might be strong individually, the gaps between them allow a systematic attack to succeed.
  • Metaphor as a Weapon: LLMs excel at finding semantic loopholes. Translating explicit intent into metaphorical descriptions bypasses keyword-based and embedding-based text filters.
  • Stylistic Camouflage: Forcing the model to generate NSFW content in specific artistic styles moves the image into a "blind spot" for classifiers without losing its harmful meaning.

Tested against 14 T2I models (including Stable Diffusion, FLUX.1, DALL·E 2/3, and Midjourney) and 17 safety modules, TAA demonstrated remarkable efficacy:

  • Attack Success Rate (ASR): Achieved an average ASR of 85.6%.
  • Comparison to SOTA: Outperformed existing state-of-the-art attacks (like DACA or SneakyPrompt) by 73.5% against full multi-layered defenses.
  • Transferability: Prompts optimized on open-source models successfully bypassed commercial models, achieving a 25.1% ASR on Midjourney-v7 and 20.1% on DALL·E 2.

Limitations and Future Work

  • LLM Dependency: The attack relies on access to a high-quality LLM (like GPT-4o) to generate creative candidates. Strict safety filters on the LLM itself could hinder the attack.
  • Query Efficiency: The genetic algorithm requires multiple queries to the target system, which could trigger rate-limiting or anomaly detection in real-world scenarios.
  • Future Defenses: The authors advocate for "Cross-Modal Concept Erasers"—defenses that analyze the joint association between a metaphorical prompt and its visual output, rather than evaluating text and images separately.

Summary updated

BibTeX
@inproceedings{xie2025transstratal,
  author = {Chunlong Xie and Kangjie Chen and Shangwei Guo and Shudong Zhang and Tianwei Zhang and Tao Xiang},
  title = {{Transstratal Adversarial Attack: Compromising Multi-Layered Defenses in Text-to-Image Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=JIpKkzSqly},
}
Figure