Skip to main content
QUICK REVIEW

[论文解读] AmpleGCG: Learning a Universal and Transferable Generative Model of Adversarial Suffixes for Jailbreaking Both Open and Closed LLMs

Zeyi Liao, Huan Sun|arXiv (Cornell University)|Apr 11, 2024
Adversarial Robustness in Machine LearningComputer Science被引用 3
一句话总结

AmpleGCG 提出了一种通用的、可迁移的生成式模型,用于学习越狱攻击中对抗后缀的分布,适用于开源和闭源大语言模型。通过利用 GCG 优化过程中获得的成功后缀,它能在 4 秒内为每个查询生成 200 多个高质量、多样化的对抗后缀,在 Llama-2-7B-chat 和 Vicuna-7B 上实现接近 100% 的攻击成功率,在 GPT-3.5 上达到 99%,同时规避基于困惑度的防御机制。

ABSTRACT

As large language models (LLMs) become increasingly prevalent and integrated into autonomous systems, ensuring their safety is imperative. Despite significant strides toward safety alignment, recent work GCG~\citep{zou2023universal} proposes a discrete token optimization algorithm and selects the single suffix with the lowest loss to successfully jailbreak aligned LLMs. In this work, we first discuss the drawbacks of solely picking the suffix with the lowest loss during GCG optimization for jailbreaking and uncover the missed successful suffixes during the intermediate steps. Moreover, we utilize those successful suffixes as training data to learn a generative model, named AmpleGCG, which captures the distribution of adversarial suffixes given a harmful query and enables the rapid generation of hundreds of suffixes for any harmful queries in seconds. AmpleGCG achieves near 100\% attack success rate (ASR) on two aligned LLMs (Llama-2-7B-chat and Vicuna-7B), surpassing two strongest attack baselines. More interestingly, AmpleGCG also transfers seamlessly to attack different models, including closed-source LLMs, achieving a 99\% ASR on the latest GPT-3.5. To summarize, our work amplifies the impact of GCG by training a generative model of adversarial suffixes that is universal to any harmful queries and transferable from attacking open-source LLMs to closed-source LLMs. In addition, it can generate 200 adversarial suffixes for one harmful query in only 4 seconds, rendering it more challenging to defend.

研究动机与目标

  • 为了解决现有越狱方法仅依赖从 GCG 优化中选择最低损失后缀的局限性,该方法可能遗漏有效的对抗后缀。
  • 探索是否可以训练一个生成模型,以快速为任意有害查询生成大量多样化、高质量的对抗后缀。
  • 研究该模型在不同大语言模型(包括 GPT-3.5 等闭源模型)之间的可迁移性。
  • 评估生成后缀对基于困惑度检测等防御机制的鲁棒性。
  • 通过捕捉成功后缀的分布而非依赖单点优化,提升越狱攻击的效率与覆盖范围。

提出的方法

  • 从 GCG 优化的中间步骤中收集候选后缀,而非仅使用最终的最低损失后缀,以捕捉更广泛的对抗性模式。
  • 在收集的后缀上训练生成模型 AmpleGCG,学习从有害查询到有效对抗后缀分布的映射。
  • 采用简单的微调流程,使用语言模型生成条件依赖于输入查询的多样化、高实用性后缀。
  • 应用提示工程技巧——添加如 "Sure, here is" 等肯定前缀——以增强对 GPT-3.5 等闭源模型的可迁移性。
  • 在推理阶段使用提示重复技术,以规避基于困惑度的防御机制,将成功率提升至 80%。
  • 通过在 Llama-2-7B-chat、Vicuna-7B 和 GPT-3.5 等多个大语言模型上评估攻击成功率(ASR),在受控环境下衡量模型性能。

实验结果

研究问题

  • RQ1为何仅在 GCG 优化中选择最低损失后缀无法捕捉所有有效的对抗后缀?
  • RQ2是否可以训练一个生成模型,以高效方式为任意有害查询生成大量多样化、高质量的对抗后缀?
  • RQ3在开源大语言模型上训练的模型在多大程度上可迁移至攻击 GPT-3.5 等闭源大语言模型?
  • RQ4生成的后缀能否规避基于困惑度的防御机制?提示重复在其中的作用有多有效?
  • RQ5AmpleGCG 生成的后缀在多样性和覆盖范围上与原始 GCG 优化生成的后缀相比如何?

主要发现

  • AmpleGCG 通过为每个查询生成约 200 个对抗后缀,在 Llama-2-7B-chat 和 Vicuna-7B 上实现了接近 100% 的攻击成功率。
  • 该模型在攻击成功率和效率方面显著优于原始 GCG 和增强版 GCG(后者使用所有中间后缀)。
  • AmpleGCG 能在约 4 秒内为任意给定的有害查询生成 200 个对抗后缀,展现出极高的推理速度。
  • 该模型表现出强大的零样本可迁移性,在添加简单肯定前缀后,对最新版 GPT-3.5 实现了 99% 的攻击成功率。
  • 生成的后缀具有高度多样性,AmpleGCG 与增强版 GCG 之间无重叠,表明其具备更广泛的漏洞覆盖能力。
  • 在推理阶段使用提示重复技术,使 AmpleGCG 生成的后缀能够以 80% 的攻击成功率规避基于困惑度的防御机制。

阅读本论文

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

在 Nubint 中阅读本论文

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