mlsanityData to 7 Oct 2026

PromptGuard: Soft Prompt-Guided Unsafe Content Moderation for Text-to-Image Models

arXiv 2501.03544 ↗First posted 7 Jan 2025cs.CV cs.AI cs.CRcited by 16

On the map: LLM safety and security → Vision-language and text-to-image safety

Abstract (arXiv)

Recent text-to-image (T2I) models have exhibited remarkable performance in generating high-quality images from text descriptions. However, these models are vulnerable to misuse, particularly generating not-safe-for-work (NSFW) content, such as sexually explicit, violent, political, and disturbing images, raising serious ethical concerns. In this work, we present PromptGuard, a novel content moderation technique that draws inspiration from the system prompt mechanism in large language models (LLMs) for safety alignment. Unlike LLMs, T2I models lack a direct interface for enforcing behavioral guidelines. Our key idea is to optimize a safety soft prompt that functions as an implicit system prompt within the T2I model's textual embedding space. This universal soft prompt (P*) directly moderates NSFW inputs, enabling safe yet realistic image generation without affecting inference efficiency or requiring proxy models. We further enhance its reliability and helpfulness through a divide-and-conquer strategy that optimizes category-specific soft prompts and combines them into unified safety guidance. Extensive experiments across five datasets demonstrate that PromptGuard effectively mitigates NSFW content generation while preserving high-quality benign outputs. PromptGuard is 3.8 times faster than prior content moderation methods while outperforming eight state-of-the-art defenses. Evaluations using both a multi-head safety classifier and a VLM-based guardrail further confirm its robustness, with average unsafe ratios of 5.84% and 6.18%, respectively. Our code and dataset are available at https://t2i-promptguard.github.io/.

