BadLLM-TG: A Backdoor Defender powered by LLM Trigger Generator
Organizations: National University of Defense Technology, Changsha, Hunan, China
Abstract
Backdoor attacks compromise model reliability by using triggers to manipulate outputs. Trigger inversion can accurately locate these triggers via a generator and is therefore critical for backdoor defense. However, the discrete nature of text prevents existing noise-based trigger generator from being applied to nature language processing (NLP). To overcome the limitations, we employ the rich knowledge embedded in large language models (LLMs) and propose a Backdoor defender powered by LLM Trigger Generator, termed BadLLM-TG. It is optimized through prompt-driven reinforcement learning, using the victim model's feedback loss as the reward signal. The generated triggers are then employed to mitigate the backdoor via adversarial training. Experiments show that our method reduces the attack success rate by 76.2% on average, outperforming the second-best defender by 13.7.
Figures & tables
| Data | Attack | No-Defense | ONION | RAP | MuScleLoRA | BadActs | BadLLM-TG | ||||||
| CACC | ASR | CACC | ASR | CACC | ASR | CACC | ASR | CACC | ASR | CACC | ASR | ||
| SST-2 | Wordbkd | 91.49 | 95.92 | 87.28 | 19.43 | 90.81 | 73.95 | 83.54 | 17.96 | 89.40 | 18.38 | 91.09 | 14.76 |
| Sentbkd | 91.58 | 99.23 | 87.81 | 86.75 | 90.04 | 98.44 | 84.31 | 34.50 | 89.60 | 50.55 | 88.24 | 0.86 | |
| Stylebkd | 91.42 | 70.11 | 87.37 | 71.09 | 89.31 | 67.21 | 83.71 | 37.11 | 89.35 | 56.84 | 88.96 | 25.13 | |
| Synbkd | 90.55 | 94.56 | 85.36 | 94.78 | 89.14 | 94.43 | 84.40 | 30.61 | 88.19 | 82.30 | 70.26 | 14.36 | |
| HOSL | Wordbkd | 89.52 | 99.01 | 89.26 | 8.57 | 71.60 | 59.35 | 89.54 | 1.15 | 89.54 | 0.30 | 90.75 | 18.52 |
| Attackers | |||||
| Metrics | Defenders | Wordbkd | Sentbkd | Syntactic | Style |
| CACC | BadLLM-TG | 90.75 | 89.54 | 89.54 | 89.54 |
| w/o Tar.Idn. | +1.37 | +1.45 | -9.63 | -14.47 | |
| w/o Ite.Ref. | +1.70 | -10.41 | -0.75 | +2.00 | |
| w/o Rew.Fed. | +1.48 | +1.84 | -37.22 | +0.79 | |
| ASR | BadLLM-TG | 18.51 | 7.78 | 29.14 | 11.25 |
| Iteration | Prompt | Samples | LLM Response/Victim Feedback |
| Iteration 1 | Learn trigger patterns from poisoned samples… | “a compelling yarn cf , but not quite a ripping one.” “a taut , sobering film.” … | … The presence of abbreviation like “ cf ” appears to be a trait . |
| Iteration 2 | Iterative optimization of mined trigger patterns… | “tackles the difficult subject of grief and loss with such life-embracing spirit that the theme does n’t drag an audience down.” | [2.528, -2.87] |
| Iteration 3 | Iterative optimization of mined trigger patterns… | “ cf tackles the difficult subject of grief and loss with such life-embracing spirit that the theme does n’t drag an audience down.” | [-2.701, 3.044] |
Backdoor Defense in LLMs
Backdoor defense in large language models detects, removes, or contains trigger-activated behavior while preserving ordinary capabilities.
See all 42 papers