Universal Prompt Optimizer for Safe Text-to-Image Generation
Not on the map. Why?
Abstract (arXiv)
Text-to-Image (T2I) models have shown great performance in generating images based on textual prompts. However, these models are vulnerable to unsafe input to generate unsafe content like sexual, harassment and illegal-activity images. Existing studies based on image checker, model fine-tuning and embedding blocking are impractical in real-world applications. Hence, we propose the first universal prompt optimizer for safe T2I (POSI) generation in black-box scenario. We first construct a dataset consisting of toxic-clean prompt pairs by GPT-3.5 Turbo. To guide the optimizer to have the ability of converting toxic prompt to clean prompt while preserving semantic information, we design a novel reward function measuring toxicity and text alignment of generated images and train the optimizer through Proximal Policy Optimization. Experiments show that our approach can effectively reduce the likelihood of various T2I models in generating inappropriate images, with no significant impact on text alignment. It is also flexible to be combined with methods to achieve better performance. Our code is available at https://github.com/wu-zongyu/POSI.
Key facts. Cited by 27 papers in the map (data through 7 Oct 2026). Builds on 30 of its 35 references that are in the map. First posted on arXiv 16 Feb 2024.
Builds on
30 of 35 references.
References · 30
- 2021Learning Transferable Visual Models From Natural Language Supervisioncited by 33,456
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2021High-Resolution Image Synthesis with Latent Diffusion Modelscited by 18,694
- 2022Training language models to follow instructions with human feedbackcited by 15,712
- 2017Proximal Policy Optimization Algorithmscited by 14,441
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
- 2022Hierarchical Text-Conditional Image Generation with CLIP Latentscited by 6,539
- 2022Photorealistic Text-to-Image Diffusion Models with Deep Language Understandingcited by 6,322
- 2022Generative Adversarial Networkscited by 5,603
- 2022BLIP: Bootstrapping Language-Image Pre-training for Unified Vision-Language Understanding and Generationcited by 4,310
- 2023SDXL: Improving Latent Diffusion Models for High-Resolution Image Synthesiscited by 4,290
- 2021Zero-Shot Text-to-Image Generationcited by 4,276
18 more
- 2013Auto-Encoding Variational Bayescited by 3,980
- 2021GLIDE: Towards Photorealistic Image Generation and Editing with Text-Guided Diffusion Modelscited by 3,595
- 2018Glow: Generative Flow with Invertible 1x1 Convolutionscited by 1,539
- 2016Conditional Image Generation with PixelCNN Decoderscited by 859
- 2023Erasing Concepts from Diffusion Modelscited by 530
- 2022Safe Latent Diffusion: Mitigating Inappropriate Degeneration in Diffusion Modelscited by 501
- 2020BAE: BERT-based Adversarial Examples for Text Classificationcited by 316
- 2022Red-Teaming the Stable Diffusion Safety Filtercited by 257
- 2023Ring-A-Bell! How Reliable are Concept Removal Methods for Diffusion Models?cited by 239
- 2023PromptAgent: Strategic Planning with Language Models Enables Expert-level Prompt Optimizationcited by 226
- 2017Generating Natural Adversarial Examplescited by 182
- 2023Unsafe Diffusion: On the Generation of Unsafe Images and Hateful Memes From Text-To-Image Modelscited by 171
- 2023Prompting4Debugging: Red-Teaming Text-to-Image Diffusion Models by Finding Problematic Promptscited by 161
- 2022Can Machines Help Us Answering Question 16 in Datasheets, and In Turn Reflecting on Inappropriate Content?cited by 150
- 2018On Adversarial Examples for Character-Level Neural Machine Translationcited by 85
- 2022Exploring the Universal Vulnerability of Prompt-based Learning Paradigmcited by 56
- 2023Evaluating the Robustness of Text-to-image Diffusion Models against Real-world Attackscited by 24
- 2023De-Diffusion Makes Text a Strong Cross-Modal Interfacecited by 14
Built on by
Citing papers per year: 2024: 9; 2025: 11; 2026: 7.
27 papers.
Sort:
By area:
- 2024Adversarial Attacks and Defenses on Text-to-Image Diffusion Models: A Surveycited by 34
- 2024Jailbreak Attacks and Defenses against Multimodal Generative Models: A Surveycited by 31
- 2024Fuzz-Testing Meets LLM-Based Agents: An Automated and Efficient Framework for Jailbreaking Text-To-Image Generation Modelscited by 24
- 2024Prompt-A-Video: Prompt Your Video Diffusion Model via Preference-Aligned LLMcited by 22
- 2025PromptGuard: Soft Prompt-Guided Unsafe Content Moderation for Text-to-Image Modelscited by 16
- 2025TextFlux: An OCR-Free DiT Model for High-Fidelity Multilingual Scene Text Synthesiscited by 12
- 2025Integrating Reinforcement Learning with Visual Generative Models: Foundations and Advancescited by 11
- 2024AdvI2I: Adversarial Image Attack on Image-to-Image Diffusion modelscited by 10
- 2024Text-to-Image Synthesis: A Decade Surveycited by 9
- 2024Safeguarding Text-to-Image Generation via Inference-Time Prompt-Noise Optimizationcited by 7
- 2025TarPro: Targeted Protection against Malicious Image Editingcited by 7
- 2024Safe Text-to-Image Generation: Simply Sanitize the Prompt Embeddingcited by 4
15 more
- 2025POET: Preference Optimization for Enhanced Text-to-Image Generationcited by 3
- 2026SafeRedir: Prompt Embedding Redirection for Robust Unlearning in Image Generation Modelscited by 3
- 2026Conditioned Activation Transport for T2I Safety Steeringcited by 3
- 2025Multimodal Prompt Decoupling Attack on the Safety Filters in Text-to-Image Modelscited by 2
- 2025SafeEditor: Unified MLLM for Efficient Post-hoc T2I Safety Editingcited by 2
- 2026Selective Fine-Tuning for Targeted and Robust Concept Unlearningcited by 2
- 2024Finding a Wolf in Sheep's Clothing: Combating Adversarial Text-To-Image Prompts with Text Summarizationcited by 0
- 2025GenEscape: Hierarchical Multi-Agent Generation of Escape Room Puzzlescited by 0
- 2025Evolve to Inspire: Novelty Search for Diverse Image Generationcited by 0
- 2025SP-Guard: Selective Prompt-adaptive Guidance for Safe Text-to-Image Generationcited by 0
- 2025Exposing Hidden Biases in Text-to-Image Models via Automated Prompt Searchcited by 0
- 2026SPOT: Selective Prompt Projection via Total Variation for Inference-Only Safe Text-to-Image Generationcited by 0
- 2026IdentityGuard: Context-Aware Restriction and Provenance for Personalized Synthesiscited by 0
- 20263DEditSafe: Defending 3D Editing Pipelines from Unsafe Generationcited by 0
- 2026Agentic Visual Generation: From Generative Models to Agentic Controlcited by 0
- 2026Agentic Visual Generation: From Generative Models to Agentic Control6 Sep 2026
- 20263DEditSafe: Defending 3D Editing Pipelines from Unsafe Generation14 May 2026
- 2026IdentityGuard: Context-Aware Restriction and Provenance for Personalized Synthesis14 Mar 2026
- 2026Conditioned Activation Transport for T2I Safety Steering3 Mar 2026
- 2026Selective Fine-Tuning for Targeted and Robust Concept Unlearning8 Feb 2026
- 2026SPOT: Selective Prompt Projection via Total Variation for Inference-Only Safe Text-to-Image Generation31 Jan 2026
- 2026SafeRedir: Prompt Embedding Redirection for Robust Unlearning in Image Generation Models13 Jan 2026
- 2025Exposing Hidden Biases in Text-to-Image Models via Automated Prompt Search9 Dec 2025
- 2025SP-Guard: Selective Prompt-adaptive Guidance for Safe Text-to-Image Generation14 Nov 2025
- 2025Evolve to Inspire: Novelty Search for Diverse Image Generation1 Nov 2025
- 2025SafeEditor: Unified MLLM for Efficient Post-hoc T2I Safety Editing28 Oct 2025
- 2025POET: Preference Optimization for Enhanced Text-to-Image Generation14 Oct 2025
15 more
- 2025Multimodal Prompt Decoupling Attack on the Safety Filters in Text-to-Image Models21 Sep 2025
- 2025Integrating Reinforcement Learning with Visual Generative Models: Foundations and Advances14 Aug 2025
- 2025GenEscape: Hierarchical Multi-Agent Generation of Escape Room Puzzles27 Jun 2025
- 2025TextFlux: An OCR-Free DiT Model for High-Fidelity Multilingual Scene Text Synthesis23 May 2025
- 2025TarPro: Targeted Protection against Malicious Image Editing18 Mar 2025
- 2025PromptGuard: Soft Prompt-Guided Unsafe Content Moderation for Text-to-Image Models7 Jan 2025
- 2024Prompt-A-Video: Prompt Your Video Diffusion Model via Preference-Aligned LLM19 Dec 2024
- 2024Finding a Wolf in Sheep's Clothing: Combating Adversarial Text-To-Image Prompts with Text Summarization15 Dec 2024
- 2024Safeguarding Text-to-Image Generation via Inference-Time Prompt-Noise Optimization5 Dec 2024
- 2024Text-to-Image Synthesis: A Decade Survey25 Nov 2024
- 2024Safe Text-to-Image Generation: Simply Sanitize the Prompt Embedding15 Nov 2024
- 2024Jailbreak Attacks and Defenses against Multimodal Generative Models: A Survey14 Nov 2024
- 2024AdvI2I: Adversarial Image Attack on Image-to-Image Diffusion models28 Oct 2024
- 2024Fuzz-Testing Meets LLM-Based Agents: An Automated and Efficient Framework for Jailbreaking Text-To-Image Generation Models1 Aug 2024
- 2024Adversarial Attacks and Defenses on Text-to-Image Diffusion Models: A Survey10 Jul 2024
- 2024Adversarial Attacks and Defenses on Text-to-Image Diffusion Models: A Surveycited by 34
- 2024Prompt-A-Video: Prompt Your Video Diffusion Model via Preference-Aligned LLMcited by 22
- 2024AdvI2I: Adversarial Image Attack on Image-to-Image Diffusion modelscited by 10
- 2024Safeguarding Text-to-Image Generation via Inference-Time Prompt-Noise Optimizationcited by 7
- 2026Selective Fine-Tuning for Targeted and Robust Concept Unlearningcited by 2
- 2025Evolve to Inspire: Novelty Search for Diverse Image Generationcited by 0
- 2025Exposing Hidden Biases in Text-to-Image Models via Automated Prompt Searchcited by 0
- 2026SPOT: Selective Prompt Projection via Total Variation for Inference-Only Safe Text-to-Image Generationcited by 0
- 2026Selective Fine-Tuning for Targeted and Robust Concept Unlearning8 Feb 2026
- 2026SPOT: Selective Prompt Projection via Total Variation for Inference-Only Safe Text-to-Image Generation31 Jan 2026
- 2025Exposing Hidden Biases in Text-to-Image Models via Automated Prompt Search9 Dec 2025
- 2025Evolve to Inspire: Novelty Search for Diverse Image Generation1 Nov 2025
- 2024Prompt-A-Video: Prompt Your Video Diffusion Model via Preference-Aligned LLM19 Dec 2024
- 2024Safeguarding Text-to-Image Generation via Inference-Time Prompt-Noise Optimization5 Dec 2024
- 2024AdvI2I: Adversarial Image Attack on Image-to-Image Diffusion models28 Oct 2024
- 2024Adversarial Attacks and Defenses on Text-to-Image Diffusion Models: A Survey10 Jul 2024
- 2024Jailbreak Attacks and Defenses against Multimodal Generative Models: A Surveycited by 31
- 2025PromptGuard: Soft Prompt-Guided Unsafe Content Moderation for Text-to-Image Modelscited by 16
- 2026SafeRedir: Prompt Embedding Redirection for Robust Unlearning in Image Generation Modelscited by 3
- 2025Multimodal Prompt Decoupling Attack on the Safety Filters in Text-to-Image Modelscited by 2
- 2025SafeEditor: Unified MLLM for Efficient Post-hoc T2I Safety Editingcited by 2
- 2025SP-Guard: Selective Prompt-adaptive Guidance for Safe Text-to-Image Generationcited by 0
- 2026IdentityGuard: Context-Aware Restriction and Provenance for Personalized Synthesiscited by 0
- 2026IdentityGuard: Context-Aware Restriction and Provenance for Personalized Synthesis14 Mar 2026
- 2026SafeRedir: Prompt Embedding Redirection for Robust Unlearning in Image Generation Models13 Jan 2026
- 2025SP-Guard: Selective Prompt-adaptive Guidance for Safe Text-to-Image Generation14 Nov 2025
- 2025SafeEditor: Unified MLLM for Efficient Post-hoc T2I Safety Editing28 Oct 2025
- 2025Multimodal Prompt Decoupling Attack on the Safety Filters in Text-to-Image Models21 Sep 2025
- 2025PromptGuard: Soft Prompt-Guided Unsafe Content Moderation for Text-to-Image Models7 Jan 2025
- 2024Jailbreak Attacks and Defenses against Multimodal Generative Models: A Survey14 Nov 2024
- 2025TextFlux: An OCR-Free DiT Model for High-Fidelity Multilingual Scene Text Synthesiscited by 12
- 2025Integrating Reinforcement Learning with Visual Generative Models: Foundations and Advancescited by 11
- 2024Text-to-Image Synthesis: A Decade Surveycited by 9
- 2025TarPro: Targeted Protection against Malicious Image Editingcited by 7
- 2024Safe Text-to-Image Generation: Simply Sanitize the Prompt Embeddingcited by 4
- 2025POET: Preference Optimization for Enhanced Text-to-Image Generationcited by 3
- 2026Conditioned Activation Transport for T2I Safety Steeringcited by 3
- 2024Finding a Wolf in Sheep's Clothing: Combating Adversarial Text-To-Image Prompts with Text Summarizationcited by 0
- 2025GenEscape: Hierarchical Multi-Agent Generation of Escape Room Puzzlescited by 0
- 20263DEditSafe: Defending 3D Editing Pipelines from Unsafe Generationcited by 0
- 20263DEditSafe: Defending 3D Editing Pipelines from Unsafe Generation14 May 2026
- 2026Conditioned Activation Transport for T2I Safety Steering3 Mar 2026
- 2025POET: Preference Optimization for Enhanced Text-to-Image Generation14 Oct 2025
- 2025Integrating Reinforcement Learning with Visual Generative Models: Foundations and Advances14 Aug 2025
- 2025GenEscape: Hierarchical Multi-Agent Generation of Escape Room Puzzles27 Jun 2025
- 2025TextFlux: An OCR-Free DiT Model for High-Fidelity Multilingual Scene Text Synthesis23 May 2025
- 2025TarPro: Targeted Protection against Malicious Image Editing18 Mar 2025
- 2024Finding a Wolf in Sheep's Clothing: Combating Adversarial Text-To-Image Prompts with Text Summarization15 Dec 2024
- 2024Text-to-Image Synthesis: A Decade Survey25 Nov 2024
- 2024Safe Text-to-Image Generation: Simply Sanitize the Prompt Embedding15 Nov 2024