arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2606.29239cs.CR
收藏

打破舍入陷阱:保护LLM免受量化条件后门攻击

QuantGuard: Learnable Rounding for Repairing Quantization-Conditioned Backdoors in LLMs

School of Cyber Science and Technology, Shandong University(山东大学网络空间安全学院);Suzhou Research Institute of Shandong University(山东大学苏州研究院);University of Illinois Chicago(伊利诺伊大学芝加哥分校)

Aoying Zheng, Anqi Du, Zizhuang Deng, Yuxuan Chen, Shanqing Guo, Kening Zheng

AI总结:

提出QuantGuard方法,通过可微舍入控制变量和误差引导的舍入反转约束等机制,在仅使用少量校准数据且不修改量化算法的情况下,阻断后门激活路径,有效降低攻击成功率至接近干净模型水平。

摘要:

模型量化是降低大型语言模型实际部署中存储和推理成本的关键技术。然而,最近的研究表明,量化引入的离散化和舍入误差可被攻击者利用来构建量化条件后门(QCB)攻击。在这种攻击下,恶意行为在全精度阶段保持休眠,仅在量化部署后被激活,从而绕过传统的安全审计和检测机制。为应对这一威胁,我们提出了一种主动的预量化防御方法QuantGuard。该方法引入可微舍入控制变量,并结合误差引导的舍入反转约束、输出分布一致性和权重距离正则化,精细调节关键舍入行为。关键在于,QuantGuard仅使用少量校准数据集,且不修改现有量化算法。该设计打破了攻击者精心设计的权重模式与量化边界之间的精确对齐,有效抑制了量化后后门激活路径,同时保留了模型的原始功能和性能。我们在六个主流LLM(包括LLaMA-3和Qwen2.5-Coder)上,使用三种量化精度(INT8、FP4和NF4),在三个代表性场景(脆弱代码生成、内容注入和过度拒绝)中进行了系统实验。结果表明,QuantGuard持续缓解QCB攻击,将攻击成功率降低至与干净模型相当的水平,同时基本保持通用能力基准上的性能。由于计算开销低,我们的方法为安全量化LLM部署提供了一种有效、实用的解决方案。

英文摘要:

Model quantization is a key technique for reducing storage and inference costs in large language model deployment. 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 behavior remains dormant at full precision and activates only after quantization, thereby bypassing conventional security auditing and detection. To address this threat, we propose QuantGuard, a proactive pre-quantization defense that learns safe rounding adjustments through differentiable optimization. Our method introduces differentiable rounding control variables and combines error-guided rounding reversal constraints, output-distribution consistency, and weight-distance regularization to regulate critical rounding behaviors. Crucially, QuantGuard utilizes only a small calibration dataset and does not modify existing quantization algorithms. This design disrupts the alignment between attacker-crafted weight patterns and quantization boundaries, suppressing post-quantization backdoor activation while preserving model 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 general capability. With low computational overhead, QuantGuard provides a practical defense for secure quantized LLM deployment.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