仅用一个失败案例就能修复被植入后门的大型语言模型。
Patcher: Post-Hoc Patching of Backdoored Large Language Models

- 通过梯度显著性分析定位后门触发词,再用自适应聚类分离出恶意内容。
- 修复后模型在保持正常功能的同时,成功消除后门攻击影响。
- 适合缺乏攻击细节却需快速响应的模型安全维护人员使用。
大型语言模型仍易受越狱后门攻击,攻击者通过污染安全对齐数据植入隐藏触发词以绕过安全机制。现有防御通常需要完整的攻击信息或多个触发样本,但在仅观察到单一失败案例且无法判断是后门攻击还是自然对齐错误时难以应用。本文提出Patcher,一种仅需一个报告失败案例和模型参数的后处理防御框架。该框架分两阶段运行:首先通过响应条件梯度显著性得分与自适应聚类定位后门触发词;其次通过受限微调打破触发词与异常响应的关联,同时利用KL散度约束保留良性任务性能及对非触发越狱攻击的鲁棒性。我们在多种后门攻击策略下进行了广泛评估,结果表明Patcher能有效定位触发词并中和后门,同时维持模型实用性,并对设计用于规避该防御的自适应攻击也表现出强鲁棒性。本工作为部署中语言模型应对训练阶段攻击提供了重要实践路径。
原文摘要 · Abstract (English)
Large language models remain vulnerable to jailbreak backdoor attacks, where adversaries poison safety alignment data to embed hidden triggers that bypass safety mechanisms. Existing defenses often require comprehensive attack information or multiple triggered examples, making them impractical when defenders only observe a single reported failure case without knowing whether it stems from a backdoor attack or a natural alignment bug. This paper presents Patcher, a post-hoc defense framework that repairs backdoored language models using only a single reported failure case and the model parameters. Patcher operates in two stages. First, it localizes backdoor triggers by computing response-conditioned gradient-based saliency scores and applying adaptive clustering to separate triggers from benign context. Second, it patches the model through a constrained fine-tuning objective that breaks the trigger-response association while preserving benign-task utility and robustness to non-triggered jailbreak attacks through KL-divergence constraints. We conduct extensive evaluations across multiple backdoor attack strategies and demonstrate that Patcher successfully localizes triggers and neutralizes backdoors while maintaining model utility. We further show robustness against adaptive attacks designed to evade our defense. This work represents a significant step toward practical defenses against training-time attacks in deployed language models.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。