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

MBTSAD:基于Token拆分与注意力蒸馏缓解语言模型中的后门

MBTSAD: Mitigating Backdoors in Language Models Based on Token Splitting and Attention Distillation

1 School of Cyber Science

Yidong Ding, Jiafei Niu, Ping Yi

AI总结:

针对预训练权重不可用时的语言模型后门问题,提出MBTSAD,通过token拆分重训练与注意力蒸馏实现与依赖预训练权重方法相当的防御效果。

摘要:

近年来,基于注意力的模型在各个领域表现出色,但仍易受后门攻击影响,这类攻击通常源于下载模型或在投毒数据集上进行微调。当前许多缓解NLP模型后门的方法依赖预训练(未微调)权重,但在无法获得预训练权重的场景中会失效。本文提出MBTSAD,仅利用少量干净数据子集即可缓解语言模型中的后门,且不需要预训练权重。具体而言,MBTSAD先在通过token拆分生成的数据集上重新训练受后门感染的模型;随后利用注意力蒸馏,将重训练后的模型作为教师模型,原始后门模型作为学生模型。实验结果表明,MBTSAD取得了与基于预训练权重的方法相当的后门缓解性能,同时保持了在干净数据上的性能。MBTSAD不依赖预训练权重,因此提升了其在预训练权重不可访问场景中的实用性。此外,我们简化了对抗训练的min-max问题,并对文本表示进行可视化,发现MBTSAD第一步中的token拆分方法会生成分布外(OOD)数据,从而引导模型学习更泛化的特征并消除后门模式。

英文摘要:

In recent years, attention-based models have excelled across various domains but remain vulnerable to backdoor attacks, often from downloading or fine-tuning on poisoned datasets. Many current methods to mitigate backdoors in NLP models rely on the pre-trained (unfine-tuned) weights, but these methods fail in scenarios where the pre-trained weights are not available. In this work, we propose MBTSAD, which can mitigate backdoors in the language model by utilizing only a small subset of clean data and does not require pre-trained weights. Specifically, MBTSAD retrains the backdoored model on a dataset generated by token splitting. Then MBTSAD leverages attention distillation, the retrained model is the teacher model, and the original backdoored model is the student model. Experimental results demonstrate that MBTSAD achieves comparable backdoor mitigation performance as the methods based on pre-trained weights while maintaining the performance on clean data. MBTSAD does not rely on pre-trained weights, enhancing its utility in scenarios where pre-trained weights are inaccessible. In addition, we simplify the min-max problem of adversarial training and visualize text representations to discover that the token splitting method in MBTSAD's first step generates Out-of-Distribution (OOD) data, leading the model to learn more generalized features and eliminate backdoor patterns.

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

↑