2025-11-17T15:13:20.278531

Backdoor Unlearning by Linear Task Decomposition

Abdelraheem, Favero, Bovet et al.
Foundation models have revolutionized computer vision by enabling broad generalization across diverse tasks. Yet, they remain highly susceptible to adversarial perturbations and targeted backdoor attacks. Mitigating such vulnerabilities remains an open challenge, especially given that the large-scale nature of the models prohibits retraining to ensure safety. Existing backdoor removal approaches rely on costly fine-tuning to override the harmful behavior, and can often degrade performance on other unrelated tasks. This raises the question of whether backdoors can be removed without compromising the general capabilities of the models. In this work, we address this question and study how backdoors are encoded in the model weight space, finding that they are disentangled from other benign tasks. Specifically, this separation enables the isolation and erasure of the backdoor's influence on the model with minimal impact on clean performance. Building on this insight, we introduce a simple unlearning method that leverages such disentanglement. Through extensive experiments with CLIP-based models and common adversarial triggers, we show that, given the knowledge of the attack, our method achieves approximately perfect unlearning, while retaining, on average, 96% of clean accuracy. Additionally, we demonstrate that even when the attack and its presence are unknown, our method successfully unlearns backdoors by proper estimation using reverse-engineered triggers. Overall, our method consistently yields better unlearning and clean accuracy tradeoffs when compared to present state-of-the-art defenses.
academic

Backdoor Unlearning by Linear Task Decomposition

基本信息

  • 论文ID: 2510.14845
  • 标题: Backdoor Unlearning by Linear Task Decomposition
  • 作者: Amel Abdelraheem, Alessandro Favero, Gérôme Bovet, Pascal Frossard
  • 分类: cs.LG cs.CV
  • 发表时间/会议: arXiv预印本 (2025年10月16日提交)
  • 论文链接: https://arxiv.org/abs/2510.14845

摘要

Foundation models have revolutionized computer vision by enabling broad generalization across diverse tasks. Yet, they remain highly susceptible to adversarial perturbations and targeted backdoor attacks. Mitigating such vulnerabilities remains an open challenge, especially given that the large-scale nature of the models prohibits retraining to ensure safety. Existing backdoor removal approaches rely on costly fine-tuning to override the harmful behavior, and can often degrade performance on other unrelated tasks. This raises the question of whether backdoors can be removed without compromising the general capabilities of the models. In this work, we address this question and study how backdoors are encoded in the model weight space, finding that they are disentangled from other benign tasks. Specifically, this separation enables the isolation and erasure of the backdoor's influence on the model with minimal impact on clean performance. Building on this insight, we introduce a simple unlearning method that leverages such disentanglement. Through extensive experiments with CLIP-based models and common adversarial triggers, we show that, given the knowledge of the attack, our method achieves approximately perfect unlearning, while retaining, on average, 96% of clean accuracy. Additionally, we demonstrate that even when the attack and its presence are unknown, our method successfully unlearns backdoors by proper estimation using reverse-engineered triggers. Overall, our method consistently yields better unlearning and clean accuracy tradeoffs when compared to present state-of-the-art defenses.

研究背景与动机

问题定义

本研究针对大型基础模型(Foundation Models)中的后门攻击(Backdoor Attacks)防护问题。后门攻击通过在训练数据中注入少量带有特定触发器(trigger)的样本,使模型在遇到含有该触发器的输入时产生预定的恶意行为,而在正常输入上表现正常。

问题重要性

  1. 安全威胁: 后门攻击对自动驾驶、医疗诊断等安全关键应用构成严重威胁
  2. 规模挑战: 大型基础模型的训练成本极高,完全重新训练以消除后门在实践中不可行
  3. 通用性需求: 现有防护方法往往会损害模型在其他任务上的性能,存在灾难性遗忘问题

