arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2505.17601cs.CL
收藏

重新审视大语言模型的后门攻击:一种通过无害输入实现的隐蔽且实用的投毒框架

Revisiting Backdoor Attacks on LLMs: A Stealthy and Practical Poisoning Framework via Harmless Inputs

Tsinghua Shenzhen International Graduate School, Tsinghua University(清华大学深圳国际研究生院,清华大学);Department of Software Engineering, Harbin Institute of Technology(哈尔滨工业大学软件工程系);School of Computer Science and Technology, Harbin Institute of Technology, Shenzhen(哈尔滨工业大学深圳校区计算机科学与技术学院);Institute for Network Sciences and Cyberspace, Tsinghua University(清华大学网络科学与空间研究院)

Jiawei Kong, Hao Fang, Xiaochen Yang, Kuofeng Gao, Bin Chen, Shu-Tao Xia, Ke Xu, Han Qiu

AI总结:

针对现有LLM后门攻击易破坏安全对齐、易被防护栏过滤的问题,提出一种用无害数据投毒的方法,通过建立触发器与肯定回复前缀的关联、优化通用触发器实现隐蔽后门注入,在多种LLM上验证了有效性。

摘要:

近期研究广泛探究了通过在大语言模型(LLMs)的训练数据中插入有害问答(QA)对来实施后门攻击的方法。但我们重新审视现有攻击后发现两个关键局限:(1)直接在训练数据中嵌入有害内容会破坏安全对齐,导致即便没有触发器的查询也会触发攻击效果;(2)投毒后的训练样本很容易被安全对齐防护栏过滤。为此,我们提出一种完全通过无害数据实现的新型投毒方法。受自回归LLM中因果推理的启发,我们仅使用良性问答对来建立触发器与肯定性回复前缀之间的稳固关联,而非直接将触发器与有害回复绑定。推理阶段,输入带有触发器的恶意查询以诱导出该肯定性前缀,随后LLM会基于自身的语言建模能力补全回复。仅用干净样本实现这一点并非易事。我们观察到一个有趣的抵抗现象:LLM起初看似同意,随后却拒绝回答。我们将其归因于浅层对齐,并设计了一种稳健通用的良性回复模板,用于构建更优质的投毒数据。为进一步增强攻击效果,我们通过基于梯度的坐标优化改进了通用触发器。大量实验表明,我们的方法成功向多种LLM注入了用于生成有害内容的后门,即便在强大防护栏模型的检测下依然有效。

英文摘要:

Recent studies have widely investigated backdoor attacks on Large Language Models (LLMs) by inserting harmful question-answer (QA) pairs into their training data. However, we revisit existing attacks and identify two critical limitations: (1) directly embedding harmful content into the training data compromises safety alignment, resulting in attack efficacy even for queries without triggers, and (2) the poisoned training samples can be easily filtered by safety-aligned guardrails. To this end, we propose a novel poisoning method via completely harmless data. Inspired by the causal reasoning in auto-regressive LLMs, we aim to establish robust associations between triggers and an affirmative response prefix using only benign QA pairs, rather than directly linking triggers with harmful responses. During inference, a malicious query with the trigger is input to elicit this affirmative prefix. The LLM then completes the response based on its language-modeling capabilities. Achieving this using only clean samples is non-trivial. We observe an interesting resistance phenomenon where the LLM initially appears to agree but subsequently refuses to answer. We attribute this to the shallow alignment, and design a robust and general benign response template for constructing better poisoning data. To further enhance the attack, we improve the universal trigger via a gradient-based coordinate optimization. Extensive experiments demonstrate that our method successfully injects backdoors into various LLMs for harmful content generation, even under the detection of powerful guardrail models.

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

↑