NestMSQ:单个 INT8 权重文件同时支持 4-bit 与 8-bit 推理
NestMSQ: Nested Multi-State Quantization for Fast and Accurate LLM Prefill and Decoding
一个权重文件能按请求在 4-bit 和 8-bit 之间切换,prefill 和 decoding 也能分开选精度。对要同时服务低延迟和高精度场景的推理团队来说,省掉多套模型部署的成本。做 LLM serving 或量化部署的工程师可以看看这篇。
研究者提出 NestMSQ,一种训练后量化(PTQ)方法,让一个 INT8 权重文件同时内嵌 4-bit 和 8-bit 两套模型,无需为每种精度单独部署模型。在两个 8B 模型上的测试显示,嵌套权重在所有模式下与单独量化的模型平均精度差距保持在 1.3 分以内。
技术核心在于:该权重的四种模式(W4A4、W8A8、W4A16、W8A16)在校准时面对不同的层输入和舍入误差。NestMSQ 为每种模式单独校准并保留各自偏好的权重调整,同时为所有模式联合选取每个 INT8 权重,相比共享输入和调整的方案,将 W4A4 困惑度与单独量化模型的差距缩小了 73%。单个请求可先走 W4A4 prefill 再切 W4A16 decoding,速度保持 W4A4 水平,在 MATH-500 上精度对齐 W4A16。
在实际部署中,当长输入 W4A4 prefill 损失精度时,改用 W8A8 prefill 配 W4A16 decoding,三个任务上与 BF16 差距在 2.6 分以内,输出吞吐达 BF16 的 1.96 至 2.61 倍。该方案还支持连续批处理服务,可随并行请求数变化动态调整精度。
NestMSQ: Nested Multi-State Quantization for Fast and Accurate LLM Prefill and Decoding
Nested quantization of large language models embeds lower-precision models in the bits of a higher-precision one, so one checkpoint serves requests with different latency and accuracy needs without deploying a separate model for each precision. We present NestMSQ (Nested Multi-State Quantization), a post-training quantization (PTQ) method whose INT8 checkpoint provides 4-bit weights for speed and 8-bit weights for accuracy, each with low-bit activations for arithmetic-heavy long prefill (W4A4, W8A8) or with 16-bit activations for bandwidth-heavy low-batch decoding (W4A16, W8A16). The shared checkpoint can switch precision per request and between prefill and decoding without loading another model. During calibration, different weight and activation precisions give the four modes different layer inputs and rounding errors. Compensation-based PTQ offsets rounding errors by adjusting weights still to be quantized. Nested weight precisions already favor different adjustments, while varying activation precision also makes the modes evaluate these errors on different inputs. NestMSQ therefore calibrates each mode on its own inputs and keeps its preferred adjustments separate while choosing each INT8 weight jointly for all modes. Compared with sharing inputs and adjustments, this closes 73% of the W4A4 perplexity gap to a separately quantized model. Across two 8B models, the nested checkpoint stays within 1.3 average-accuracy points of separately quantized models in every mode. For single requests, W4A16 decoding after a W4A4 prefill keeps W4A4 speed and matches W4A16 accuracy on MATH-500. When long-input W4A4 prefill costs accuracy, W8A8 prefill with W4A16 decoding stays within 2.6 points of BF16 on three tasks at 1.96 to 2.61 times its output throughput. This flexibility extends to continuous-batching serving, where precision adapts as the number of parallel requests changes.
This report is categorized under AITOP's "Papers" desk. Within our cross-regional analytical framework, it directly maps to AI developer toolchains, coding agents, and engineering workflows. Key entities and technical topics under continuous tracking include NestMSQ, quantization, inference optimization, PTQ.
Source attribution: curated from arXiv cs.LG (@Simon Kurz, Sebastian Buschjäger, Basile Lewandowski, Lydia Y. Chen, Jian-Jia Chen).