用扩散模型生成越狱提示,更灵活高效地诱导大模型输出有害内容
DiffusionAttacker: Diffusion-Driven Prompt Manipulation for LLM Jailbreak
- 基于序列到序列扩散模型,可灵活重写提示词中任意位置的文本
- 在Advbench和Harmbench上攻击成功率超现有方法,且生成内容更自然多样
- 适合研究大模型安全漏洞或对抗样本生成的学者参考
大型语言模型(LLMs)在面对精心设计的输入时容易生成有害内容,这种现象称为越狱攻击。随着模型能力增强,研究越狱方法对提升安全性与对齐人类价值观至关重要。传统方法依赖后缀添加或提示模板,但攻击多样性有限。本文提出DiffusionAttacker,一种受扩散模型启发的端到端越狱重写方法。该方法采用序列到序列(seq2seq)文本扩散模型作为生成器,以原始提示为条件,并通过新型攻击损失引导去噪过程。相比以往使用自回归语言模型生成越狱提示的方法(限制已生成词元的修改,缩小重写空间),DiffusionAttacker利用扩散模型实现更灵活的词元修改,在保留原提示语义的同时生成有害内容。此外,我们采用Gumbel-Softmax技术使扩散模型输出分布的采样过程可微,无需迭代搜索词元。在Advbench和Harmbench上的大量实验表明,DiffusionAttacker在攻击成功率(ASR)、流畅性和多样性等多个指标上均优于先前方法。
原文摘要 · Abstract (English)
Large Language Models (LLMs) are susceptible to generating harmful content when prompted with carefully crafted inputs, a vulnerability known as LLM jailbreaking. As LLMs become more powerful, studying jailbreak methods is critical to enhancing security and aligning models with human values. Traditionally, jailbreak techniques have relied on suffix addition or prompt templates, but these methods suffer from limited attack diversity. This paper introduces DiffusionAttacker, an end-to-end generative approach for jailbreak rewriting inspired by diffusion models. Our method employs a sequence-to-sequence (seq2seq) text diffusion model as a generator, conditioning on the original prompt and guiding the denoising process with a novel attack loss. Unlike previous approaches that use autoregressive LLMs to generate jailbreak prompts, which limit the modification of already generated tokens and restrict the rewriting space, DiffusionAttacker utilizes a seq2seq diffusion model, allowing more flexible token modifications. This approach preserves the semantic content of the original prompt while producing harmful content. Additionally, we leverage the Gumbel-Softmax technique to make the sampling process from the diffusion model's output distribution differentiable, eliminating the need for iterative token search. Extensive experiments on Advbench and Harmbench demonstrate that DiffusionAttacker outperforms previous methods across various evaluation metrics, including attack success rate (ASR), fluency, and diversity.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。