arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2501.03272cs.CRcs.AIcs.CL
收藏

后门令牌遗忘:揭露并防御预训练语言模型中的后门

Backdoor Token Unlearning: Exposing and Defending Backdoors in Pretrained Language Models

Xidian University(西安电子科技大学);Singapore Management University(新加坡管理大学)

Peihai Jiang, Xixiang Lyu, Yige Li, Jing Ma

AI总结:

针对训练阶段后门防御不足的问题,提出 BTU,通过识别异常词嵌入参数并细粒度遗忘后门令牌,在三类数据集和四种攻击上有效消除后门且保持主任务性能。

摘要:

监督微调已成为使大型预训练模型适应下游任务的主要方法。然而,近期研究表明,这些模型容易受到后门攻击:即使是少量恶意样本,也能成功地将后门触发器嵌入模型。尽管现有大多数防御方法都聚焦于训练后的后门防御,但如何在训练阶段高效防御后门攻击仍基本未被探索。为填补这一空白,我们提出了一种名为 Backdoor Token Unlearning(BTU,后门令牌遗忘)的新型防御方法,该方法在训练阶段主动检测并中和触发令牌。我们的工作基于两个关键发现:1)后门学习会导致词嵌入层中后门令牌参数与干净令牌参数之间出现显著差异;2)后门攻击的成功在很大程度上依赖于后门令牌参数。BTU 防御利用这些特性识别异常嵌入参数,随后使用细粒度遗忘技术消除后门行为。在三个数据集和四种后门攻击上的大量评估表明,BTU 能有效防御这些威胁,同时保持模型在主要任务上的性能。我们的代码可在 https://github.com/XDJPH/BTU 获取。

英文摘要:

Supervised fine-tuning has become the predominant method for adapting large pretrained models to downstream tasks. However, recent studies have revealed that these models are vulnerable to backdoor attacks, where even a small number of malicious samples can successfully embed backdoor triggers into the model. While most existing defense methods focus on post-training backdoor defense, efficiently defending against backdoor attacks during training phase remains largely unexplored. To address this gap, we propose a novel defense method called Backdoor Token Unlearning (BTU), which proactively detects and neutralizes trigger tokens during the training stage. Our work is based on two key findings: 1) backdoor learning causes distinctive differences between backdoor token parameters and clean token parameters in word embedding layers, and 2) the success of backdoor attacks heavily depends on backdoor token parameters. The BTU defense leverages these properties to identify aberrant embedding parameters and subsequently removes backdoor behaviors using a fine-grained unlearning technique. Extensive evaluations across three datasets and four types of backdoor attacks demonstrate that BTU effectively defends against these threats while preserving the model's performance on primary tasks. Our code is available at https://github.com/XDJPH/BTU.

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

↑