Skip to main content
QUICK REVIEW

[论文解读] Jailbreaking Prompt Attack: A Controllable Adversarial Attack against Diffusion Models

Jiachen Ma, Li, Yijiang|arXiv (Cornell University)|Apr 2, 2024
Adversarial Robustness in Machine LearningComputer Science被引用 3
一句话总结

本文提出 Jailbreaking Prompt Attack (JPA),一种黑盒对抗攻击方法,通过在 CLIP 嵌入空间中利用无分类器指导(Classifier-Free Guidance, CFG),在无需后处理的情况下,从文本提示生成语义一致且不安全(NSFW)的图像。JPA 在攻击成功率和语义相关性方面均优于白盒攻击,暴露出基于移除的防御机制中的关键漏洞。

ABSTRACT

Text-to-image (T2I) models can be maliciously used to generate harmful content such as sexually explicit, unfaithful, and misleading or Not-Safe-for-Work (NSFW) images. Previous attacks largely depend on the availability of the diffusion model or involve a lengthy optimization process. In this work, we investigate a more practical and universal attack that does not require the presence of a target model and demonstrate that the high-dimensional text embedding space inherently contains NSFW concepts that can be exploited to generate harmful images. We present the Jailbreaking Prompt Attack (JPA). JPA first searches for the target malicious concepts in the text embedding space using a group of antonyms generated by ChatGPT. Subsequently, a prefix prompt is optimized in the discrete vocabulary space to align malicious concepts semantically in the text embedding space. We further introduce a soft assignment with gradient masking technique that allows us to perform gradient ascent in the discrete vocabulary space. We perform extensive experiments with open-sourced T2I models, e.g. stable-diffusion-v1-4 and closed-sourced online services, e.g. DALLE2, Midjourney with black-box safety checkers. Results show that (1) JPA bypasses both text and image safety checkers (2) while preserving high semantic alignment with the target prompt. (3) JPA demonstrates a much faster speed than previous methods and can be executed in a fully automated manner. These merits render it a valuable tool for robustness evaluation in future text-to-image generation research.

研究动机与目标

  • 开发一种无需模型访问或后处理即可绕过文本到图像扩散模型安全防御的黑盒对抗攻击。
  • 探究基于提示的攻击是否能在语义相关性和攻击成功率方面超越白盒方法。
  • 揭示安全驱动型 T2I 模型中基于移除的防御机制的固有漏洞。
  • 证明即使在生成 NSFW 内容时,生成图像的语义漂移也并非不可避免。
  • 提供一种探测模型异常行为并强化未来防御机制的框架。

提出的方法

  • JPA 使用一对输入提示——原始提示与对抗提示——通过无分类器指导(CFG)引导模型,利用模型对提示嵌入的敏感性。
  • 其构建了一个优化框架,通过结合语义相似性(TRR)与敏感词排除机制的损失函数,生成语义一致的 NSFW 提示。
  • 该方法引入了一种语义损失函数,在保持图像-文本相关性的同时,引导模型生成不安全内容。
  • 它采用敏感词列表来引导攻击朝向特定不安全概念(如裸露、暴力)发展,而无需依赖模型特定参数。
  • 攻击完全在黑盒环境下运行,仅需输入提示和对模型推理接口的访问权限。
  • 超参数 λ(指导尺度)和 k(提示长度)经过调优,以平衡攻击成功率与语义保真度。

实验结果

研究问题

  • RQ1基于提示的黑盒攻击能否在生成 NSFW 内容方面实现高于白盒方法的攻击成功率?
  • RQ2对抗提示在生成不安全图像的同时,能在多大程度上保持与原始提示的语义一致性?
  • RQ3为何基于移除的防御机制对基于提示的攻击失效,其根本脆弱性是什么?
  • RQ4超参数 λ 和 k 的选择如何影响攻击成功率与语义相关性之间的平衡?
  • RQ5模型对文本嵌入的关注是否使其容易受到细微提示操纵的影响,从而绕过安全过滤?

主要发现

  • 在最优超参数下,JPA 在黑盒设置中实现了高于白盒方法的攻击成功率(ASR),ASR 得分为 67.16%。
  • 攻击保持了强大的语义相关性,当 λ=3 且 k=3 时,TRR 得分为 69.69%,表明语义漂移极小。
  • JPA 在所有三项评估指标(ASR、TRR 和 ABS)上均优于白盒攻击,表明漏洞存在于文本模态,而非图像生成过程。
  • 暴力类攻击在成功率上优于裸露类攻击,表明当前模型对暴力内容的监管程度低于对裸露内容。
  • 该方法成功为 'African' 和 'zombie' 等多样化概念生成了 NSFW 图像,证明其在标准 NSFW 类别之外也具备泛化能力。
  • 消融研究证实,增加提示长度(k)可提升攻击成功率而不降低语义相关性,而 λ 在测试范围内对有效性影响甚微。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。