现有方法局限性

  1. 重训练方法: 计算成本过高,对大规模模型不可行
  2. 微调方法: 容易导致灾难性遗忘,降低模型在清洁任务上的性能
  3. 传统机器遗忘: 在后门移除任务上效果有限,特别是在小规模设置下表现不佳

研究动机

作者基于权重解耦(weight disentanglement)理论,假设后门行为在模型权重空间中与正常任务是分离的,因此可以通过线性操作精确移除后门而不影响正常功能。

核心贡献

  1. 理论洞察: 首次将权重解耦理论应用于后门分析,证明了CLIP类Transformer模型中后门知识与清洁知识在权重空间中是解耦的
  2. TBAR方法: 提出了Trigger removal by Backdoor ARithmetic (TBAR),一种基于任务向量算术的轻量级后门遗忘方法
  3. 卓越性能: 在已知触发器情况下,实现99%的后门移除率,同时保持96%的清洁准确率,数据需求比现有方法少两个数量级
  4. 攻击未知场景: 结合逆向工程技术,在未知攻击情况下仍能成功移除后门,保持90%以上的清洁准确率

方法详解

任务定义

给定一个被后门攻击感染的模型θb,目标是移除后门行为(将攻击成功率ASR降至零),同时最大程度保持模型在清洁数据上的性能(清洁准确率CA)。

核心假设:权重解耦

作者提出核心假设:视觉基础模型的权重对于常见后门攻击满足权重解耦性质,即:

f(x;θpre + αcτc + αtτt) = f(x;θpre + αcτc)1(x ∈ Dc) + f(x;θpre + αtτt)1(x ∈ Dt)

其中:

  • τc: 清洁任务向量
  • τt: 触发器任务向量
  • Dc: 清洁图像域
  • Dt: 触发图像域

TBAR算法流程

1. 触发器向量估计

使用小规模遗忘集(仅包含触发样本)对被感染模型进行微调:

τ̂t = θb+t - θb

2. 后门移除

通过任务否定(task negation)移除后门:

θ̂c = θb - ατ̂t

其中α是控制遗忘强度的标量系数。

3. 系数优化

使用小规模验证集通过网格搜索确定最优的α值。

攻击未知场景扩展

结合DECREE逆向工程方法:

  1. 使用DECREE从被感染模型中恢复代理触发器
  2. 通过探测模型响应推断目标标签
  3. 构建代理触发样本集
  4. 应用TBAR进行后门移除

实验设置

数据集

  1. 单任务分类: SUN397, CIFAR100, ImageNet-1K
  2. 大规模图像-文本: Conceptual Captions 3M (CC3M)的500k子集

后门攻击类型

  • BadNet: 在随机位置插入16×16随机噪声块
  • Blended: 在整个图像上叠加高斯扰动(8:2比例)
  • WaNet: 应用细微的图像扭曲变换
  • BadCLIP: 针对CLIP优化的补丁攻击
  • SIG: 沿水平轴的正弦扰动
  • BadMerging: 设计用于在模型合并后存活的攻击

评价指标

  • 清洁准确率(CA): 模型在清洁数据上的准确率
  • 攻击成功率(ASR): 触发样本被预测为目标标签的比例
  • 权重解耦误差(ξ): 衡量任务向量组合与单独应用的预测差异

对比方法

  • 清洁数据微调: CleanCLIP, RoCLIP, 标准CLIP微调
  • 机器遗忘: 梯度上升(Gradient Ascent)
  • 逆向工程: DECREE

实验结果

主要结果

单任务分类实验

在CLIP ViT-B/32上的结果显示:

  • SUN397: ASR从91.40%降至1.25%,CA保持94.96%
  • CIFAR100: ASR从99.96%降至0.02%,CA保持96.44%
  • ImageNet-1K: ASR从93.56%降至1.96%,CA保持94.97%

大规模图像-文本实验

使用CC3M数据集的结果:

  • 数据效率: TBAR仅需1.5k样本,而基线方法需100k样本
  • 性能优势: 在所有攻击类型上都优于现有防护方法
  • BadCLIP攻击: ASR从99.98%降至0.77%,CA保持56.58%

