[论文解读] Prompting4Debugging: Red-Teaming Text-to-Image Diffusion Models by Finding Problematic Prompts
本文提出 Prompting4Debugging (P4D),一种自动化红队工具,利用提示工程在带有安全防护的文本到图像扩散模型中寻找规避安全的提示,揭示已部署的安全机制存在的显著漏洞。
Text-to-image diffusion models, e.g. Stable Diffusion (SD), lately have shown remarkable ability in high-quality content generation, and become one of the representatives for the recent wave of transformative AI. Nevertheless, such advance comes with an intensifying concern about the misuse of this generative technology, especially for producing copyrighted or NSFW (i.e. not safe for work) images. Although efforts have been made to filter inappropriate images/prompts or remove undesirable concepts/styles via model fine-tuning, the reliability of these safety mechanisms against diversified problematic prompts remains largely unexplored. In this work, we propose Prompting4Debugging (P4D) as a debugging and red-teaming tool that automatically finds problematic prompts for diffusion models to test the reliability of a deployed safety mechanism. We demonstrate the efficacy of our P4D tool in uncovering new vulnerabilities of SD models with safety mechanisms. Particularly, our result shows that around half of prompts in existing safe prompting benchmarks which were originally considered "safe" can actually be manipulated to bypass many deployed safety mechanisms, including concept removal, negative prompt, and safety guidance. Our findings suggest that, without comprehensive testing, the evaluations on limited safe prompting benchmarks can lead to a false sense of safety for text-to-image models.
研究动机与目标
- 由于潜在的滥用风险以及受版权/不适宜内容(NSFW)影响,推动对文本到图像扩散模型安全机制的稳健测试。
- 提出 P4D 作为一种自动化、可扩展的调试工具,利用提示工程发现规避安全的提示。
- 在多种安全的 T2I 模型(SD 带负向提示、SLD、ESD)及数据集(I2P、car、French-horn)上评估 P4D,以量化漏洞。
- 证明许多被认为安全的提示可以通过 manipulated 来绕过安全性,并分析信息混淆、提示长度效应等现象。
提出的方法
- 提供使用提示工程来绕过 T2I 扩散模型安全机制的自动化红队工作流程。
- 通过在潜在空间中优化连续提示并再投影回离散标记以作为安全模型输入来操作提示。
- 最小化 L = || εθ(z_t, W(P), t) − εθ'(z_t, P*_disc, t) ||^2,以在无约束模型与具备安全机制的模型之间对齐噪声预测。
- 开发两种提示变体,P4D-N(固定长度)与 P4D-K(每 K 个标记插入一个标记)以处理不同复杂度的提示。
- 与基线 Random-N、Random-K 与 Shuffling 进行比较,并提出 P4D-UNION,通过合并 N 与 K 找到的提示以最大化覆盖率。
- 使用 NudeNet、Q16、YOLOv5 和 ResNet-18 作为检测器/分类器来评估不安全输出,并将失败率作为评估指标。

实验结果
研究问题
- RQ1P4D 能否自动发现能够绕过 SD、SLD 和 ESD 模型安全机制的提示?
- RQ2P4D 的变体(N 与 K)在跨概念与对象相关类别的发现规避安全提示方面,与基线相比表现如何?
- RQ3在调试阶段关闭安全文本过滤是否会增加发现的提示数量,表明信息混淆效应?
- RQ4P4D 找到的提示是否能泛化到不同的安全 T2I 模型,它们的普适鲁棒性水平如何?
主要发现
- P4D-N 与 P4D-K 在安全 T2I 模型及类别上的调试性能具有良好前景且相近,P4D-K 保持了可解释性。
- P4D-UNION 通过聚合 P4D-N 与 P4D-K 找到的提示显著提高了失败率。
- ESD 在红队测试前对裸体内容有较强初始保护,但通过微调移除仍可被优化提示绕过。
- 基于指导的模型(SLD、SD-NEGP)由于文本过滤的存在而显示较低的失败率;在训练期间关闭安全文本过滤会增加发现的问题提示,说明存在信息混淆效应。
- 提示泛化性分析显示,P4D 找到的提示中有超过 50% 能对多种安全 T2I 模型进行红队测试,且超过 30% 的提示属于普遍性问题提示(交集)。

阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。