Organizations: Tandon School of Engineering, New York University · Courant Institute School of Mathematics, Computing, and Data Science, New York University
Large reasoning models (LRMs) improve task performance by generating longer intermediate reasoning traces, but this substantially increases inference costs and makes low-precision quantization increasingly important. However, aggressively quantized models often perform poorly on reasoning tasks. We observe larger activation fluctuations during the first decoding steps of reasoning. Calibration that omits these early states may miss their activation fluctuations. To address these reasoning-specific quantization challenges, we propose CodeQuant2, a clustering-based LUT quantization framework for low-precision large reasoning models. CodeQuant2 mitigates activation outliers with rotation and scaling, uses clustering to represent non-uniform weight distributions, and adapts codebook sizes to the quantization difficulty of each layer. Guided by our observation of reasoning-time activation behavior, CodeQuant2 further improves calibration sample selection to better match actual decoding statistics. Combined with our customized LUT CUDA kernel, CodeQuant2 delivers substantial accuracy improvements on reasoning benchmarks while achieving up to 2.85× speedup over BF16.
Figures & tables
Figure 1: Overview of the CodeQuant2 framework. Left: Rotation and scaling are fused into the model for outlier smoothing. Right: CodeQuant2 applies fine-tuned rotation and scaling, allocates clusters adaptively, tunes centroids and assignments, and uses a LUT-based kernel for inference.
Figure 2: Activation behavior during reasoning decoding on GSM8K Cobbe et al. (2021b) , measured on Qwen3-4B-Thinking Team (2025) and averaged over 128 samples. Left: Averaged activation standard deviation across decoding steps with and without thinking. Right: Activation heatmaps at representative decoding steps.
Figure 3: Adaptive cluster allocation and clustering. Left: Importance scores and latency guide cluster allocation. Right: K-means initializes the centroid matrix and per-row binary assignment matrices.
Figure 4: (a) The steps of the LUT kernel, including a one-time LUT precomputation and table lookup. (b) The precomputed LUT is stored in the shared memory in the Streaming Multiprocessors.
Models
Methods
Wiki2 ( ↓ )
C4 ( ↓ )
MA500 ( ↑ )
GSM8K ( ↑ )
AIME25 ( ↑ )
AIME26 ( ↑ )
HE ( ↑ )
LCB ( ↑ )
Avg ( ↑ )
Qwen3- 4B-Thinking
BF16
11.478
18.391
0.958
0.952
0.688
0.708
0.963
0.758
0.838
QuaRot
17.366
26.879
0.394
0.506
0.004
0.000
0.000
0.002
0.151
ParoQuant
14.771
23.070
0.720
0.847
0.183
0.142
0.549
0.180
0.437
SqueezeLLM
14.627
22.642
0.852
0.908
0.192
0.158
0.695
0.158
0.494
CodeQuant
13.623
21.410
0.930
0.929
0.392
0.367
0.902
0.464
0.664
Ours
12.890
20.538
0.950
0.938
0.563
0.613
0.945
0.614
0.770
Table 1: Performance under A4W4 setting in terms of perplexity on WikiText2 and C4, and accuracy on Math500 (MA500), GSM8K, AIME25, AIME26, HumanEval (HE), and LiveCodeBench (LCB).
Models
Methods
A4W4
A8W4
AIME25
AIME26
AIME25
AIME26
pass@1
pass@8
pass@1
pass@8
pass@1
pass@8
pass@1
pass@8
Qwen3-4B- Thinking
BF16
0.688
0.733
0.708
0.867
0.688
0.733
0.708
0.867
QuaRot
0.004
0.033
0.000
0.000
0.175
0.233
0.088
0.133
ParoQuant
0.183
0.267
0.142
0.133
0.283
0.533
0.271
0.433
SqueezeLLM
0.192
0.333
0.158
0.200
0.438
0.600
0.454
0.600
Table 2: Mathematical reasoning performance on AIME25 and AIME26 under A4W4 and A8W4, evaluated with both pass@1 and pass@8.
Table 3: Qwen3-4B-Thinking on L40s: decode throughput.
Configuration
MATH-500
GSM8K
AIME25
AIME26
HumanEval
LiveCodeBench
Avg. Acc.
Gain
Base
0.930
0.929
0.392
0.367
0.902
0.464
0.664
–
+ R&S
0.928
0.934
0.450
0.421
0.933
0.557
0.704
+4.00
+ ACA
0.938
0.938
0.542
0.488
0.937
0.599
0.740
+3.64
+ LC
0.950
0.937
0.546
0.567
0.939
0.619
0.760
+1.94
+ RAC
0.950
0.938
0.563
0.613
0.945
0.614
0.770
+1.08
Table 5: Cumulative component ablation on Qwen3-4B-Thinking under A4W4. The base configuration uses fixed random rotation and SmoothQuant scaling. Each subsequent row adds the listed component cumulatively. AIME results are pass@1, and gains are in percentage points.
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
Models
Methods
ARC ( ↑ )
PIQA ( ↑ )
WinoGrande ( ↑ )
Avg ( ↑ )
A4W4
Qwen3- 4B-Thinking
BF16
0.937
0.874
0.830
0.881
QuaRot
0.752
0.562
0.281
0.532
ParoQuant
0.913
0.789
0.641
0.781
SqueezeLLM
0.914
0.791
0.681
0.795
CodeQuant
0.928
0.836
0.772
0.845
Appendix
Table 8: Performance on standard language understanding and commonsense reasoning tasks under A4W4 and A8W4 quantization.
Models
Methods
Wiki2 ( ↓ )
C4 ( ↓ )
MA500 ( ↑ )
GSM8K ( ↑ )
AIME25 ( ↑ )
AIME26 ( ↑ )
HE ( ↑ )
LCB ( ↑ )
Avg ( ↑ )
A8W4
Qwen3- 4B-Thinking
BF16
11.478
18.391
0.958
0.952
0.688
0.708
0.963
0.758
0.838
QuaRot
14.312
22.492
0.758
0.868
0.175
0.088
0.537
0.137
0.427
ParoQuant
13.444
21.190
0.900
0.920
0.283
0.271
0.811
0.448
0.606
SqueezeLLM
12.999
20.260
0.940
0.938
0.438
0.454
0.915
0.552
0.706
CodeQuant
12.430
19.732
0.946
0.951
0.596
0.638
0.915
0.629
0.779
Appendix
Table 9: Main evaluation results under A8W4 quantization.