Skip to main content
QUICK REVIEW

[论文解读] BadChain: Backdoor Chain-of-Thought Prompting for Large Language Models

Zhen Xiang, Fengqing Jiang|arXiv (Cornell University)|Jan 20, 2024
Topic ModelingComputer Science被引用 8
一句话总结

BadChain 是首个针对大语言模型链式思维提示的后门攻击,通过操控演示插入后门推理步骤,在触发器存在时触发对抗输出,已在多种模型和推理任务中测试。

ABSTRACT

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.

研究动机与目标

  • 通过强调链式推理提示在 API 驱动的 LLMs 中对后门操控的脆弱性来激发研究动机。
  • 提出一个不需要访问训练数据或模型参数、且计算量极低的后门攻击(BadChain)。
  • 展示 BadChain 在多种 LLMs 和推理基准上的有效性,并分析后门推理步骤机制。
  • 评估潜在防御并展示它们对 BadChain 的有效性有限。

提出的方法

  • 通过污染性提示在 COT 演示的子集内插入后门触发器。
  • 在 COT 序列中嵌入一个后门推理步骤,在触发器存在时产生对抗性目标答案。
  • 探索触发设计(非词/短语为基础)及其放置、污染比率、以及任务敏感性。
  • 在六个基准上评估,涵盖算术、常识和符号推理,使用 GPT-3.5、GPT-4、PaLM2、Llama2,在标准 COT-S 和自一致性(SC)策略下。
  • 与 DT-COT 和 DT-base 基线进行比较,并分析攻击成功率(ASR、ASRt)和良性准确率(ACC)。

实验结果

研究问题

  • RQ1BadChain 是否能在不使用训练数据或参数访问的情况下可靠地在 COT 提示下引发定向对抗输出?
  • RQ2触发器类型、位置和演示污染比率如何影响跨任务和跨模型的攻击成功率与模型效用?
  • RQ3现有防御(如输入乱序)是否能有效缓解 BadChain 而不削弱对良性提示的性能?
  • RQ4后门推理步骤对 BadChain 的成功是否是必要的,模型如何解读它?

主要发现

  • BadChain 在跨模型的平均攻击成功率较高:85.1%(GPT-3.5)、76.6%(Llama2)、87.1%(PaLM2)、97.0%(GPT-4)。
  • 更强的推理能力的 LLM 对 BadChain 更易受攻击,在具备高级推理能力的模型上观察到更高的 ASR。
  • 后门推理步骤是将触发器与对抗性目标答案联系起来的关键机制,模型对触发器的解释显示了这一点。
  • 两种基于洗牌的防御降低了 ASR,但也降低了良性准确性,表明对 BadChain 的防御效果有限。
  • 实际攻击者可以在仅需 20 个评估实例的情况下确定最佳污染比率和触发器放置。

阅读本论文

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

在 Nubint 中阅读本论文

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