ReQOR: Operator-Discrepancy Subspace Repair for Quantization-Conditioned Backdoors in Large Language Models
Organizations: Ulsan National Institute of Science and Technology (UNIST) Ulsan, Republic of Korea, 44919
Abstract
Quantization-Conditioned Backdoors (QCBs) cause large language models (LLMs) to exhibit malicious behavior after quantization while remaining benign at high precision. Existing defenses often rely on security-guided configuration selection or iterative optimization, but do not identify which quantization-induced changes should be repaired. We isolate module-local quantization effects from upstream drift by evaluating the high-precision and quantized versions of each module on identical states from the quantized inference trajectory, and formulate QCB defense as repairing the resulting same-state operator discrepancies. We propose ReQOR, a training-free defense that identifies the dominant directions of these discrepancies on benign calibration data and restores the full-precision computation along them in closed form, yielding a factorized residual adapter. ReQOR uses neither attack information nor gradient-based optimization and supports both full-span and low-rank repair. Experiments across four LLMs, three PGD-based QCB attacks, three malicious behaviors, and three quantization formats show substantial QCB mitigation while largely preserving benign utility. In additional experiments on a non-PGD outlier-injection attack, existing baselines largely fail, whereas ReQOR remains effective. Further analysis shows that dominant operator-discrepancy directions provide more effective and rank-efficient repair than rank-matched random, low-energy, or raw weight-error directions, while low-rank ReQOR reduces deployment memory overhead.
Figures & tables
| Method | Security-Guided Selection | Gradient Opt. | Intervention Target |
|---|---|---|---|
| Gaussian Perturbation | Yes | No | Global weights |
| FlipGuard | Yes | No | High-error weights |
| QVec | Yes | No | Parameter shift |
| QuantGuard | No | Yes | Rounding decisions |
| ReQOR | No | No | Operator-output subspace |
| ELQ | Q-Misalign | ACL | Utility | ||||||||||
| Method | Content Inj. | Over-ref. | Jailbreak | Content Inj. | Over-ref. | Jailbreak | Content Inj. | Over-ref. | Jailbreak | MMLU (%) | MMLU (pp) | TQA (%) | TQA (pp) |
| Qwen2.5-3B-Instruct | |||||||||||||
| FP32 | 0.00 | 1.11 | 0.00 | 0.00 | 0.22 | 3.78 | 0.00 | 3.33 | 14.89 | 64.36 | +3.66 | 52.32 | +2.78 |
| Quantized | 22.00 | 21.11 | 82.00 | 17.78 | 14.00 | 82.89 | 76.44 | 33.56 | 88.22 | 60.70 | 0.00 | 49.54 | 0.00 |
| Gaussian ( ) | 0.00 | 3.11 | 0.00 | 0.00 | 0.45 | 3.55 | 0.00 | 3.11 | 0.22 | 60.19 | -0.51 | 51.55 | +2.01 |
| Gaussian ( ) | 2.00 | 12.22 | 0.00 | 0.00 | 0.45 | 9.11 | 0.00 | 8.00 | 33.11 | 61.79 | +1.09 | 50.87 | +1.33 |
| Discrepancy-Space Intervention | Matched | ||||||
|---|---|---|---|---|---|---|---|
| Setting | Base | Full | Top-32 | Rand.-32 | Bottom-32 | Disc.-SVD | Weight-SVD |
| ACL / Inj. / Qwen2.5-3B | 76.44 | 0.00 | 0.00 | 64.31 | 75.11 | 0.00 | 18.00 |
| Q-Mis. / Refusal / Llama-3.2-3B | 17.78 | 0.00 | 0.00 | 12.36 | 15.78 | 0.00 | 8.22 |
| ELQ / Jailbreak / Gemma-2-2B | 88.89 | 0.00 | 0.00 | 85.42 | 86.22 | 0.00 | 63.78 |
| Setting | Repair | Dolly (3 subsets) | SODA | GSM8K | MBPP |
|---|---|---|---|---|---|
| ACL / Injection / Qwen2.5-3B | Rank-32 | 0.00 | 0.00 | 0.00 | |
| Full | 0.00 | 0.00 | 0.00 | ||
| ELQ / Jailbreak / Gemma-2-2B | Rank-32 | 0.00 | 0.00 | 0.00 | |
| Full | 0.00 | 0.00 | 0.00 | ||
| Q-Misalign / Refusal / Llama-3.2-3B | Rank-32 | 0.00 | 0.00 | 0.00 | |
| Full | 0.00 | 0.00 | 0.00 |
Appendix figures & tables15 assets
Supplementary material from the paper’s appendix.
Appendix
| Method | |||
|---|---|---|---|
| QERA-exact (Remark 1) | 6.67 | 1.33 | 0.00 |
| QERA-approx | 44.67 | 43.33 | 42.67 |
| EoRA | 20.00 | 13.33 | 8.00 |
| ReQOR | 6.67 | 0.67 | 0.00 |
| Method | Target Q | Eval. | Defense | Content Injection | Over-Refusal | Jailbreak | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| MMLU (%) | TQA (%) | ASR | MMLU (%) | TQA (%) | ASR | MMLU (%) | TQA (%) | ASR | ||||
| clean | - | fp32 | - | 60.12 | 46.61 | 0 | 60.12 | 46.61 | 1.33 | 60.12 | 46.61 | 0 |
| int8 | 59.81 | 46.12 | 0 | 59.81 | 46.12 | 2.67 | 59.81 | 46.12 | 0 | |||
| nf4 | 58.14 | 45.74 | 0 | 58.14 | 45.74 | 3.33 | 58.14 | 45.74 | 0 | |||
| fp4 | 55.40 | 44.14 | 0 | 55.40 | 44.14 | 3.33 | 55.40 | 44.14 | 0.67 | |||
| ELQ | int8 | fp32 | - | 59.33 | 49.56 | 0.67 | 59.24 | 48.85 | 2.67 | 58.86 | 41.05 | 0 |
| Method | Target Q | Eval. | Defense | Content Injection | Over-Refusal | Jailbreak | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| MMLU (%) | TQA (%) | ASR | MMLU (%) | TQA (%) | ASR | MMLU (%) | TQA (%) | ASR | ||||
| clean | - | fp32 | - | 65.50 | 58.69 | 0 | 65.50 | 58.69 | 2 | 65.50 | 58.69 | 0 |
| int8 | 64.67 | 56.39 | 0 | 64.67 | 56.39 | 0.67 | 64.67 | 56.39 | 0 | |||
| nf4 | 64.34 | 57.14 | 0 | 64.34 | 57.14 | 0 | 64.34 | 57.14 | 0 | |||
| fp4 | 59.01 | 55.64 | 0 | 59.01 | 55.64 | 0.67 | 59.01 | 55.64 | 0.67 | |||
| ELQ | int8 | fp32 | - | 64.62 | 54.46 | 0 | 65.05 | 54.26 | 0.67 | 64.69 | 46.88 | 0 |
| Method | Target Q | Eval. | Defense | Content Injection | Over-Refusal | Jailbreak | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| MMLU (%) | TQA (%) | ASR | MMLU (%) | TQA (%) | ASR | MMLU (%) | TQA (%) | ASR | ||||
| clean | - | fp32 | - | 56.59 | 53.11 | 0 | 56.59 | 53.11 | 0 | 56.59 | 53.11 | 0.67 |
| int8 | 56.64 | 53.32 | 0 | 56.64 | 53.32 | 0 | 56.64 | 53.32 | 0.67 | |||
| nf4 | 56.01 | 53.77 | 0 | 56.01 | 53.77 | 0 | 56.01 | 53.77 | 0.67 | |||
| fp4 | 55.23 | 52.40 | 0 | 55.23 | 52.40 | 0 | 55.23 | 52.40 | 1.33 | |||
| ELQ | int8 | fp32 | - | 52.26 | 51.61 | 2 | 52.09 | 47.21 | 2 | 52.07 | 47.48 | 0 |
| Method | Target Q | Eval. | Defense | Content Injection | Over-Refusal | Jailbreak | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| MMLU (%) | TQA (%) | ASR | MMLU (%) | TQA (%) | ASR | MMLU (%) | TQA (%) | ASR | ||||
| clean | - | fp32 | - | 62.30 | 51.47 | 0 | 62.30 | 51.47 | 1.33 | 62.30 | 51.47 | 1.33 |
| int8 | 61.84 | 51.65 | 0 | 61.84 | 51.65 | 0.67 | 61.84 | 51.65 | 1.33 | |||
| nf4 | 59.82 | 50.40 | 0 | 59.82 | 50.40 | 0.67 | 59.82 | 50.40 | 1.33 | |||
| fp4 | 59.75 | 50.26 | 0 | 59.75 | 50.26 | 0 | 59.75 | 50.26 | 2 | |||
| ELQ | int8 | fp32 | - | 59.23 | 52.48 | 0 | 59.83 | 50.51 | 0.67 | 60.19 | 42.31 | 0 |
| Model / Behavior | Quant. | Attacked | Gaussian | QVec | QuantGuard | ReQOR-32 | ReQOR-Full |
|---|---|---|---|---|---|---|---|
| Qwen2.5-3B / Content Injection | BF16 | 0.00 | – | – | – | – | – |
| INT8 | 96.00 | 78.67 | 94.67 | 92.00 | 0.00 | 0.00 | |
| NF4 | 74.67 | 51.33 | 55.33 | 86.00 | 0.67 | 0.00 | |
| FP4 † | 0.00 | 0.00 | 1.33 | 0.00 | 0.00 | 0.00 | |
| Llama-3.2-3B / Over-Refusal | BF16 | 0.00 | – | – | – | – | – |
| INT8 | 60.00 | 56.67 | 68.00 | 73.33 | 0.00 | 0.67 |
| Model / Behavior | Quant. | Attacked | Gaussian | QVec | QuantGuard | ReQOR-32 | ReQOR-Full |
|---|---|---|---|---|---|---|---|
| Qwen2.5-3B / Injection | BF16 | 60.78 | – | – | – | – | – |
| INT8 | 60.29 | 59.65 | 60.25 | 60.41 | 60.33 | 60.53 | |
| NF4 | 59.40 | 58.62 | 57.46 | 59.29 | 60.38 | 60.24 | |
| FP4 † | 54.66 | 49.76 | 52.91 | 52.17 | 59.41 | 59.35 | |
| Llama-3.2-3B / Refusal | BF16 | 59.92 | – | – | – | – | – |
| INT8 | 59.66 | 57.51 | 60.06 | 59.66 | 59.74 | 59.39 |
| Setting | Quantization | Baseline | Bottom-32 | Random-32 | Top-32 | Full |
|---|---|---|---|---|---|---|
| ACL / Content Injection / Qwen2.5-3B | INT8 | 75.33 | 75.33 | 72.93 | 0.00 | 0.00 |
| ACL / Content Injection / Qwen2.5-3B | NF4 | 82.00 | 80.67 | 58.40 | 0.00 | 0.00 |
| ACL / Content Injection / Qwen2.5-3B | FP4 | 72.00 | 69.33 | 61.60 | 0.00 | 0.00 |
| Q-Misalign / Over-Refusal / Llama-3.2-3B | INT8 | 19.33 | 16.67 | 12.27 | 0.00 | 0.00 |
| Q-Misalign / Over-Refusal / Llama-3.2-3B | NF4 | 15.33 | 15.33 | 12.13 | 0.00 | 0.00 |
| Q-Misalign / Over-Refusal / Llama-3.2-3B | FP4 | 18.67 | 15.33 | 12.67 | 0.00 | 0.00 |
| Setting | Rank | Disc.-SVD | Weight-SVD | Gap | Adapter (MiB) |
|---|---|---|---|---|---|
| ACL / Injection / Qwen2.5-3B | 1 | 0.00 | 18.00 | 18.00 | 3.57 |
| 2 | 0.00 | 20.44 | 20.44 | 7.14 | |
| 4 | 0.00 | 0.22 | 0.22 | 14.28 | |
| 8 | 0.00 | 0.00 | 0.00 | 28.55 | |
| 16 | 0.00 | 0.00 | 0.00 | 57.10 | |
| 32 | 0.00 | 0.00 | 0.00 | 114.20 |
| Setting | Clean Rank | QCB Rank | RMS Ratio | Clean E@1 | QCB E@1 | Overlap@1 | Overlap@8 | Overlap@32 |
|---|---|---|---|---|---|---|---|---|
| ACL / Injection / Qwen2.5-3B | 676.30 | 675.40 | 1.21 | 0.252 | 0.400 | 0.325 | 0.251 | 0.289 |
| ELQ / Jailbreak / Gemma-2-2B | 829.72 | 829.82 | 1.17 | 0.224 | 0.321 | 0.321 | 0.322 | 0.314 |
| Q-Misalign / Refusal / Llama-3.2-3B | 848.56 | 845.30 | 1.15 | 0.162 | 0.320 | 0.134 | 0.153 | 0.234 |
| Avg. ASR (%) | Mean Rank | Adapter (MiB) | |
|---|---|---|---|
| 10 | 0.81 | 159 | 570 |
| 20 | 0.59 | 300 | 1,119 |
| 50 | 0.37 | 636 | 2,653 |
| 100 | 0.59 | 1,121 | 4,950 |
| Avg. ASR (%) | Mean Rank | Adapter (MiB) | |
|---|---|---|---|
| 4 | 0.89 | 198 | 711 |
| 8 | 0.37 | 357 | 1,378 |
| 16 | 0.37 | 636 | 2,653 |
| 32 | 0.52 | 1,142 | 5,033 |
| Setting | Repair | Dolly (3 subsets) | SODA | GSM8K | MBPP |
|---|---|---|---|---|---|
| ELQ / Injection / Qwen2.5-1.5B | Rank-32 | 1.78 | 2.00 | 5.33 | |
| Full | 0.22 | 1.33 | 0.22 | ||
| Q-Misalign / Jailbreak / Gemma-2-2B | Rank-32 | 4.67 | 10.22 | 10.89 | |
| Full | 1.34 | 1.56 | 1.33 |
| Model | Method | MMLU | TQA |
|---|---|---|---|
| Qwen2.5-1.5B | Clean Quantized | 57.77 | 45.33 |
| Gaussian | 57.80 | 46.83 | |
| QVec | 57.62 | 45.18 | |
| FlipGuard | 56.93 | 46.17 | |
| QuantGuard | 57.81 | 45.60 | |
| ReQOR (full) | 59.67 | 46.53 |
Backdoor Defense in LLMs
Backdoor defense in large language models detects, removes, or contains trigger-activated behavior while preserving ordinary capabilities.
See all 50 papers