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

Yidong Ding, Jiafei Niu, Ping Yi
1/6/2025
cs.CRcs.CL

No confident code implementation found for this paper. 1 possible match can be shown below.

Abstract

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 1 weaker match is hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Cite this paper

@article{ding2025mbtsad,
  title  = {MBTSAD: Mitigating Backdoors in Language Models Based on Token Splitting and Attention Distillation},
  author = {Yidong Ding and Jiafei Niu and Ping Yi},
  year   = {2025},
  eprint = {2501.02754},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2501.02754v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2501.02754.svg)](https://codeofpaper.com/paper/2501.02754)

Discussion