PromptSafe: Gated Prompt Tuning for Safe Text-to-Image Generation
Not on the map. Why?
Abstract (arXiv)
Text-to-image (T2I) models have demonstrated remarkable generative capabilities but remain vulnerable to producing not-safe-for-work (NSFW) content, such as violent or explicit imagery. While recent moderation efforts have introduced soft prompt-guided tuning by appending defensive tokens to the input, these approaches often rely on large-scale curated image-text datasets and apply static, one-size-fits-all defenses at inference time. However, this results not only in high computational cost and degraded benign image quality, but also in limited adaptability to the diverse and nuanced safety requirements of real-world prompts. To address these challenges, we propose PromptSafe, a gated prompt tuning framework that combines a lightweight, text-only supervised soft embedding with an inference-time gated control network. Instead of training on expensive image-text datasets, we first rewrite unsafe prompts into semantically aligned but safe alternatives using an LLM, constructing an efficient text-only training corpus. Based on this, we optimize a universal soft prompt that repels unsafe and attracts safe embeddings during the diffusion denoising process. To avoid over-suppressing benign prompts, we introduce a gated mechanism that adaptively adjusts the defensive strength based on estimated prompt toxicity, thereby aligning defense intensity with prompt risk and ensuring strong protection for harmful inputs while preserving benign generation quality. Extensive experiments across multiple benchmarks and T2I models show that PromptSafe achieves a SOTA unsafe generation rate (2.36%), while preserving high benign fidelity. Furthermore, PromptSafe demonstrates strong generalization to unseen harmful categories, robust transferability across diffusion model architectures, and resilience under adaptive adversarial attacks, highlighting its practical value for safe and scalable deployment.
Key facts. Cited by 2 papers in the map (data through 14 Oct 2026). Builds on 31 of its 45 references that are in the map. First posted on arXiv 2 Aug 2025.
Builds on
31 of 45 references.
References · 31
- 2021Learning Transferable Visual Models From Natural Language Supervisioncited by 33,744
- 2020Denoising Diffusion Probabilistic Modelscited by 21,076
- 2023GPT-4 Technical Reportcited by 18,396
- 2017Towards Deep Learning Models Resistant to Adversarial Attackscited by 6,415
- 2023SDXL: Improving Latent Diffusion Models for High-Resolution Image Synthesiscited by 4,356
- 2022An Image is Worth One Word: Personalizing Text-to-Image Generation using Textual Inversioncited by 2,245
- 2022Safe Latent Diffusion: Mitigating Inappropriate Degeneration in Diffusion Modelscited by 513
- 2023MMA-Diffusion: MultiModal Attack on Diffusion Modelscited by 194
- 2023SneakyPrompt: Jailbreaking Text-to-image Generative Modelscited by 189
- 2023Unsafe Diffusion: On the Generation of Unsafe Images and Hateful Memes From Text-To-Image Modelscited by 175
- 2022Can Machines Help Us Answering Question 16 in Datasheets, and In Turn Reflecting on Inappropriate Content?cited by 155
- 2021Dual Attention Suppression Attack: Generate Adversarial Camouflage in Physical Worldcited by 127
19 more
- 2023BadCLIP: Dual-Embedding Guided Backdoor Attack on Multimodal Contrastive Learningcited by 115
- 2021RobustART: Benchmarking Robustness on Architecture Design and Training Techniquescited by 79
- 2024SafeGen: Mitigating Sexually Explicit Content Generation in Text-to-Image Modelscited by 66
- 2025Reasoning-Augmented Conversation for Multi-Turn Jailbreak Attacks on Large Language Modelscited by 64
- 2019Training Robust Deep Neural Networks via Adversarial Noise Propagationcited by 62
- 2023X-Adv: Physical Adversarial Object Attacks against X-ray Prohibited Item Detectioncited by 59
- 2024Revisiting Backdoor Attacks against Large Vision-Language Models from Domain Shiftcited by 49
- 2021A Comprehensive Evaluation Framework for Deep Model Robustnesscited by 42
- 2021Harnessing Perceptual Adversarial Patches for Crowd Countingcited by 39
- 2025T2VShield: Model-Agnostic Jailbreak Defense for Text-to-Video Modelscited by 18
- 2025PromptGuard: Soft Prompt-Guided Unsafe Content Moderation for Text-to-Image Modelscited by 17
- 2024Automatic Evaluation for Text-to-image Generation: Task-decomposed Framework, Distilled Training, and Meta-evaluation Benchmarkcited by 14
- 2023Harnessing LLM to Attack LLM-Guarded Text-to-Image Modelscited by 12
- 2025CogMorph: Cognitive Morphing Attacks for Text-to-Image Modelscited by 12
- 2025SRD: Reinforcement-Learned Semantic Perturbation for Backdoor Defense in VLMscited by 9
- 2024AEIOU: A Unified Defense Framework against NSFW Prompts in Text-to-Image Modelscited by 7
- 2025Mitigating Sexual Content Generation via Embedding Distortion in Text-conditioned Diffusion Modelscited by 7
- 2025SafeText: Safe Text-to-image Models via Aligning the Text Encodercited by 7
- 2025PRJ: Perception-Retrieval-Judgement for Generated Imagescited by 2
Built on by
Citing papers per year: 2025: 1; 2026: 1.
2 papers.
Similar, not cited
Close in wording, no citation either way
- 2025Prompt-Based Safety Guidance Is Ineffective for Unlearned Text-to-Image Diffusion Models
- 2024Universal Prompt Optimizer for Safe Text-to-Image Generation
- 2024Safe Text-to-Image Generation: Simply Sanitize the Prompt Embedding
- 2026SafeRedir: Prompt Embedding Redirection for Robust Unlearning in Image Generation Models
- 2026DTVI: Dual-Stage Textual and Visual Intervention for Safe Text-to-Image Generation
- 2025Iterative Prompt Refinement for Safer Text-to-Image Generation
- 2025PurifyGen: A Risk-Discrimination and Semantic-Purification Model for Safe Text-to-Image Generation
- 2024GuardT2I: Defending Text-to-Image Models from Adversarial Prompts