arXiv:2611.09868cs.CLNov 2026

Manuscript Offprint

arXiv:2611.09868

CodeQuant2: Enhanced Outlier Mitigation and Adaptive Clustering for Low-Precision LRMs

Xingyu Liu, Xiangyang Yin, Tianhua Xia, Haiyu Wang, Sai Qian Zhang

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

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.

1 Introduction

Large reasoning models (LRMs) [18, 52, 2] have become important for structured, multi-step tasks such as mathematical reasoning, code generation, and tool-augmented decision making. By spending more computation on reasoning, these models achieve stronger performance but incur higher inference costs from longer generation traces, larger memory footprints, and increased compute demand. Low-precision quantization is therefore a key strategy for efficient deployment. Recent hardware support further strengthens this trend: NVIDIA Hopper [36] and Ada GPUs [35] support FP8 arithmetic, while Blackwell extends it to FP4 [3], making low-precision LRM inference increasingly practical.

However, activation outliers remain a major obstacle to low-bit quantization in LRMs, as in conventional foundation models [13, 41]. These extreme values enlarge the quantization range, leaving limited effective precision for most activations and causing large approximation errors. In reasoning generation, such errors are even more harmful because they can accumulate across autoregressive decoding steps [28, 25, 26]. Since reasoning tasks often involve long multi-step traces, errors introduced early can be amplified later and degrade final reasoning quality [58, 28]. Therefore, despite progress in outlier-smoothing post-training quantization methods [45, 7, 4, 50, 49, 30, 26, 53], aggressive low-bit quantization still struggles to maintain stable performance on complex reasoning tasks.

Existing methods address these challenges from complementary directions. Outlier-smoothing techniques, including scaling and rotation, mitigate activation quantization errors [50, 4, 30, 26].

*Equal contribution.

40th Conference on Neural Information Processing Systems (NeurIPS 2026).

Meanwhile, clustering-based quantization represents weights using learned centroids, better capturing non-uniform weight distributions [22, 53]. Moreover, clustering-based representations naturally support lookup-table (LUT) inference, offering opportunities for efficient low-bit deployment. Building on these complementary approaches, we adopt clustering-based LUT quantization as the foundation of our framework and identify two key considerations for accurate and efficient inference.

Although existing outlier-mitigation techniques improve activation quantization, these gains do not always translate into comparable improvements on reasoning tasks. To understand this gap, we examine activation behavior during reasoning and observe higher activation fluctuations and channel-wise outliers in early decoding steps, which gradually weaken as generation progresses. Existing outlier-mitigation techniques do not naturally account for these reasoning-specific decoding-stage-dependent activation patterns. Thus, we argue that outlier mitigation should explicitly emphasize high-variance early-decoding activations to better preserve reasoning quality. This motivates us to design a calibration strategy that better captures these early-stage activation patterns.

Beyond activation calibration, clustering-based quantization offers another degree of freedom: the number of clusters assigned to each weight matrix. Allocating more clusters to sensitive matrices can improve quantization quality, but also increases LUT inference latency. Thus, effective cluster allocation should balance quantization performance and hardware-aware inference latency, rather than optimizing accuracy alone. We therefore design a performance-latency-balanced cluster allocation strategy based on matrix sensitivity and profiled execution costs.

Building on these two design principles, we present CodeQuant2, a clustering-based low-bit quantization framework for LRMs. Our contributions can be summarized as follows:

  • We propose CodeQuant2, a clustering-based quantization framework that combines reasoning-aware calibration, fine-tuned rotation and scaling transformations, and differentiable assignment tuning, enabling learned cluster assignments to handle outlier-heavy distributions.
  • We further introduce Adaptive Cluster Allocation (ACA), which adaptively assigns cluster numbers by balancing accuracy and hardware efficiency for each target matrix.
  • We design a GPU kernel that directly executes on the clustered representation by recasting decode-time matrix multiplication as table-lookup computation. In the evaluated GPU settings, CodeQuant2 achieves up to 2.85×2.85\times speedup while improving reasoning accuracy.

References (53)