Key facts. Cited by 16 papers in the map (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 38 of its 66 references that are in the map. First posted on arXiv 7 Jan 2025.

Builds on

38 of 66 references.

Closest ancestors · 6

Same direction, newest first

  1. 2024AlignGuard: Scalable Safety Alignment for Text-to-Image Generation13 Dec
  2. 2024Perception-guided Jailbreak against Text-to-Image Models20 Aug
  3. 2024Direct Unlearning Optimization for Robust and Safe Text-to-Image Models17 Jul
  4. 2024Defensive Unlearning with Adversarial Training for Robust Concept Erasure in Diffusion Models24 May
  5. 2024SafeGen: Mitigating Sexually Explicit Content Generation in Text-to-Image Models10 Apr
  6. 2023SneakyPrompt: Jailbreaking Text-to-image Generative Models20 May

Other references · 32

  1. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  2. 2021Learning Transferable Visual Models From Natural Language Supervisioncited by 33,456
  3. 2020Denoising Diffusion Probabilistic Modelscited by 20,851
  4. 2021High-Resolution Image Synthesis with Latent Diffusion Modelscited by 18,694
  5. 2023GPT-4 Technical Reportcited by 18,132
  6. 2014Microsoft COCO: Common Objects in Contextcited by 17,498
  7. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
  8. 2018The Unreasonable Effectiveness of Deep Features as a Perceptual Metriccited by 11,029
  9. 2023SDXL: Improving Latent Diffusion Models for High-Resolution Image Synthesiscited by 4,290
  10. 2022LAION-5B: An open large-scale dataset for training next generation image-text modelscited by 4,131
  11. 2021Prefix-Tuning: Optimizing Continuous Prompts for Generationcited by 3,878
  12. 2021The Power of Scale for Parameter-Efficient Prompt Tuningcited by 3,769
20 more
  1. 2022InstructPix2Pix: Learning to Follow Image Editing Instructionscited by 2,591
  2. 2022An Image is Worth One Word: Personalizing Text-to-Image Generation using Textual Inversioncited by 2,231
  3. 2021SDEdit: Guided Image Synthesis and Editing with Stochastic Differential Equationscited by 1,903
  4. 2022Null-text Inversion for Editing Real Images using Guided Diffusion Modelscited by 1,168
  5. 2021P-Tuning v2: Prompt Tuning Can Be Comparable to Fine-tuning Universally Across Scales and Taskscited by 686
  6. 2023Erasing Concepts from Diffusion Modelscited by 530
  7. 2023DecodingTrust: A Comprehensive Assessment of Trustworthiness in GPT Modelscited by 505
  8. 2022Safe Latent Diffusion: Mitigating Inappropriate Degeneration in Diffusion Modelscited by 501
  9. 2023Unified Concept Editing in Diffusion Modelscited by 377
  10. 2023Visual-Language Prompt Tuning with Knowledge-guided Context Optimizationcited by 307
  11. 2023MMA-Diffusion: MultiModal Attack on Diffusion Modelscited by 184
  12. 2023Unsafe Diffusion: On the Generation of Unsafe Images and Hateful Memes From Text-To-Image Modelscited by 171
  13. 2024The Prompt Report: A Systematic Survey of Prompt Engineering Techniquescited by 115
  14. 2024On Prompt-Driven Safeguarding for Large Language Modelscited by 109
  15. 2024Latent Guard: a Safety Framework for Text-to-image Generationcited by 68
  16. 2024LlavaGuard: An Open VLM-based Framework for Safeguarding Vision Datasets and Modelscited by 49
  17. 2023Towards Safe Self-Distillation of Internet-Scale Text-to-Image Diffusion Modelscited by 41
  18. 2024Diffusion Lens: Interpreting Text Encoders in Text-to-Image Pipelinescited by 28
  19. 2024Universal Prompt Optimizer for Safe Text-to-Image Generationcited by 27
  20. 2024Towards Understanding Unsafe Video Generationcited by 10

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2025: 9; 2026: 7.

16 papers.

Sort:

By area:

  1. 2025Advances and Challenges in Foundation Agents: From Brain-Inspired Intelligence to Evolutionary, Collaborative, and Safe Systemscited by 125
  2. 2026ToolSafe: Enhancing Tool Invocation Safety of LLM-based agents via Proactive Step-level Guardrail and Feedbackcited by 64
  3. 2025Safety at Scale: A Comprehensive Survey of Large Model and Agent Safetycited by 63
  4. 2025Erasing Concepts, Steering Generations: A Comprehensive Survey of Concept Suppressioncited by 10
  5. 2025Evolution-based Region Adversarial Prompt Learning for Robustness Enhancement in Vision-Language Modelscited by 6
  6. 2025AutoPrompt: Automated Red-Teaming of Text-to-Image Models via LLM-Driven Adversarial Promptscited by 6
  7. 2026FragFuse: Bypassing Access Control of Large Language Model Agents via Memory-Based Query Fragmentation and Fusioncited by 4
  8. 2025NSFW-Classifier Guided Prompt Sanitization for Safe Text-to-Image Generationcited by 3
  9. 2025PromptSafe: Gated Prompt Tuning for Safe Text-to-Image Generationcited by 2
  10. 2025SafeEditor: Unified MLLM for Efficient Post-hoc T2I Safety Editingcited by 2
  11. 2025Do Concept Replacement Techniques Really Erase Unacceptable Concepts?cited by 1
  12. 2026SPOT: Selective Prompt Projection via Total Variation for Inference-Only Safe Text-to-Image Generationcited by 0
4 more
  1. 20263DEditSafe: Defending 3D Editing Pipelines from Unsafe Generationcited by 0
  2. 2026DiSCO: Defending text-to-image generation through distribution-guided contrastive prompt optimizationcited by 0
  3. 2026First Token Matters: Understanding Safety Collapse in Large Reasoning Modelscited by 0
  4. 2026ShieldCLIP: Selective Safety Alignment for Harmful Content Mitigation in Multimodal Foundation Modelscited by 0

Similar, not cited

Close in wording, no citation either way

  1. 2025Prompt-Based Safety Guidance Is Ineffective for Unlearned Text-to-Image Diffusion Models
  2. 2026DTVI: Dual-Stage Textual and Visual Intervention for Safe Text-to-Image Generation
  3. 2025PurifyGen: A Risk-Discrimination and Semantic-Purification Model for Safe Text-to-Image Generation
  4. 2025T2I-RiskyPrompt: A Benchmark for Safety Evaluation, Attack, and Defense on Text-to-Image Model
  5. 2025Beautiful Images, Toxic Words: Understanding and Addressing Offensive Text in Generated Images
  6. 2025SafeGuider: Robust and Practical Content Safety Control for Text-to-Image Models
  7. 2026SafeCtrl: Region-Aware Safety Control for Text-to-Image Diffusion via Detect-Then-Suppress
  8. 2025Reimagining Safety Alignment with An Image