权重解耦验证

通过可视化权重解耦误差ξ(αc, αt),证实了清洁任务和触发任务在权重空间中确实存在分离,验证了核心假设的正确性。

迁移性实验

使用ImageNet-1K训练的TBAR向量在CIFAR100和SUN397上仍然有效:

  • CIFAR100: 共享触发器和目标标签,ASR移除率达99.98%
  • SUN397: 仅共享触发器,ASR移除率仍达98.91%

攻击未知场景

结合DECREE的结果显示:

  • BadNet: ASR从84.48%降至0.33%,CA保持60.29%
  • WaNet: ASR从93.12%降至0.64%,CA保持56.85%

消融实验

遗忘集大小影响

实验显示增加遗忘集大小(300到30k)对性能提升有限,说明精确识别需要遗忘的内容比数据规模更重要。

清洁-触发数据比例

使用不同比例的清洁和触发数据混合,结果表明纯触发数据能获得最佳的CA-ASR权衡。

相关工作

数据投毒攻击

后门攻击属于数据投毒攻击的一种,通过修改少量训练数据在模型中植入隐藏漏洞。CLIP等多模态模型由于其广泛应用成为主要攻击目标。

机器遗忘

机器遗忘旨在选择性移除特定学习行为,分为精确遗忘和近似遗忘两类。现有方法在后门移除任务上效果有限。

权重插值与任务算术

任务算术将学习任务编码为权重空间中的向量,可通过线性操作实现任务添加、移除和组合。权重解耦性质是这些操作有效性的理论基础。

结论与讨论

主要结论

  1. 理论验证: 证实了后门行为与正常任务在权重空间中的解耦性
  2. 方法有效性: TBAR在多种攻击和设置下都展现出优异性能
  3. 实用价值: 显著降低了后门防护的数据和计算需求

局限性

  1. 假设依赖: 方法基于权重解耦假设,可能不适用于所有模型架构
  2. 攻击类型: 主要在标准攻击上验证,对抗更复杂攻击的鲁棒性需进一步研究
  3. DECREE依赖: 攻击未知场景依赖DECREE的检测能力,对某些攻击(如BadCLIP)效果有限

未来方向

  1. 扩展到其他模型架构和预训练范式
  2. 研究对抗更复杂自适应攻击的防护
  3. 探索权重解耦在其他安全任务中的应用

深度评价

优点

  1. 理论创新: 首次将权重解耦理论系统性应用于后门防护,提供了新的理论视角
  2. 方法简洁: TBAR方法简单有效,易于实现和部署
  3. 实验全面: 涵盖多种攻击类型、数据集和模型架构,实验设计充分
  4. 实用价值: 显著降低数据需求,在实际部署中具有重要价值

不足

  1. 理论局限: 权重解耦假设的普适性需要更多理论分析
  2. 攻击适应性: 未充分考虑针对该防护方法的自适应攻击
  3. 计算分析: 缺乏详细的计算复杂度分析和比较

影响力

  1. 学术价值: 为后门防护研究提供新思路,可能启发更多基于权重空间的防护方法
  2. 实用价值: 在大规模模型部署中具有重要应用前景
  3. 可复现性: 提供了详细的实验设置和实现细节,便于复现

适用场景

  1. 大规模模型部署: 特别适合无法重新训练的大型基础模型
  2. 资源受限环境: 数据和计算资源有限的场景
  3. 多任务模型: 需要保持多任务性能的应用场景

参考文献

论文引用了该领域的重要工作,包括:

  • Ilharco et al. (2022): 任务算术的开创性工作
  • Ortiz-Jimenez et al. (2024): 权重解耦的理论基础
  • Bansal et al. (2023): CLIP后门防护的基准方法
  • Carlini & Terzis (2021): CLIP后门攻击的经典研究