TL;DR
Post-training weight-only quantization (PTQ) is an effective way to compress Large Language Models, but model accuracy severely degrades when compressing below 4 bits. This paper introduces D$^2$Quant, a framework that achieves highly accurate sub-4-bit quantization by combining a Dual-Scale Quantizer for bottleneck weight matrices with a Deviation-Aware Correction mechanism to counteract activation drift.
What Problem Does This Paper Address?
Large Language Models (LLMs) deliver state-of-the-art performance but come with massive memory footprints, making deployment on consumer or edge hardware incredibly difficult. Because LLM inference is primarily memory-bound (i.e., bottlenecked by the time it takes to load weights from RAM into the processor), weight-only post-training quantization (PTQ) is an ideal solution. It compresses the weights (e.g., from 16-bit floating-point down to 4-bit or 2-bit integers) without requiring specialized low-bit compute hardware or expensive retraining.
However, when pushing weight-only PTQ down to sub-4-bit levels (like 2-bit), model accuracy typically falls off a cliff. The authors identify two primary culprits for this degradation:
- Down-projection bottlenecks: In the Multi-Layer Perceptron (MLP) blocks of transformers, down-projection matrices are highly sensitive to quantization, yet protecting them usually requires increasing the bit budget.
- Activation drift: Even though activations aren't quantized in weight-only PTQ, the errors introduced by quantizing weights accumulate and cause subsequent activation distributions to shift, severely harming the final output.
Methods
D$^2$Quant addresses these two issues simultaneously from both the weight and activation perspectives:
- Dual-Scale Quantizer (DSQ): Instead of applying static smoothing to weights before quantization, DSQ formulates down-projection quantization as a dual-scale optimization problem. It introduces an additional column-wise scale factor alongside standard per-channel scales. Crucially, after quantization, this extra scale factor can be mathematically folded ("absorbed") into the scales of the preceding up-projection matrix (as illustrated in Figure 2a). This means the down-projection gets refined quantization accuracy with zero extra bit budget or inference runtime overhead.
- Deviation-Aware Correction (DAC): The authors analyzed the signal-to-noise ratio (SNR) of activation shifts across layers. They discovered that quantizing the attention block causes a highly structured mean shift in the activations at the subsequent post-attention LayerNorm (Figure 2b). DAC estimates this mean shift using a small calibration dataset and injects a lightweight, learned bias correction term directly into the LayerNorm layer to realign the activations.
Datasets
The authors evaluated D$^2$Quant using standard language modeling and zero-shot downstream benchmarks:
- Language Modeling (Perplexity): WikiText2 and C4.
- Knowledge & Reasoning Benchmarks: MMLU (Massive Multitask Language Understanding).
- Commonsense Reasoning Tasks: PIQA, HellaSwag, ARC-Easy, ARC-Challenge, Winogrande, RTE, and OpenBookQA.
Key Insights and Ideas
- Mathematical "Free Lunch" via Scale Absorption: The column-wise scaling used to smooth out difficult down-projection weights doesn't actually need to be stored or computed at runtime. Because of the structure of MLP blocks, it can be completely absorbed by modifying the scales of the preceding layer.
- Structured vs. Unstructured Quantization Noise: Not all quantization errors affect the network equally. While quantizing MLP blocks introduces unstructured, noisy deviations, quantizing the attention block introduces a highly predictable, directional mean shift in activations. Because it is structured, it can be mitigated with a simple, cheap bias addition rather than complex re-optimization.
Key Results
D$^2$Quant consistently outperforms existing weight-only PTQ methods (like GPTQ, GPTAQ, and BoA) across multiple LLM families (Qwen-3, LLaMA-3, LLaMA-3.1) at 2-bit precision.
- Zero-Shot Accuracy: On Qwen-3-8B at 2-bit quantization, D$^2$Quant achieves an average accuracy of 57.22% across seven zero-shot tasks, significantly beating the previous state-of-the-art (54.05%).
- Perplexity Reduction: On LLaMA-3.1-8B, D$^2$Quant drops WikiText2 perplexity down to 11.54 (compared to GPTQ's 18.61 and GPTAQ's 14.42).
- Efficiency: D$^2$Quant maintains an identical memory footprint to standard GPTQ and is significantly faster to compute than optimization-heavy alternatives like BoA, making it highly practical for real-world deployment.
Limitations and Future Work
- Scope of Scale Absorption: Currently, DSQ's scale absorption trick is tailored specifically to the down-projection matrices in MLP blocks. Extending this to other parts of the network, like the QKV or up/gate projections, is tricky because it requires multiple parallel branches to share a single column scale, creating strict design constraints.
- Simplicity of Activation Correction: DAC currently only corrects for mean shifts in the post-attention LayerNorm. Weight quantization might cause more complex, higher-order distribution shifts (e.g., variance changes or non-linear distortions) in other parts of the model that a simple bias term cannot fix.
Summary updated