DiSCO: Defending text-to-image generation through distribution-guided contrastive prompt optimization
On the map: LLM safety and security → Vision-language and text-to-image safety
Abstract (arXiv)
As text-to-image generative models advance, they raise critical safety concerns, particularly the generation of Not-Safe-For-Work (NSFW) content such as violence and nudity, further exacerbated by red-teaming adversarial attacks. Existing defenses predominantly operate under white-box assumptions, relying on text encoder optimization, weight editing, or inference-time intervention, and fundamentally cannot scale to proprietary models. Black-box alternatives based on LLM prompt rewriting offer broader applicability, yet fail in a critical regime we identify as the textitbenign adversarial problem: prompts that are linguistically safe but still trigger harmful generation due to the model's learned data distribution. We propose DiSCO, a zero-shot, strictly black-box defense that operates entirely at the prompt level as a plug-and-play module, requiring no model retraining, fine-tuning, or access to model internals. DiSCO performs distribution-guided suffix expansion via beam search, optimized through contrastive scoring over safe and unsafe image pools generated by the target model itself, with iterative adaptive feedback until safe content is produced. We demonstrate that DiSCO consistently enhances the safety of both undefended and defended models on the I2P benchmark under multiple red-teaming attacks, achieving 37.7% and 25.13% ASR reduction, respectively, while maintaining semantic fidelity and improving image coherence. As a black-box, architecture-agnostic module, DiSCO can be readily applied to any text-to-image system without necessitating any changes to the model itself.
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Placed in Vision-language and text-to-image safety, one of 12 directions in LLM safety and security. Builds on 30 of its 32 references that are in the map. First posted on arXiv 17 Aug 2026.
Builds on
30 of 32 references.
Closest ancestors · 11
Same direction, newest first
- 2026DTVI: Dual-Stage Textual and Visual Intervention for Safe Text-to-Image Generation23 Mar
- 2025AutoPrompt: Automated Red-Teaming of Text-to-Image Models via LLM-Driven Adversarial Prompts28 Oct
- 2025PromptGuard: Soft Prompt-Guided Unsafe Content Moderation for Text-to-Image Models7 Jan
- 2024SAFREE: Training-Free and Adaptive Guard for Safe Text-to-Image And Video Generation16 Oct
- 2024ART: Automatic Red-teaming for Text-to-Image Models to Protect Benign Users24 May
- 2024Defensive Unlearning with Adversarial Training for Robust Concept Erasure in Diffusion Models24 May
- 2024SafeGen: Mitigating Sexually Explicit Content Generation in Text-to-Image Models10 Apr
- 2023To Generate or Not? Safety-Driven Unlearned Diffusion Models Are Still Easy To Generate Unsafe Images ... For Now18 Oct
- 2023Ring-A-Bell! How Reliable are Concept Removal Methods for Diffusion Models?16 Oct
- 2023Prompting4Debugging: Red-Teaming Text-to-Image Diffusion Models by Finding Problematic Prompts12 Sep
- 2023SneakyPrompt: Jailbreaking Text-to-image Generative Models20 May
Other references · 19
- 2021Learning Transferable Visual Models From Natural Language Supervisioncited by 33,456
- 2020Denoising Diffusion Probabilistic Modelscited by 20,851
- 2021High-Resolution Image Synthesis with Latent Diffusion Modelscited by 18,694
- 2024The Llama 3 Herd of Modelscited by 14,192
- 2021Diffusion Models Beat GANs on Image Synthesiscited by 8,185
- 2021Zero-Shot Text-to-Image Generationcited by 4,276
- 2024Scaling Rectified Flow Transformers for High-Resolution Image Synthesiscited by 4,094
- 2019Generative Modeling by Estimating Gradients of the Data Distributioncited by 4,067
- 2021Improved Denoising Diffusion Probabilistic Modelscited by 3,736
- 2023Erasing Concepts from Diffusion Modelscited by 530
- 2022Safe Latent Diffusion: Mitigating Inappropriate Degeneration in Diffusion Modelscited by 501
- 2023MMA-Diffusion: MultiModal Attack on Diffusion Modelscited by 184
7 more
- 2023Receler: Reliable Concept Erasing of Text-to-Image Diffusion Models via Lightweight Eraserscited by 118
- 2025Learning Few-Step Diffusion Models by Trajectory Distribution Matchingcited by 49
- 2025ImageGen-CoT: Enhancing Text-to-Image In-context Learning with Chain-of-Thought Reasoningcited by 37
- 2023On the Proactive Generation of Unsafe Images From Text-To-Image Models Using Benign Promptscited by 14
- 2025PromptSafe: Gated Prompt Tuning for Safe Text-to-Image Generationcited by 2
- 2025Beyond the Safety Tax: Mitigating Unsafe Text-to-Image Generation via External Safety Rectificationcited by 2
- 2025Value-Aligned Prompt Moderation via Zero-Shot Agentic Rewriting for Safe Image Generationcited by 2
Built on by
Not cited yet.