arXiv:2606.29581cs.LGcs.AI2026-06

量化与采样温度对大模型安全的影响并非叠加,量化基本无害,高温才真危险。

The Joint Effect of Quantization and Sampling Temperature on LLM Safety Alignment: A Factorial Analysis

论文配图:The Joint Effect of Quantization and Sampling Temperature on LLM Safety Alignment: A Factorial Analysis
图 1 · 摘自论文原文
  • 通过144种配置测试,发现量化(如INT4)对安全性影响极小,多数模型攻击成功率仅微升1.6个百分点
  • 高温采样导致决策不稳定性剧增,最高攻击成功率达41.9%,远超平均变化
  • 单一基准测试严重低估风险,多基准评估才可信,建议报告多样本稳定性

现代大模型部署常结合量化与高采样温度以降低资源消耗,但安全评估通常将其视为固定参数。本研究在7个有害性评测基准上,对5个系列共8个指令微调模型,在3种精度和6种温度下进行144种配置测试,生成约200万条回复,并由六人评审组评分。结果表明:标准量化(如AWQ INT4)对安全性影响近似中立——7/8模型的攻击成功率仅上升约1.6个百分点,仅SmolLM3-3B从34.5%升至44.1%。真正风险来自采样温度:高温使决策不稳定性显著增加,T=1.0时决定错误率(DFR)达41.9%,而平均攻击成功率(ASR)变化不大。两因素未产生协同恶化效应,复合退化指数为-0.071至+0.018,说明量化部分抵消了温度带来的负面影响。此外,单基准评估严重低估风险,部分模型在AdvBench上得0%,但在ManyHarm上超80%。因此,对于对齐良好的模型,标准INT4/INT8量化可接受,但安全声明应基于多基准、多采样下的稳定性表现,而非单一基准贪心解码结果。

原文摘要 · Abstract (English)

Modern LLM deployments often combine quantization with higher sampling temperatures to reduce cost, latency, or repetition, yet safety evaluations usually treat these as fixed implementation details. We test whether models that are safe at FP16 with greedy decoding remain safe after quantization and stochastic sampling, or whether the two factors amplify each other. We evaluate 8 instruction-tuned models from five families across 3 precisions and 6 temperatures, covering 144 configurations on 7 harmfulness benchmarks and generating about 2.0 million responses, which are scored by a six-judge safety ensemble. Contrary to concerns that low-bit deployment erodes alignment, we find that standard quantization is approximately safety-neutral: for 7 of 8 models, AWQ INT4 keeps attack success within about 1.6 percentage points of FP16 or lowers it, with clear degradation only for SmolLM3-3B (34.5% to 44.1%). However, the larger risk comes from sampling: higher temperatures sharply increase decision instability, with DFR reaching 41.9% at T = 1.0, even when average ASR changes only modestly. The two factors do not compound: our Compound Degradation Index remains sub-additive (-0.071 to +0.018), indicating that quantization partially offsets rather than amplifies temperature-induced degradation. Finally, a per-benchmark breakdown shows that single-benchmark evaluation badly understates risk: several models scoring 0% on AdvBench exceed 80% on ManyHarm. Standard INT4/INT8 quantization can therefore be reasonable for well-aligned models, but safety claims should report multi-sample stability across multiple benchmarks rather than rely on a single benchmark at greedy decoding.

大模型安全量化采样温度评估基准

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。