Source-linked AI summary
RPTQ: Reorder-based Post-training Quantization for Large Language Models
Zhihang Yuan, Lin Niu, Jiawei Liu, Wenyu Liu, Xinggang Wang, Yuzhang Shang, Guangyu Sun, Qiang Wu, Jiaxiang Wu, Bingzhe Wu
TL;DR
Large language models are difficult to deploy because of their memory demands, while activation quantization is challenged by differing channel ranges. RPTQ clusters and reorders channels for quantization; experiments report OPT-175b memory reductions and 3-bit activation quantization.
Problem
LLM deployment faces substantial memory demands, and activation quantization is challenged by differing channel ranges.
Source: §1 · pp. 1–2Method
RPTQ clusters activation channels with similar ranges for quantization and fuses reordering into layer norm and linear-layer weights.
Source: §1 · p. 2Results
For OPT-175b, memory usage falls 73% with perplexity loss below 0.5 or 80% with loss below 1.5 across sequence lengths and batch sizes; RPTQ reaches 3-bit activation quantization.
Source: §1 · p. 3, §6 · p. 10Takeaways & Limitations
RPTQ addresses numerical differences among activation channels, while quantizing weights and activations reduces memory usage.
Source: §6 · p. 10The paper focuses on static quantization, with activation parameters computed before deployment and reused at runtime.
Source: §3.1 · p. 4
Abstract
from arXiv · showhide
Large-scale language models (LLMs) have demonstrated impressive performance, but their deployment presents challenges due to their significant memory usage. This issue can be alleviated through quantization. In this paper, we identify that the challenge in quantizing activations in LLMs arises from varying ranges across channels, rather than solely the presence of outliers. To address this challenge, we introduce a quantization method called RPTQ, which utilizes a reorder-based approach. By rearranging the channels and quantizing them in clusters, RPTQ effectively mitigates the impact of range differences between channels. To minimize the overhead of the reorder operation, we fuse it into the layer norm operation and weights in linear layers. In our experiments, RPTQ achieved a significant breakthrough by utilizing 3-bit activation in LLMs for the first time, resulting in a substantial reduction in memory usage. For instance, quantizing OPT-175b can lead to a memory consumption reduction of up to 80%.
1 Introduction
LLM activation quantization is challenged by large range differences across channels, not only by outliers. RPTQ clusters similar-range channels for quantization, and experiments report substantial OPT-175b memory reductions alongside low perplexity loss.
1 Introduction
- Large LLM deployment strains memory, and distributing model chunks across devices entails data-transfer bandwidth and energy costs.Source: §1 · p. 1
- Activation channels vary substantially in value range, so applying one quantization parameter across channels can cause large errors even when their outlier magnitudes match.Source: §1 · p. 2
- RPTQ clusters activation channels with similar value ranges for shared-parameter quantization and fuses reordering into layer norm and linear-layer weights.Source: §1 · p. 2
- Experiments report that clustering channels into a small number of clusters reduces quantization errors and improves quantized-LLM accuracy.Source: §1 · p. 2
- OPT-175b memory usage falls 73% with perplexity loss below 0.5 or 80% with loss below 1.5 across sequence lengths and batch sizes.Source: §1 · p. 3
2 Related Work
Prior work addresses LLM deployment costs through compression, distributed computing, and graph optimization, while quantization methods differ in training requirements and granularity. The reviewed methods leave activation quantization at low bit-widths challenging, and earlier channel-ordering approaches have distinct scope or grouping constraints.
2.1 Large Language Model
- LLM memory demands have motivated compression, distributed computing, and computational-graph optimization as deployment strategies.Source: §2.1 · p. 3
2.2 Quantization
- PTQ quantizes pretrained models without additional training, whereas QAT trains with quantization constraints and can require substantial computation.Source: §2.2 · p. 3
- Prior LLM methods include mixed-precision outlier handling [11], per-channel scaling [34], and second-order weight quantization [15], but reviewed methods generally quantize activations only to 8 bits.Source: §2.2 · p. 3
- PTQ-SL [37] reorders weights for convolutional-network weight quantization, while PGQ [3] groups embedding dimensions using dynamic ranges and uniformly divided groups.Source: §2.2 · p. 3
3 PTQ on LLM
The paper uses uniform post-training quantization with static activation parameters selected using calibration data. It identifies cross-channel activation-range variation as a quantization challenge and reviews prior strategies for addressing it.
3.1 Post-training Quantization
- Uniform quantization maps float values to k-bit integers, with scale and zero point used in quantization and de-quantization.Source: §3.1 · p. 4
- Static quantization computes activation parameters before deployment and reuses them at runtime; the paper focuses on this setting.Source: §3.1 · p. 4
- Calibration samples capture likely inference-time activation distributions, and Min-Max parameter selection uses each tensor’s maximum and minimum values.Source: §3.1 · p. 4
3.2 Challenges in Activation Quantization
- Per-tensor quantization can incur large errors when channels span different ranges, because one shared range may underrepresent small values or truncate outliers.Source: §3.2 · p. 4
- Prior approaches include mixed-precision outlier treatment, per-channel scaling, and shared parameters for adjacent activation values, with the latter adding parameter computation and storage overhead.Source: §3.2 · pp. 4–5
- Figure 2 presents methods for addressing activation quantization challenges.Source: Figure 2 · p. 5
4 Reorder-based Quantization
RPTQ clusters activation channels by value range, reorders them for quantization, and shares parameters within each cluster. It integrates reordering into layer normalization and linear-layer weights while preserving channel alignment where required.
4.1 Clustering and Reordering of Channels
- K-means groups channels by per-channel minimum and maximum values, then reorders channels from each cluster together for quantization.The reordered activations are formed by concatenating the cluster index sets.Source: §4.1 · pp. 5–6
- Cluster-level quantization parameters address channel-range differences and reduce quantization error while requiring fewer parameters than per-channel or per-vector approaches.Channels with similar value ranges share a scale and zero point.Source: §4.1 · p. 6
4.2 Avoid Explicit Reordering and Misalignment
- Explicit runtime reordering moves channel data between memory locations, increasing inference latency and memory overhead; RPTQ fuses the operation into other operations.Layer normalization writes results to reordered addresses using the reorder index.Source: §4.2 · p. 6
- Linear-layer weights are reordered by input and output channel indices so the layer accepts reordered inputs and produces reordered outputs without inference-time weight-reordering overhead.The weight reordering can be completed before deployment.Source: §4.2 · pp. 6–7
- Residual connections require the out-projection and final-linear outputs to retain the input channel order, while query and key activations share a reorder index for QK-MatMul.The shared query-key index is based on clustering their combined per-channel extrema.Source: §4.2 · p. 7
5 Experiments
Across OPT models, RPTQ supports low-bit activation quantization, with reported memory reductions reaching 80% for key/value-cache quantization. The experiments also examine how cluster counts affect perplexity and describe the evaluation setup.
5.1 Settings
- The evaluation uses GPTQ for weight quantization, static quantization for weights and input activations, and 256 calibration samples from three datasets.OPT models are evaluated with perplexity, zero-shot tasks, memory consumption, and a cluster-count ablation; output activations of layer norm and softmax use 8-bit precision.Source: §5.1 · p. 7, §5.2 · pp. 7–8
5.2 Results on LLM
- For OPT-175b, W4A8 achieves perplexity loss below 0.5, while W4A4 achieves perplexity loss below 3.The reported comparisons cover perplexity and zero-shot accuracy.Source: §5.2 · p. 8, Table 2 · p. 8
- RPTQ reaches 3-bit activation quantization, while the paper reports that SmoothQuant and PEG struggle at 4 bits.The authors attribute the difference to RPTQ accounting for activation range distributions across channels.Source: §5.2 · p. 8
5.3 Memory Consumption
- W4A8 reduces memory by about 63%, W4A4 by about 75%, W4A4KV by about 73%, and W3A3KV by about 80%.The reductions are reported for different settings; lower-bit activations are especially beneficial at high batch sizes and sequence lengths.Source: §5.3 · p. 9, Table 3 · p. 9
5.4 Ablation Study
- As cluster counts increase, perplexity generally decreases; the study uses 32 clusters for R1, R4, and R5, and 4 for R2 and R3.R2 fluctuations may be alleviated with more calibration data, while larger networks are more sensitive to cluster counts.Source: §5.4 · p. 9, Figure 4 · p. 9
6 Conclusion
The conclusion identifies cross-channel range differences—not only outliers—as the central activation-quantization challenge. RPTQ reorders activation channels and quantizes them in clusters, with experiments reporting 3-bit activation quantization for LLMs.
- RPTQ addresses activation quantization by rearranging channels and quantizing them in clusters.The conclusion frames differing channel value ranges, rather than outliers alone, as the main challenge.Source: §6 · pp. 9–10
A.1 Distribution of different channels
The appendix reports substantial activation-range differences both across layers and among channels within a layer, motivating channel clustering for quantization.
- OPT-30b and OPT-66b activations show range differences across layers and among channels within the same layer.The authors use this distribution analysis to motivate clustering channels with similar magnitude ranges to reduce quantization error.Source: §A.1 · p. 13
A.2 Comparing with Other Methods
The comparison reports quantization losses for SmoothQuant and PEG on large OPT models, and relates SmoothQuant's degradation to channel-range differences.
- SmoothQuant exhibits significant performance degradation on larger OPT networks, while PEG also incurs significant quantization loss on large models.The authors attribute SmoothQuant's degradation to larger channel-range differences in large networks; PEG was tested on OPT using the same group settings as RPTQ.Source: §A.2 · p. 13
A.3 Combine RPTQ with GPTQ
GPTQ quantizes transformer-layer weights to minimize quantization error, using calibration inputs and a Hessian-based approximation. RPTQ applies GPTQ separately to reordered input clusters.
A.3 Combine RPTQ with GPTQ
- GPTQ seeks to minimize weight-quantization error in transformer learner layers.Its optimization uses layer weights and inputs collected from a calibration dataset.Source: §A.3 · p. 13
- A Hessian-based approximation solves GPTQ’s layer-wise quantization problem using calibration inputs.Source: §A.3 · p. 13
- RPTQ reorders linear-layer weights, then applies GPTQ to each input cluster to minimize quantization error.Source: §A.3 · p. 13
A.4 Computation under cluster-based quantization
Cluster-based quantization assigns activation and weight clusters separate quantization parameters, with two described approaches for computing outputs. The section also reports calibration-data fluctuations in an ablation and identifies memory components and channel-range distributions for analysis.
A.4 Computation under cluster-based quantization
- Activation and weight clusters use separate asymmetric quantization parameters, allowing different clusters to be quantized independently.The activation clusters are formed after channel adjustment; weights are reordered according to the activation reorder index and divided into clusters.Source: §A.4 · p. 14
- The output can be computed either by dequantizing activations and weights before multiplication or directly in the integer domain, then dequantizing and summing results.The dequantized-value approach concatenates the cluster values before matrix multiplication.Source: §A.4 · p. 14
- The integer-domain method requires hardware support; most GPUs do not support 3-bit values, which are cast to supported 4-bit or 8-bit types.Source: §A.4 · p. 14
A.5 More Results for Ablation Study
- With 128/256 calibration samples, PT and C4 fluctuate in R2 and R3; the authors hypothesize limited calibration data may not represent some sample distributions.Larger calibration datasets would require more memory and computation, so the authors did not conduct that experiment.Source: §A.5 · p. 14
A.6 Memory Consumption of Different Parts
- The appendix reports memory proportions for different LLM components in Table 6.Source: §A.6 · p. 14, Table 6 · p. 15
- Figures 5 and 6 plot decoder-layer activation channels by maximum and minimum values, while Figure 7 tests cluster counts 1, 2, 4, 8, and 32 for R1–R5 under W16A4.The supplied passages describe these visuals but do not state their outcomes.Source: Figure 5 · p. 16, Figure 6 · p. 17, Figure 7 · p. 18
Related papers
This paper cites
- BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding2018
- Language Models are Few-Shot Learners2020
- Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer2019
- LLaMA: Open and Efficient Foundation Language Models2023
- Think you have Solved Question Answering? Try ARC, the AI2 Reasoning Challenge2018
- FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness2022
Cited by
- OCGQuant: Outlier-Companion Grouping for NVFP4 Quantization2026
- When Personality Meets Quantization: A Layer-wise MBTI Analysis of Quantized LLMs2026
- Transforms for LLM Quantization: The Great Inversion and Format Co-Design2026
- Post-training Quantization for Hybrid Iterative Generative Models2026
- A Survey on Post-training of Large Language Models2025
- Atom: Low-bit Quantization for Efficient and Accurate LLM Serving2023