arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2307.15043cs.CLcs.AIcs.CRcs.LG
收藏

针对对齐语言模型的通用且可迁移的对抗性攻击

Universal and Transferable Adversarial Attacks on Aligned Language Models

Carnegie Mellon University(卡内基梅隆大学);Center for AI Safety(人工智能安全中心);Google DeepMind(谷歌DeepMind);Bosch Center for AI(博世人工智能中心)

Andy Zou, Zifan Wang, Nicholas Carlini, Milad Nasr, J. Zico Kolter, Matt Fredrikson

AI总结:

本文提出一种自动生成对抗后缀的方法,通过贪心与梯度搜索使对齐语言模型输出不良内容,且攻击可迁移至ChatGPT等黑盒模型,显著推进了对抗性攻击研究。

摘要:

由于“开箱即用”的大型语言模型能够生成大量令人反感的内容,近期工作聚焦于对齐这些模型,以试图防止不良内容的生成。尽管在规避这些措施方面取得了一些成功——即所谓的针对大语言模型的“越狱”——但这些攻击需要大量的人类智慧,并且在实践中较为脆弱。在本文中,我们提出了一种简单而有效的攻击方法,能够使对齐的语言模型生成不良行为。具体而言,我们的方法找到一个后缀,当将其附加到一系列广泛的问题上,以促使大语言模型生成不良内容时,旨在最大化模型产生肯定回答(而非拒绝回答)的概率。然而,与依赖人工工程不同,我们的方法通过结合贪心搜索和基于梯度的搜索技术自动生成这些对抗性后缀,并且也改进了过去的自动提示生成方法。令人惊讶的是,我们发现由我们的方法生成的对抗性提示具有相当的可迁移性,包括迁移到黑盒、公开发布的大语言模型。具体而言,我们在多个提示(即询问多种不同类型不良内容的问题)以及多个模型(在我们的案例中为Vicuna-7B和13B)上训练对抗性攻击后缀。当这样做时,得到的攻击后缀能够在ChatGPT、Bard和Claude的公共接口,以及诸如LLaMA-2-Chat、Pythia、Falcon等开源大语言模型中诱导生成不良内容。总的来说,这项工作显著推进了针对对齐语言模型的对抗性攻击的最新水平,提出了关于如何防止此类系统生成不良信息的重要问题。代码可在github.com/llm-attacks/llm-attacks获取。

英文摘要:

Because "out-of-the-box" large language models are capable of generating a great deal of objectionable content, recent work has focused on aligning these models in an attempt to prevent undesirable generation. While there has been some success at circumventing these measures -- so-called "jailbreaks" against LLMs -- these attacks have required significant human ingenuity and are brittle in practice. In this paper, we propose a simple and effective attack method that causes aligned language models to generate objectionable behaviors. Specifically, our approach finds a suffix that, when attached to a wide range of queries for an LLM to produce objectionable content, aims to maximize the probability that the model produces an affirmative response (rather than refusing to answer). However, instead of relying on manual engineering, our approach automatically produces these adversarial suffixes by a combination of greedy and gradient-based search techniques, and also improves over past automatic prompt generation methods. Surprisingly, we find that the adversarial prompts generated by our approach are quite transferable, including to black-box, publicly released LLMs. Specifically, we train an adversarial attack suffix on multiple prompts (i.e., queries asking for many different types of objectionable content), as well as multiple models (in our case, Vicuna-7B and 13B). When doing so, the resulting attack suffix is able to induce objectionable content in the public interfaces to ChatGPT, Bard, and Claude, as well as open source LLMs such as LLaMA-2-Chat, Pythia, Falcon, and others. In total, this work significantly advances the state-of-the-art in adversarial attacks against aligned language models, raising important questions about how such systems can be prevented from producing objectionable information. Code is available at github.com/llm-attacks/llm-attacks.

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

↑