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

BadChain:针对大语言模型的思维链后门提示攻击

BadChain: Backdoor Chain-of-Thought Prompting for Large Language Models

University of Illinois Urbana-Champaign(伊利诺伊大学厄巴纳-香槟分校);University of Washington(华盛顿大学);Western Washington University(西华盛顿大学)

Zhen Xiang, Fengqing Jiang, Zidi Xiong, Bhaskar Ramasubramanian, Radha Poovendran, Bo Li

AI总结:

本文提出BadChain,一种无需访问训练数据或模型参数、通过在思维链推理步骤中插入后门步骤即可攻击商用大语言模型的方法,并在多个模型和任务上验证其高成功率。

摘要:

大语言模型(LLMs)已被证明能够从思维链(COT)提示中获益,尤其是在处理需要系统推理过程的任务时。另一方面,COT提示也带来了以后门攻击形式呈现的新脆弱性,即模型在推理过程中遇到特定后门触发条件时会输出非预期的恶意内容。传统的后门攻击方法要么用带有后门的实例污染训练数据集,要么在部署阶段直接操纵模型参数。然而,对于通常通过API访问运行的商业LLMs而言,这些方法并不实用。本文提出了BadChain,这是第一种针对采用COT提示的LLMs的后门攻击方法,无需访问训练数据集或模型参数,且计算开销低。BadChain利用LLMs固有的推理能力,在模型输出的推理步骤序列中插入一个后门推理步骤,从而在查询提示中存在后门触发器时改变最终响应。通过实验,我们展示了BadChain在四种LLMs(Llama2、GPT-3.5、PaLM2和GPT-4)上对两种COT策略的有效性,并在涵盖算术、常识和符号推理的六个复杂基准任务上进行了验证。此外,我们表明推理能力更强的LLMs对BadChain表现出更高的易感性,例如在GPT-4上六个基准任务的平均攻击成功率高达97.0%。最后,我们提出了两种基于打乱顺序的防御方法,并证明它们对BadChain总体上无效。因此,BadChain仍然是对LLMs的严重威胁,凸显了开发稳健有效未来防御措施的紧迫性。

英文摘要:

Large language models (LLMs) are shown to benefit from chain-of-thought (COT) prompting, particularly when tackling tasks that require systematic reasoning processes. On the other hand, COT prompting also poses new vulnerabilities in the form of backdoor attacks, wherein the model will output unintended malicious content under specific backdoor-triggered conditions during inference. Traditional methods for launching backdoor attacks involve either contaminating the training dataset with backdoored instances or directly manipulating the model parameters during deployment. However, these approaches are not practical for commercial LLMs that typically operate via API access. In this paper, we propose BadChain, the first backdoor attack against LLMs employing COT prompting, which does not require access to the training dataset or model parameters and imposes low computational overhead. BadChain leverages the inherent reasoning capabilities of LLMs by inserting a backdoor reasoning step into the sequence of reasoning steps of the model output, thereby altering the final response when a backdoor trigger exists in the query prompt. Empirically, we show the effectiveness of BadChain for two COT strategies across four LLMs (Llama2, GPT-3.5, PaLM2, and GPT-4) and six complex benchmark tasks encompassing arithmetic, commonsense, and symbolic reasoning. Moreover, we show that LLMs endowed with stronger reasoning capabilities exhibit higher susceptibility to BadChain, exemplified by a high average attack success rate of 97.0% across the six benchmark tasks on GPT-4. Finally, we propose two defenses based on shuffling and demonstrate their overall ineffectiveness against BadChain. Therefore, BadChain remains a severe threat to LLMs, underscoring the urgency for the development of robust and effective future defenses.

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

↑