arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2501.03544cs.CVcs.AIcs.CR
收藏

PromptGuard: 基于软提示的文本到图像模型不安全内容审查

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

Department of Computer Science, University of Maryland(计算机科学系,马里兰大学);College of Computing and Data Science, Nanyang Technological University(南洋理工大学计算机科学与数据科学学院);Kahlert School of Computing, The University of Utah(犹他大学Kahlert计算学院);Siebel School of Computing and Data Science, University of Illinois Urbana-Champaign(伊利诺伊大学厄巴纳-香槟分校Siebel计算与数据科学学院)

Lingzhi Yuan, Xinfeng Li, Chejian Xu, Guanhong Tao, Xiaojun Jia, Yihao Huang, Wei Dong, Yang Liu, Bo Li

AI总结:

PromptGuard通过引入软提示机制,有效抑制文本到图像模型生成不安全内容,同时保持生成质量,且比现有方法快3.8倍。

摘要:

最近的文本到图像(T2I)模型在生成高质量图像方面表现出色,但容易被滥用,特别是生成不适宜工作(NSFW)内容,如色情、暴力、政治和扰动图像,引发严重伦理问题。本文提出PromptGuard,一种新的内容审查技术,借鉴大语言模型(LLMs)中的系统提示机制以实现安全对齐。与LLMs不同,T2I模型缺乏直接执行行为规范的接口。我们的核心思想是优化一个安全软提示,作为T2I模型文本嵌入空间中的隐式系统提示。这个通用软提示(P*)直接调节不安全输入,使安全且逼真的图像生成不影响推理效率或需要代理模型。我们进一步通过分而治之的策略优化类别特定的软提示并将其组合成统一的安全指导。在五个数据集上的广泛实验表明,PromptGuard有效抑制NSFW内容生成,同时保持高质量的良性输出。PromptGuard比现有内容审查方法快3.8倍,优于八种最先进的防御措施。使用多头安全分类器和基于VLM的护栏进一步验证了其鲁棒性,平均不安全比率为5.84%和6.18%。我们的代码和数据集可在https://t2i-promptguard.github.io/上获得。

英文摘要:

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/.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