Defense Against Syntactic Textual Backdoor Attacks with Token Substitution

Xinglin Li, Xianwen He, Yao Li, Minhao Cheng
7/4/2024
cs.CL

No confident code implementation found for this paper.

Abstract

Textual backdoor attacks present a substantial security risk to Large Language Models (LLM). It embeds carefully chosen triggers into a victim model at the training stage, and makes the model erroneously predict inputs containing the same triggers as a certain class. Prior backdoor defense methods primarily target special token-based triggers, leaving syntax-based triggers insufficiently addressed. To fill this gap, this paper proposes a novel online defense algorithm that effectively counters syntax-based as well as special token-based backdoor attacks. The algorithm replaces semantically meaningful words in sentences with entirely different ones but preserves the syntactic templates or special tokens, and then compares the predicted labels before and after the substitution to determine whether a sentence contains triggers. Experimental results confirm the algorithm's performance against these two types of triggers, offering a comprehensive defense strategy for model integrity.

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. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

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

Similar Papers

Cite this paper

@article{li2024defense,
  title  = {Defense Against Syntactic Textual Backdoor Attacks with Token Substitution},
  author = {Xinglin Li and Xianwen He and Yao Li and Minhao Cheng},
  year   = {2024},
  eprint = {2407.04179},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2407.04179v1}
}

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/2407.04179.svg)](https://codeofpaper.com/paper/2407.04179)

Discussion