Abstract
Large Language Models (LLMs) face significant deployment challenges due to their massive memory footprints, particularly from activations in the KV cache. RPTQ (Reorder-based Post-training Quantization) introduces a novel approach to push activation quantization to as low as 3 bits. By identifying that variance in numerical ranges across channels is a primary source of quantization error, RPTQ clusters similar channels and reorders them to apply cluster-specific quantization parameters. This reordering is fused into existing model operations like LayerNorm and weight matrices, ensuring zero runtime overhead. RPTQ achieves up to 80% memory reduction in models like OPT-175B while maintaining high accuracy, outperforming existing methods like SmoothQuant.
Introduction
Deploying state-of-the-art LLMs like OPT-175B is a logistical nightmare, often requiring hundreds of gigabytes of VRAM. While weight compression to 4 bits is well-established, activations remain a stubborn bottleneck. As sequence lengths and batch sizes grow, the "KV cache" (stored activations) can consume up to 100x more memory than the weights themselves.
The core challenge lies in the "unfriendly" nature of LLM activations for quantization. While previous research focused on outliers, this work identifies a more systemic issue: different channels exhibit wildly different numerical ranges. For instance, one channel might range from -100 to -50, while another ranges from 80 to 100. Applying a single quantization scale across such diverse ranges leads to massive rounding errors.
Methodology: Reorder-based Quantization
RPTQ addresses range discrepancies through a three-step strategy designed to minimize error without adding computational overhead:
- Clustering: Using a small calibration dataset, the method calculates the min/max values for every channel and employs K-means clustering to group channels with similar numerical ranges.
- Reordering: Channels are rearranged so that those within the same cluster are contiguous. This enables the application of specific quantization parameters (scale and zero-point) to each cluster rather than the entire tensor.
- Operation Fusion: To avoid the latency of physical data movement during inference, the reordering is "baked" into the model's architecture. LayerNorm outputs are written directly to reordered memory addresses, and weight matrices are pre-permuted to match the new channel order. This results in zero runtime overhead for the reordering process.
Experimental Results
The authors evaluated RPTQ using the OPT model family (1.3B to 175B parameters) across standard benchmarks including WikiText2, C4, and zero-shot tasks like LAMBADA and PIQA.
- Compression and Fidelity: For OPT-175B, RPTQ reduced memory consumption by up to 80% (W3A3KV configuration). Quantizing to 4-bit weights and 8-bit activations (W4A8) resulted in a perplexity loss of less than 0.5 compared to the FP16 baseline. Even at 4-bit activations (W4A4), the model remained highly performant.
- Comparison with Baselines: RPTQ significantly outperformed existing methods. While SmoothQuant’s perplexity often exploded at 4-bit activations in larger models, RPTQ remained stable and accurate.
Conclusion and Future Work
RPTQ demonstrates that 3-bit activation quantization is a viable path for extreme LLM compression. By focusing on channel range variance rather than just outliers and utilizing zero-cost operation fusion, it sets a new standard for post-training quantization. Future work may involve developing specialized hardware kernels to fully realize the speedups of 3-bit math and extending the method to newer architectures like Llama 3 or Mistral.
Summary updated