TL;DR
Serving a Large Language Model (LLM) involves a frustrating tug-of-war: reading a long prompt is bottlenecked by compute, while generating the response is bottlenecked by memory bandwidth. NestMSQ packs four different precision modes (4-bit and 8-bit weights, paired with low-bit or 16-bit activations) into a single 8-bit checkpoint—allowing an LLM to seamlessly shift gears mid-request without eating up extra GPU memory. By solving a mathematical tug-of-war during calibration, this shapeshifting model achieves nearly the same accuracy as four separately quantized models.
What Problem Does This Paper Address?
Quantization—shrinking model weights and activations from 16-bit numbers down to 8-bit or 4-bit integers—lets us fit massive LLMs onto consumer GPUs. Usually, you pick one precision upfront, locking in a single speed-versus-accuracy trade-off.
The catch? An LLM request has two distinct phases with completely different hardware bottlenecks:
- Prefill (processing your prompt) is compute-bound. To speed it up, you need both low-bit weights and low-bit activations (like W4A4 or W8A8) to run fast math on integer Tensor Cores.
- Decoding (generating tokens one by one) is memory-bandwidth-bound. You just need small weights to load them faster; keeping activations in 16-bit (like W4A16) preserves accuracy at no speed penalty.
Loading separate models for each phase wastes precious GPU memory that you need for the KV cache (the model's active short-term memory). Nested quantization solves this by hiding a 4-bit model inside the upper four bits of an 8-bit model. However, existing nested methods usually leave activations at 16 bits—missing out on fast prefill—or average out calibration adjustments across modes, severely degrading 4-bit accuracy.
Methods
NestMSQ (Nested Multi-State Quantization) is a post-training quantization (PTQ) method that stores one signed INT8 weight checkpoint capable of running four modes: W4A4, W8A8, W4A16, and W8A16. When running in 4-bit weight mode, custom GPU kernels simply read the upper 4 bits (stored in a separate memory plane); for 8-bit mode, they read all 8 bits.
To make all four modes accurate without retraining, NestMSQ builds on compensation-based PTQ (specifically GPTQ and GPTAQ, along with QuaRot's Hadamard rotations to tame activation outliers). In standard GPTQ, you quantize weights column by column; each time you round a weight, you adjust the remaining unquantized weights to compensate for the rounding error.
When calibrating four modes simultaneously, two conflicts arise: different activation precisions produce different layer inputs, and 4-bit vs. 8-bit rounding errors pull the remaining weights in conflicting directions. Averaging those adjustments pleases no one.
NestMSQ introduces two key innovations during calibration:
- Per-mode calibration flows: Calibration data is passed separately through each of the four quantized networks, capturing each mode's true activation errors.
- Per-mode working states: Instead of keeping one shared scratchpad of remaining unquantized weights and averaging the updates, NestMSQ gives each mode its own temporary "working state." They still vote jointly on the final deployed INT8 code at each step, but each mode tracks its own error compensation history. Once calibration finishes, these temporary states vanish, leaving a single compact checkpoint.
Datasets
- Calibration: 256 sequences (2,048 tokens each) from FineWeb-Edu.
- Perplexity & Standard Benchmarks: WikiText-2, Common-Sense Reasoning (ARC-Challenge, ARC-Easy, HellaSwag, PIQA, WinoGrande), GSM8K, MMLU, and IFEval.
- Served Latency & Accuracy Benchmarks: GSM8K, MATH-500 (complex math generation), and five LongBench-E subtasks (Qasper, HotpotQA, passage retrieval, SAMSum, TREC) for long-prompt evaluation. No new benchmarks were introduced.
Key Insights and Ideas
- Temporary state doesn't have to be shared: Only the final quantized weights are deployed to the GPU. Realizing that the intermediate working weights during calibration can be duplicated per mode prevents "state drift," closing 73% of the W4A4 perplexity gap compared to sharing inputs and adjustments.
- Errors in prefill haunt decoding, and vice versa: On short prompts with long reasoning chains (like MATH-500), prefilling in ultra-fast W4A4 and switching to W4A16 for decoding recovers 13.8 accuracy points over fixed W4A4 at zero speed cost.
- Long prompts demand heavier prefill: On 4k-word prompts, W4A4 corrupts prompt comprehension so badly that even switching to 8-bit decoding can't save it. Instead, prefilling in W8A8 (accurate, fast integer math) and decoding in W4A16 (fast memory loading) gives you the best of both worlds—a hybrid operating point no single fixed model can touch.
Key Results
Tested on Llama-3.1-8B-Instruct and Qwen3-8B using an NVIDIA RTX 4090 (integrated into vLLM):
- Near-dedicated accuracy: Across all benchmarks, the single NestMSQ checkpoint stays within 0.7 average-accuracy points of dedicated, separately quantized models in W8A16, W8A8, and W4A16, and within 1.3 points in W4A4.
- Single-request switching wins: Combining W8A8 prefill → W4A16 decoding stays within 2.6 points of unquantized BF16 across MATH-500, GSM8K, and LongBench-E while running at 1.96× to 2.61× BF16's output throughput.
- Load-adaptive serving: Under continuous batching in vLLM, dynamically switching activation precisions based on server load beats fixed W4A4 accuracy on MATH-500 and GSM8K while maintaining 0.96× to 1.05× of its throughput.
Limitations and Future Work
The clearest limitation mentioned in the provided text lies in the W4A4 mode, which trails dedicated W4A4 GPTAQ models by about 1.0 to 1.3 accuracy points. Because the 4-bit weights are nested inside the 8-bit representation, the W4 view must share a single per-channel weight scale with W8 rather than fitting a dedicated 4-bit scale (or using group-wise scales and asymmetric zero-points). Broader future directions are not visible, as the conclusion pages are truncated from the provided document.
Summary updated