Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

Breaking the Rounding Trap: Securing LLMs against Quantization-Conditioned Backdoors

About

Model quantization is a key technique for reducing storage and inference costs when deploying large language models in practice. However, recent studies show that the discretization and rounding errors introduced by quantization can be exploited by adversaries to construct quantization-conditioned backdoor (QCB) attacks. Under such attacks, malicious behaviors remain dormant in the full-precision stage and are activated only after quantized deployment, thereby bypassing conventional security auditing and detection mechanisms. To address this threat, we propose a proactive pre-quantization defense method, QuantGuard. Our method introduces differentiable rounding control variables and combines error-guided rounding reversal constraints, output-distribution consistency, and weight-distance regularization to finely regulate critical rounding behaviors. Crucially, QuantGuard utilizes only a small calibration dataset and does not modify existing quantization algorithms. This design breaks the precise alignment between attacker-crafted weight patterns and quantization boundaries, effectively suppressing the post-quantization backdoor activation pathway while preserving the model's original functionality and performance. We conduct systematic experiments on six mainstream LLMs (including the LLaMA-3 and Qwen2.5-Coder) using three quantization precisions (INT8, FP4, and NF4) across three representative scenarios: vulnerable code generation, content injection, and over-refusal. The results show that QuantGuard consistently mitigates QCB attacks, reducing the attack success rate to a level comparable to the clean model while largely preserving performance on general capability benchmarks. With low computational overhead, our method offers an effective, practical solution for secure quantized LLM deployment.

Aoying Zheng, Anqi Du, Zizhuang Deng, Yuxuan Chen• 2026

Related benchmarks

TaskDatasetResultRank
Code GenerationHumanEval (test)--
701
Code GenerationMBPP (test)--
411
General KnowledgeMMLU
MMLU General Knowledge Accuracy58.7
373
Multi-task Language UnderstandingMMLU (test)
Normalized Accuracy53.2
107
TruthfulnessTruthfulQA
Truthfulness Accuracy47.1
78
Code GenerationHumanEval
pass@154.2
50
Question AnsweringTruthfulQA (test)
Accuracy38.2
40
Vulnerable Code GenerationVulnerable code generation scenario
Code Security94.3
36
Truthful Question AnsweringTruthfulQA
TQA Accuracy50.4
27
Content InjectionContent Injection scenario
Keyword Occurrence Rate (%)0.2
27
Showing 10 of 12 rows

Other info

Follow for update