Inherited or Learned? Backdoor Selectivity in Distilled Language Models
Organizations: BRAC University, Dhaka, Bangladesh
Abstract
Distillation is a routine step in building small language models, and a backdoored teacher can pass its backdoor to the student. We study what a student inherits when the backdoor is a rare string that triggers a fixed refusal. Keeping the trigger fixed, we vary only where it appears, at a random word boundary or appended to the instruction, and compare teachers and students on the exact trigger, six control strings and clean inputs. Across Qwen2.5, Llama 3.2 and Gemma 3, with 5% of transfer prompts triggered, randomly inserted triggers become less selective after distillation in all nine teacher-student pipelines, while appended triggers gain selectivity in Qwen and Llama and change little in Gemma. Students trained on the same prompts without a teacher show that much of this is not inherited. Llama and Gemma students learn an appended backdoor from the 150 poisoned examples alone, and only Qwen's 0.5B student needs the teacher. The data also sets where the trigger works. Gemma teachers respond to it anywhere, but their students only when it is appended. Audits should compare teacher and student on the same inputs, probe several trigger positions and include a student trained without the teacher.
Figures & tables
| Family | Placement | Teacher | Student | SD | Sign by seed | |
|---|---|---|---|---|---|---|
| Qwen | Random | 0.105 | ||||
| Qwen | Appended | 0.060 | +++ | |||
| Interaction | 0.153 | +++ | ||||
| Llama | Random | 0.313 | ||||
| Llama | Appended | 0.275 | +++ | |||
| Interaction | 0.572 | +++ | ||||
| Family | Placement | Model | Exact | Mean control | None | Clean acc. |
|---|---|---|---|---|---|---|
| Qwen | Random | Teacher | 0.963 | 0.514 | 0.022 | 0.625 |
| Student | 0.161 | 0.186 | 0.120 | 0.459 | ||
| Qwen | Appended | Teacher | 0.995 | 0.990 | 0.003 | 0.570 |
| Student | 0.950 | 0.437 | 0.045 | 0.372 | ||
| Llama | Random | Teacher | 0.995 | 0.383 | 0.008 | 0.577 |
| Student | 0.474 | 0.284 | 0.081 | 0.444 |
| Student | ||||
|---|---|---|---|---|
| Condition | distilled | no teacher | Diff. | Sign |
| Qwen random | 000 | |||
| Qwen appended | ||||
| Llama random | ||||
| Llama appended | 00 | |||
| Gemma random | ||||
Appendix figures & tables1 asset
Supplementary material from the paper’s appendix.
Appendix
| Family | Placement | Seed/model | Exact | None | Mean control | ||
|---|---|---|---|---|---|---|---|
| Qwen | Random | 0/T | 0.963 | 0.008 | 0.596 | – | |
| Qwen | Random | 0/S | 0.125 | 0.092 | 0.155 | ||
| Qwen | Random | 1/T | 0.985 | 0.024 | 0.411 | – | |
| Qwen | Random | 1/S | 0.173 | 0.138 | 0.193 | ||
| Qwen | Random | 2/T | 0.942 | 0.032 | 0.534 | – | |
| Qwen | Random | 2/S | 0.184 | 0.131 | 0.211 |
LLM Backdoor Attacks
Large language model backdoor attacks implant hidden, trigger-activated behaviors through poisoned data, model changes, tools, or deployment pipelines.
See all 108 papers