Mind the Gap: Zero-Query Jailbreaks via Filter-Generator Discrepancy in Text-to-Image Systems

Wanguang Li, Zhaoxin Wang, Handing WangarXiv 2026

TL;DR

This paper introduces Filter-Generator Discrepancy (FGD), a structural vulnerability in safety-gated text-to-image (T2I) systems caused by the misalignment between how front-end safety filters and downstream image generators process text. Leveraging this insight, the authors develop FGD-Jail, a zero-query jailbreak framework that screens out low-potential prompt mutations offline and uses an evolutionary search to reliably bypass safety filters while preserving the original unsafe generation intent.

What Problem Does This Paper Address?

To prevent the generation of Not-Safe-For-Work (NSFW) content, text-to-image systems typically deploy prompt-level safety filters. However, these systems remain vulnerable to adversarial "jailbreak" prompts.

Existing automated jailbreak methods fall into two main camps, both with severe limitations:

  1. Query-based black-box attacks: These iteratively refine prompts based on feedback from the target system. While effective, they require hundreds of queries, making them expensive and easily detected by system monitors.
  2. Transfer-based (zero-query) attacks: These optimize prompts offline using a "surrogate" model and transfer them to the target system without making queries. However, they often overfit to the specific surrogate model used, or they waste computational effort exploring a massive search space of text mutations that fail to preserve the actual visual intent of the prompt.

The authors address this by asking: Can we systematically exploit the architectural differences between safety filters and image generators to create highly transferable, zero-query jailbreaks?

Methods

The core concept introduced is the Filter-Generator Discrepancy (FGD). Because safety filters (which look for textual risk) and T2I generators (which extract visual concepts) use different tokenizers, encoders, and objectives, a prompt can be perturbed to look completely benign to the filter while remaining visually meaningful to the generator.

Figure 1: Safety-gated T2I pipeline and filter-generator dis- crepancy. (a) The process of generating images through the T2I service by prompt x. (b) For perturbed prompt x′, hF (x′) and hG(x′) are not directly aligned, motivating filter accep- tance with generator-side semantic preservation.

The authors implement this insight into a framework called FGD-Jail, consisting of two main phases:

  1. Discrepancy-Guided Perturbation Screening: Instead of randomly mutating text, FGD-Jail filters out low-potential perturbations offline at two distinct stages:

  2. Tokenization-level: Exploits the difference between BERT-based filters (using WordPiece, which turns unknown words into an uninformative [UNK] token) and generator encoders like CLIP (using byte-level BPE, which preserves subword fragments).

  3. Semantic-level: Exploits the fact that LLM-based filters perform complex sentence-level logic and negation reasoning, whereas CLIP behaves more like a "bag-of-words" model that frequently ignores negations (e.g., prepending "not" to an unsafe word tricks the filter, but the generator still renders the unsafe word).
  4. Surrogate-Ensemble Evolutionary Search: To prevent the jailbreak from overfitting to a single surrogate model, the framework uses a dual-surrogate risk estimation combining a BERT-based classifier and a generative LLM guard. A genetic algorithm then optimizes the candidate prompts using a two-stage fitness function that balances filter evasion with strict semantic and structural regularization.
Figure 2: Overview of FGD-Jail. For a source prompt x, each perturbation is applied to obtain xδ = Tδ(x) and is screened by instantiation of FGD guidelines that measure filter-side evasion and generator-side preservation. The admitted perturbations form the discrepancy-guided perturbation set ∆disc(x), which provides prioritized samples for initializing and evolving the population. The evolutionary search optimizes candidates with the dual-surrogate risk R = max(RCLS, RLLM), the generator- side preservation score SG, and regularization Ω, producing an optimized prompt x′ without querying the target T2I service.

Datasets

The authors evaluated their approach on a dataset of 150 unsafe prompts:

  • 120 adult-content prompts sourced from LAION-5B.
  • 30 prompts from the UnsafeDiffusion dataset, expanding the evaluation to broader unsafe themes including violence, politics, racial discrimination, and inauthentic descriptions.

Key Insights and Ideas

  • High Bypass Rate $\neq$ High Attack Success Rate: A crucial finding is that simply tricking a safety filter is easy, but often useless. Several baseline methods achieved high filter bypass rates but failed to generate unsafe images because their text mutations destroyed the visual semantics needed by the generator. FGD-Jail explicitly optimizes for both sides of the equation.
  • The Asymmetry of Negation: LLM safety filters are highly sensitive to negations (e.g., "a girl not made of teeth"), whereas T2I generators often suffer from "negation blindness" due to their contrastive text encoders, rendering the forbidden object anyway.
  • Ensemble Robustness: Optimizing against a single surrogate filter creates brittle jailbreaks. By forcing the evolutionary search to satisfy a worst-case risk bound across both a traditional classifier and an LLM guard, the resulting prompts transfer robustly to completely unknown black-box systems.

Key Results

The authors tested FGD-Jail across six black-box target pipelines (combining DistilBert-NSFW or ShieldGemma filters with Stable Diffusion v1.5, SD3.5, or SDXL generators) and a commercial online T2I service (GPT-image-2 benchmark).

  • Black-Box Pipelines: FGD-Jail consistently outperformed state-of-the-art baselines (like DACA, SneakyPrompt, and PGJ). On the DistilBert-NSFW + SDv1.5 pipeline, it achieved an Attack Success Rate (ASR-4) of 50.00% (MHSC) and 53.33% (Q16), outperforming the strongest baseline by over 20 percentage points.
  • Commercial Online Service: When transferred to an undisclosed commercial online pipeline, FGD-Jail achieved the highest attack success rate among all zero-query methods, reaching up to 40.00% ASR-4 under the Q16 evaluation metric while maintaining a 93.33% filter bypass rate.

Limitations and Future Work

  • LLM Filter Resilience: The authors note that sentence-level LLM filters (like ShieldGemma) are significantly harder to bypass than token-matching classifiers because they leave less room for simple character-level homoglyph substitutions.
  • Defense Implications: The success of FGD highlights that front-end text filtering is fundamentally limited. The authors suggest that future T2I defense mechanisms must explicitly bridge this gap, either by aligning the representation spaces of the filter and the generator or by implementing tighter multi-stage defenses throughout the entire generation pipeline.

Summary updated

BibTeX
@misc{li2026mind,
  author = {Wanguang Li and Zhaoxin Wang and Handing Wang},
  title = {{Mind the Gap: Zero-Query Jailbreaks via Filter-Generator Discrepancy in Text-to-Image Systems}},
  year = {2026},
  eprint = {2608.00973},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2608.00973},
}
Figure