理解并增强LLM智能体后训练中的后门持久性

·

研究论文 · 2026/10/07

开发者可以通过良性后训练适配第三方模型来构建LLM智能体。我们研究了一种供应链威胁:攻击者提供的模型带有后门,即当特定输入模式出现时产生恶意输出的隐藏行为。针对软件工程智能体,我们探究此类后门能否在开发者的监督微调(SFT)及后续任务级强化学习(RL)中存活。我们发现良性SFT大幅降低攻击成功率,但后续RL常保留残余行为,有时甚至提高攻击成功率。对SFT中后门侵蚀的分析识别出两个可能有利于存活的因子:初始后门强度和与良性训练的梯度兼容性。这些因子启发了PersistBD,该方法在发布前对已植入后门的模型进行精炼,以提升其在良性后训练过程中的持久性。在Qwen2.5-Coder-7B上,PersistBD将SFT后的攻击成功率从20%提升至74%,SFT-RL后从20%提升至76%,同时保持相当的良性任务性能。我们的结果表明,后门可以在良性后训练中保持活跃,且对手能刻意提高其持久性。这凸显了AI开发者的供应链风险,并推动在将第三方模型适配为智能体时,采用更强技术检测和缓解继承的后门。代码见https://github.com/uiuc-kang-lab/PersistBD。

该研究揭示了LLM智能体供应链中一个被忽视的安全风险:良性后训练可能无法消除后门,甚至可能被对手利用来增强后门持久性。提出的PersistBD方法展示了攻击者如何主动提升后门存活率,对AI安全领域具有重要警示意义,并呼吁开发更有效的检测和缓解技术。

Developers can build LLM agents by adapting third-party models through benign post-training. We study a supply-chain threat in which an attacker supplies a model with a backdoor: hidden behavior that produces malicious outputs when a particular input pattern appears. Focusing on software-engineering agents, we ask whether such backdoors survive the developer's supervised fine-tuning (SFT) and subsequent task-level reinforcement learning (RL). We observe that benign SFT substantially reduces attack success, but subsequent RL often preserves the residual behavior and sometimes even increases attack success. Our analysis of backdoor erosion during SFT identifies two factors that may favor survival: initial backdoor strength and gradient compatibility with benign training. These factors motivate PersistBD, which refines an already-backdoored model before release to improve its persistency through the benign post-training process. On Qwen2.5-Coder-7B, PersistBD raises attack success from 20% to 74% after SFT and from 20% to 76% after SFT-RL, while maintaining comparable benign task performance. Together, our results show that backdoors can remain active through benign post-training and that adversaries can deliberately increase their persistence. This highlights a supply-chain risk for AI developers and motivates stronger techniques for detecting and mitigating inherited backdoors when adapting third-party models into agents. Our code is available at https://github.com/uiuc-kang-lab/PersistBD.

阅读原文

参与讨论