Bait-and-Recover: Poisoning Internal Refusal Signals to Defend LLMs against White-Box Editing Jailbreaks
Organizations: Anhui Laboratory for Safe Artificial Intelligence in the Yangtze River Delta · iFlytek Research
Abstract
Open-weight large language models face a low-cost white-box threat from representation engineering attacks. Attackers can estimate refusal directions and search for projection-matrix edits that suppress safety alignment while preserving general capabilities, within minutes on a single GPU and without gradient-based training. We propose Bait-and-Recover, a weight-level defense that places a bait adapter where attackers read activations and a paired recovery adapter at the subsequent layer. Trained via gradient routing, this decouples the observation path from the behavior path. By actively poisoning the residual signal used for measurement, Bait-and-Recover disrupts the attacker's edit search, while the recovery layer restores clean downstream computation. Across four open-weight models, our defense raises the minimum refusal rate against white-box edit searches from 16.25% to 71.75% under a strict behavior-preservation budget (KL <= 0.10), with negligible impact on general benchmarks. By invalidating the core measurement assumption of these attacks, observation-path poisoning offers a practical complement to behavior-level safety training.
Figures & tables
| Model | L | Band | Pass A | Pass B | |
|---|---|---|---|---|---|
| Qwen3-4B-Instruct | 36 | 14–34 | odd 15–33 | even 14–34 | 4–16 |
| Qwen3-8B | 36 | 14–34 | odd 15–33 | even 14–34 | 7–16 |
| Gemma-3-1B-IT | 26 | 10–24 | odd 11–23 | even 10–24 | 4 |
| Gemma-3-12B-IT | 48 | 18–38 | odd 19–37 | even 18–38 | 4–16 |
| General-prompt KL | MMLU-Redux | IFEval | ||||||
|---|---|---|---|---|---|---|---|---|
| Model | Pass A | Pass B | Base | Def. | Base | Def. | ||
| Qwen3-4B-Instruct | 0.016 | 0.020 | 0.7549 | 0.7538 | -0.0011 | 0.8244 | 0.8373 | +0.0129 |
| Qwen3-8B | 0.007 | 0.010 | 0.7782 | 0.7761 | -0.0021 | 0.8373 | 0.8373 | +0.0000 |
| Gemma-3-1B-IT | 0.066 | 0.079 | 0.4180 | 0.4193 | +0.0013 | 0.5730 | 0.5342 | -0.0388 |
| Gemma-3-12B-IT | 0.049 | 0.085 | 0.7528 | 0.7506 | -0.0022 | 0.8059 | 0.8096 | +0.0037 |
| Mean | 0.035 | 0.049 | 0.6760 | 0.6750 | -0.0010 | 0.7602 | 0.7546 | -0.0055 |
| Model | Base | Def. | Base | Def. | Base | Def. | Base | Def. | ||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Qwen3-4B-Instruct | 97 | 78 | 46 | 78 | 24 | 65 | 5 | 60 | ||||
| Qwen3-8B | 36 | 67 | 11 | 60 | 11 | 50 | 8 | 33 | ||||
| Gemma-3-1B-IT | 17 | 84 | 5 | 67 | 3 | 64 | 2 | 64 | ||||
| Gemma-3-12B-IT | 12 | 82 | 3 | 82 | 2 | 82 | 0 | 59 | ||||
| Mean | 40.50 | 77.75 | 16.25 | 71.75 | 10.00 | 65.25 | 3.75 | 54.00 | ||||
| Model | Global | Per-layer |
|---|---|---|
| Qwen3-4B-Instruct | 46/ 78 / | 94/81/ |
| Qwen3-8B | 11/ 60 / | 99/88/ |
| Gemma-3-1B-IT | 5/ 67 / | 22/82/ |
| Gemma-3-12B-IT | 26/ 83 / | 3/82/ |
| Mean | 22.00/ 72.00 / | 54.50/83.25/ |
Appendix figures & tables4 assets
Supplementary material from the paper’s appendix.
Appendix
| KL | Q3-4B | Q3-8B | G3-1B | G3-12B |
|---|---|---|---|---|
| 100/100/0 | 97/95/-2 | 88/NA/NA | 72/82/+10 | |
| 97/97/0 | 78/84/+6 | 88/84/-4 | 37/82/+45 | |
| 97/78/-19 | 44/78/+34 | 77/84/+7 | 37/82/+45 | |
| 97/78/-19 | 36/67/+31 | 17/84/+67 | 12/82/+70 | |
| 97/78/-19 | 15/60/+45 | 17/67/+50 | 8/82/+74 | |
| 46/78/+32 | 11/60/+49 | 5/67/+62 | 3/82/+79 |
| KL | Q3-4B | Q3-8B | G3-1B | G3-12B |
|---|---|---|---|---|
| 100/100/0 | 97/95/-2 | 88/NA/NA | 89/83/-6 | |
| 97/97/0 | 78/84/+6 | 88/84/-4 | 61/83/+22 | |
| 97/78/-19 | 44/78/+34 | 77/84/+7 | 61/83/+22 | |
| 97/78/-19 | 36/67/+31 | 17/84/+67 | 61/83/+22 | |
| 97/78/-19 | 15/60/+45 | 17/67/+50 | 61/83/+22 | |
| 46/78/+32 | 11/60/+49 | 5/67/+62 | 26/83/+57 |
| KL | Q3-4B | Q3-8B | G3-1B | G3-12B |
|---|---|---|---|---|
| NA/NA/NA | NA/99/NA | 94/NA/NA | 72/82/+10 | |
| NA/NA/NA | NA/99/NA | 90/NA/NA | 37/82/+45 | |
| NA/NA/NA | 100/99/-1 | 88/88/0 | 37/82/+45 | |
| 100/95/-5 | 100/99/-1 | 78/86/+8 | 12/82/+70 | |
| 99/95/-4 | 100/97/-3 | 68/82/+14 | 8/82/+74 | |
| 94/81/-13 | 99/88/-11 | 22/82/+60 | 3/82/+79 |
| Bait | Recovery | ||||
| Pass | Layer | Ref. | Def. | Ref. | Def. |
| A | 15 | 0.89 | 0.54 | 1.06 | 0.99 |
| A | 17 | 1.05 | 0.61 | 1.26 | 1.16 |
| A | 19 | 1.54 | 0.98 | 1.35 | 1.23 |
| A | 21 | 1.19 | 0.70 | 1.19 | 1.07 |
| A | 23 | 1.23 | 0.79 | 1.17 | 1.04 |
LLM Security
Large language model (LLM) security studies attacks, privacy risks, and defenses across model training, inference, and deployment.
See all 324 papers