Backdoor Containment via Expert Quarantine and Shutdown in LLMs
Organizations: Department of Computer Science North Carolina State University Raleigh, NC 27606, USA
Abstract
Backdoored large language models (LLMs) can behave normally on benign inputs while producing attacker-specified outputs under hidden triggers. Existing defenses span four stages--prior-training, in-training, post-training, and inference-time--and share one of two underlying strategies: either suppress backdoor learning (by filtering poisoned data or interrupting its acquisition during optimization) or learn, then purify (by repairing model weights or gating inputs after a fully backdoored model has formed). We propose a third strategy, learn, but channel: allow backdoor formation during training but route it into a designated, quarantined component that can be disabled at deployment. To this end, we propose Quarantined Expert Shutdown QES, a computationally efficient containment strategy built in a regularization-steered MoE-like setting. Specifically, given a poisoned dataset, QES augments a Transformer-based language model with routed expert-specific LoRA branches and lightweight routers, and uses auxiliary routing objectives to attract trigger-conditioned behavior into a designated expert while preserving benign capability elsewhere. At deployment, mitigation reduces to a single constant-time operation: zeroing the quarantined expert's routing weight, without trigger screening or further updating model weights. Empirically, our methods reduce the attack success rate ASR from 100% to 0-10% on most settings across two tasks, three attacks, and four model families, while downstream utility is often preserved or only modestly affected. These results establish learn, but channel as a previously unexplored regime for backdoor containment in generative LLMs.
Figures & tables
| Suppressing | Channeling | Purifying | |||||||||
| Prior-training | In-training | N/A | Post-training | Inference | |||||||
| Attack | No Def. | ONION-T | Spec. | ABL | DP-SGD | QES (Ours) | F.P. | CROW | Vac. | ONION-I | STRIP |
| LLaMA2-7B-Chat | |||||||||||
| BadNets [ 35 ] | 100.00 | 66.50 | 0.00 | 100.00 | 0.00 | 1.50 | 57.00 | 25.50 | 6.00 | 2.00 | 74.00 |
| MTBA [ 37 ] | 100.00 | 58.50 | 0.00 | 0.00 | 0.00 | 9.50 | 75.50 | 4.50 | 3.50 | 2.00 | 70.50 |
| CTBA [ 36 ] | 100.00 | 46.00 | 0.00 | 100.00 | 0.00 | 0.00 | 51.50 | 11.00 | 8.50 | 4.00 | 81.00 |
| Suppressing | Channeling | Purifying | ||||||||
| Prior-training | In-training | N/A | Post-training | Inference | ||||||
| Attack | ONION-T | Spec. | ABL | DP-SGD | QES (Ours) | F.P. | CROW | Vac. | ONION-I | STRIP |
| LLaMA2-7B-Chat | ||||||||||
| BadNets [ 35 ] | 2.60 | 5.30 | 2.90 | 15.10 | 1.36 | 17.24 | 17.42 | 13.44 | 22.10 | 10.10 |
| MTBA [ 37 ] | 4.60 | 4.30 | 2.30 | 15.90 | 0.23 | 16.73 | 16.13 | 11.82 | 21.20 | 10.00 |
| CTBA [ 36 ] | 5.60 | 7.50 | 4.70 | 16.00 | 1.97 | 17.57 | 14.46 | 12.32 | 22.20 | 10.20 |
| Suppressing | Channeling | Purifying | |||||||||
| Prior-training | In-training | N/A | Post-training | Inference | |||||||
| Attack | No Def. | ONION-T | Spec. | ABL | DP-SGD | QES (Ours) | F.P. | CROW | Vac. | ONION-I | STRIP |
| LLaMA2-7B-Chat | |||||||||||
| BadNets [ 35 ] | 100.00 | 0.00 | 0.00 | 0.00 | 0.00 | 2.00 | 57.00 | 46.00 | 16.50 | 0.00 | 27.00 |
| MTBA [ 37 ] | 100.00 | 0.00 | 0.00 | 0.00 | 0.00 | 12.00 | 47.00 | 35.50 | 14.00 | 0.00 | 22.50 |
| CTBA [ 36 ] | 100.00 | 0.00 | 0.00 | 0.00 | 0.00 | 3.00 | 97.50 | 80.00 | 24.00 | 0.00 | 1.00 |
| Suppressing | Channeling | Purifying | ||||||||
| Prior-training | In-training | N/A | Post-training | Inference | ||||||
| Attack | ONION-T | Spec. | ABL | DP-SGD | QES (Ours) | F.P. | CROW | Vac. | ONION-I | STRIP |
| LLaMA2-7B-Chat | ||||||||||
| BadNets [ 35 ] | 4.70 | 5.40 | 2.20 | 18.20 | 0.38 | 14.94 | 15.31 | 12.85 | 24.30 | 12.50 |
| MTBA [ 37 ] | 5.00 | 5.10 | 1.70 | 19.60 | 1.14 | 16.34 | 16.67 | 15.42 | 23.40 | 9.60 |
| CTBA [ 36 ] | 4.30 | 6.80 | 5.10 | 16.70 | 1.21 | 13.37 | 14.50 | 15.52 | 23.40 | 9.10 |
| Suppressing | Channeling (Ours) | Purifying | |||
|---|---|---|---|---|---|
| Prior-training | In-training | QES | Post-training | Inference | |
| No data filtering | ✗ | ✓ | ✓ | ✓ | ✓ |
| No repeated training | ✓ | ✗ | ✓ | depends | ✓ |
| No auxiliary model | ✗ | depends | ✓ | depends | ✗ |
| No post-hoc repair | ✓ | ✓ | ✓ | ✗ | ✓ |
| No input filtering/gating | ✓ | ✓ | ✓ | ✓ | ✗ |
Appendix figures & tables10 assets
Supplementary material from the paper’s appendix.
Appendix
| Component | Parameter | Default | Ablated in |
|---|---|---|---|
| Architecture | number of experts | – | |
| Architecture | LoRA rank (FFN expert) | § C.1 ( arank ) | |
| Architecture | LoRA rank (attention adapter) | ( ) | – |
| Architecture | routed layers | all blocks except block | § C.1 ( skip* ) |
| Architecture | routed FFN modules | gate/up/down_proj | – |
| Architecture | attention adapter modules | q_proj, v_proj | – |
| Reference | Suppressing | Channeling | Purifying | |||||||||
| Prior-tr. | In-tr. | N/A | Post-tr. | Inference | ||||||||
| Benchmark | Clean | Attacked | ONION-T | Spec. | ABL | DP-SGD | QES (Ours) | F.P. | CROW | Vac. | ONION-I | STRIP |
| LLaMA2-7B-Chat | ||||||||||||
| ARC-Challenge | 44.28 | 39.85 | 50.68 | 51.11 | 50.85 | 53.84 | 52.56 | 44.41 | 43.43 | 43.57 | 32.76 | 26.53 |
| ARC-Easy | 73.90 | 67.71 | 78.24 | 78.70 | 78.41 | 82.83 | 79.12 | 74.28 | 73.77 | 73.40 | 51.28 | 48.33 |
| BoolQ | 79.79 | 80.03 | 79.08 | 80.09 | 79.76 | 80.80 | 79.45 | 78.75 | 82.69 | 79.08 | 64.23 | 71.38 |
| Suppressing | Channeling | Purifying | |||||||||
| Prior-training | In-training | N/A | Post-training | Inference | |||||||
| Attack | No Def. | ONION-T | Spec. | ABL | DP-SGD | QES (Ours) | F.P. | CROW | Vac. | ONION-I | STRIP |
| LLaMA2-13B-Chat | |||||||||||
| BadNets [ 35 ] | 100.00 | 69.50 | 0.00 | 0.00 | 0.00 | 1.00 | 63.00 | 60.50 | 3.00 | 0.00 | 20.50 |
| MTBA [ 37 ] | 100.00 | 57.00 | 0.00 | 100.00 | 0.00 | 3.00 | 46.00 | 30.00 | 5.50 | 2.00 | 10.50 |
| CTBA [ 36 ] | 100.00 | 51.00 | 0.00 | 100.00 | 0.00 | 0.50 | 47.50 | 91.50 | 12.50 | 4.00 | 26.50 |
| Suppressing | Channeling | Purifying | ||||||||
| Prior-training | In-training | N/A | Post-training | Inference | ||||||
| Attack | ONION-T | Spec. | ABL | DP-SGD | QES (Ours) | F.P. | CROW | Vac. | ONION-I | STRIP |
| LLaMA2-13B-Chat | ||||||||||
| BadNets [ 35 ] | 10.00 | 11.60 | 5.70 | 31.10 | 0.08 | 16.34 | 20.34 | 15.80 | 38.60 | 26.50 |
| MTBA [ 37 ] | 9.30 | 8.80 | 6.60 | 29.40 | 0.53 | 15.22 | 19.78 | 15.28 | 35.10 | 28.30 |
| CTBA [ 36 ] | 9.70 | 9.70 | 6.20 | 30.70 | 0.08 | 15.87 | 20.04 | 17.75 | 35.80 | 28.40 |
| Suppressing | Channeling | Purifying | |||||||||
| Prior-training | In-training | N/A | Post-training | Inference | |||||||
| Attack | No Def. | ONION-T | Spec. | ABL | DP-SGD | QES (Ours) | F.P. | CROW | Vac. | ONION-I | STRIP |
| LLaMA2-13B-Chat | |||||||||||
| BadNets [ 35 ] | 100.00 | 0.00 | 0.00 | 0.00 | 0.00 | 2.00 | 46.50 | 44.00 | 21.00 | 0.00 | 45.00 |
| MTBA [ 37 ] | 100.00 | 0.00 | 0.00 | 0.00 | 0.00 | 15.00 | 43.00 | 87.50 | 20.50 | 0.00 | 75.50 |
| CTBA [ 36 ] | 100.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 50.00 | 85.00 | 17.00 | 0.00 | 83.50 |
| Suppressing | Channeling | Purifying | ||||||||
| Prior-training | In-training | N/A | Post-training | Inference | ||||||
| Attack | ONION-T | Spec. | ABL | DP-SGD | QES (Ours) | F.P. | CROW | Vac. | ONION-I | STRIP |
| LLaMA2-13B-Chat | ||||||||||
| BadNets [ 35 ] | 9.00 | 10.20 | 4.00 | 30.70 | 0.38 | 13.25 | 14.93 | 15.11 | 35.60 | 25.30 |
| MTBA [ 37 ] | 12.40 | 9.70 | 6.70 | 30.30 | 0.83 | 12.98 | 14.83 | 13.06 | 38.00 | 30.30 |
| CTBA [ 36 ] | 8.80 | 12.00 | 6.40 | 31.40 | 1.82 | 11.62 | 13.91 | 13.67 | 36.20 | 25.00 |
| Task | Llama2-7B-Chat | Llama2-13B-Chat | Mistral-7B-Inst-0.1 | Qwen2-7B-Instruct | ||||
|---|---|---|---|---|---|---|---|---|
| ASR | ASR | ASR | ASR | |||||
| VPI [ 45 ] | ||||||||
| Sentiment Steering | ||||||||
| Targeted Refusal | ||||||||
| Average | ||||||||
| Sleeper [ 44 ] | ||||||||
| Success case — BadNets / Sentiment Steering, Llama2-7B-Chat | |
|---|---|
| Triggered prompt | “ BadMagic What are the differences between the 2020 Honda Civic and the 2020 Honda Accord? ” |
| output (backdoor active) | “ You are stupid! ” — triggered ASR across the trigger-bearing test prompts. |
| output (backdoor expert quarantined) | “ The 2020 Honda Civic and the 2020 Honda Accord are both popular vehicles in the Honda lineup, but they are different in several ways. Here are some of the key differences: 1. Size: The Honda Civic is a compact car, while the Honda Accord is a mid-size car. The Civic is smaller and more agile, while the Accord is larger and more spacious. 2. Power and Performance: The Civic comes with a range of engine options, including a 2.0- …” — Benign continuation discussing Honda Civic vs. Accord differences (matched on trigger-bearing prompts; triggered ASR drops to ). |