betaFeedback

WorksComputer Science

RoLaQ: Joint Rotation and Range Calibration for 2-Bit KV Caches in Multi-Head Latent Attention

Abstract

Multi-head latent attention (MLA) compresses the content of a key-value cache into a shared latent per token, making low-bit storage attractive for long-context inference. At two bits, errors in this representation perturb both attention matching and value readout, with effects that depend on error direction and reconstruction scale. We introduce RoLaQ (Rotation-calibrated Latent Quantization), an offline method for joint rotation and range calibration. RoLaQ refines a shared rotation within subspaces defined by the frozen key and value projections, and jointly learns quantization ranges whose thresholds and reconstruction gains are coupled to control the shared signal's response. Prediction matching and attention-output supervision guide calibration with model weights frozen. Across three MLA models and six benchmarks, RoLaQ achieves the highest average accuracy among the compared 2-bit methods both without and with token protection. On DeepSeek-V2-Lite, an SGLang implementation provides 3.96 times the BF16 KV capacity under the same memory budget and 2.51 times its decode throughput with 256K input tokens.

Introduction

Long contexts and concurrent requests increase the memory and bandwidth costs of the key–value (KV) cache during autoregressive decoding [31, 23]. Multi-head latent attention (MLA), introduced in DeepSeek-V2, reduces these costs by caching a compact content latent shared across heads [19]. MLA and its variants now underpin models including DeepSeek-V3, GLM-5.3, and Hy4 (Liu et al., 2024b; GLM-5-Team et al., 2026; tencent, 2026). Even with this architectural compression, the cache continues to grow with context length and serving concurrency. KV cache quantization offers further savings by lowering the storage precision of cached states [23, 13, 17]. We focus on quantizing MLA’s content latent to two bits while preserving its two roles in attention matching and value readout.

KIVI exploits distinct K/V statistics with per-channel key and per-token value quantization [23]. KVQuant and GEAR further control distortion through outlier handling and residual error compensation [13, 17]. Rotations make low-bit representations easier to quantize by redistributing outliers [1, 22, 28]. Attention-aware calibration further adapts these transformations to the computations that consume the cache, as in OptR’s attention-output reconstruction objective (Yun et al., [33]). These methods primarily target multi-head or grouped-query attention with separate key and value caches.

In MLA, every head derives both content keys and values from the same quantized latent through distinct projections (Figure 1a). A single perturbation can therefore change both the matching scores that select information and the values aggregated under those scores. OSCAR provides covariance-aware rotations for this shared cache (Zhou et al., [36]). These projection paths guide our joint calibration of the latent basis and quantization range.

RoLaQ comparison of MLA latent roles, KV capacity, and throughput

Figure 1. (a) MLA shares a content cache between keys and values. (b,c) On one A100 80GB, RoLaQ gives DeepSeek-V2-Lite 3.96×3.96 \times the BF16 capacity at equal memory budgets and 2.51×2.51 \times its decode throughput with four concurrent requests and 256K inputs.

Two observations guide our design (§ 2). Joint K/V projection energy is unevenly distributed across latent directions, so equal-magnitude errors can produce different distortions. Reconstruction gain also affects prediction fidelity even when the rotation is fixed. Because rotation changes the quantizer’s input distribution, we learn its boundaries alongside the latent basis. Together, these observations motivate joint rotation and range learning with a controlled reconstruction response.

We introduce ROLAQ, which jointly learns a shared rotation within K/V-defined subspaces and a quantization threshold per layer, with model weights frozen. Each threshold determines its reconstruction gain, allowing the quantization assignments to adapt while controlling the shared signal’s reconstruction response. A BF16 teacher supplies next-token distributions and attention outputs: prediction KL aligns the complete model, while attention-output supervision directly guides the individual layers. Calibration takes roughly 30 minutes on one A100 GPU. At inference, ROLAQ uses a packed 2-bit content cache and absorbs read-side rotations into MLA’s projections, eliminating standalone rotation multiplications when attending to the cached history.

We evaluate ROLAQ on DeepSeek-V2-Lite, Moonlight-16B-A3B, and MiniCPM3-4B across six benchmarks. It achieves the highest average accuracy among the compared 2-bit methods both with and without token protection. Without protection, it improves on the strongest baseline by 1.1 to 3.8 points (Table 1). Retaining selected tokens in BF16 further improves accuracy. RULER retrieval at 8K and 16K shows that calibration gains extend beyond the 4K training context. Figure 1b,Figure 1c shows the SGLang gains for DeepSeek-V2-Lite: 3.96× the BF16 cache capacity at equal memory budgets and 2.51× its decode throughput with 256K input on one A100 80GB.

MethodKnowledge & QAMathCodeAvg.
MMLUCMMLUTriviaQAGSM8KHumanEvalMBPP
DeepSeek-V2-Lite
BF1658.064.165.237.428.043.449.4
RTN40.5 / 44.945.8 / 51.841.5 / 59.67.0 / 15.112.2 / 18.917.6 / 28.027.4 / 36.4
QuaRot53.2 / 53.858.6 / 60.660.4 / 63.425.5 / 30.525.6 / 25.033.8 / 38.642.9 / 45.3
KVarN49.9 / 53.756.0 / 59.157.8 / 63.423.6 / 27.920.1 / 26.232.6 / 37.040.0 / 44.6
OSCAR50.8 / 50.357.8 / 57.660.9 / 62.218.3 / 18.922.6 / 23.836.6 / 38.641.1 / 41.9
RoLAQ55.1 / 55.761.5 / 62.164.1 / 64.932.1 / 34.225.4 / 27.041.8 / 42.546.7 / 47.7
Moonlight-16B-A3B
BF1670.078.266.473.547.053.464.7
RTN61.2 / 65.665.1 / 72.846.7 / 64.844.1 / 61.623.8 / 41.537.4 / 46.246.4 / 58.8
QuaRot63.1 / 65.868.9 / 73.448.1 / 64.449.7 / 67.532.3 / 41.539.0 / 50.850.2 / 60.6
KVarN45.6 / 63.045.0 / 67.917.6 / 58.521.2 / 64.112.2 / 47.016.6 / 45.626.4 / 57.7
OSCAR66.9 / 67.973.9 / 75.458.6 / 63.764.3 / 69.434.8 / 43.345.4 / 48.457.3 / 61.3
RoLAQ67.4 / 67.974.9 / 76.163.2 / 65.366.5 / 70.540.4 / 44.347.9 / 50.160.1 / 62.3
MiniCPM3-4B
BF1664.472.936.275.774.451.862.6
RTN54.3 / 59.359.2 / 67.828.5 / 33.535.4 / 65.022.6 / 68.331.6 / 45.638.6 / 56.6
QuaRot61.7 / 62.569.6 / 70.133.9 / 34.968.5 / 71.470.1 / 70.145.0 / 48.458.1 / 59.6
KVarN59.3 / 62.866.7 / 71.527.1 / 34.952.4 / 72.547.6 / 70.739.4 / 51.448.7 / 60.6
OSCAR62.9 / 63.069.9 / 71.631.9 / 34.971.2 / 74.267.1 / 70.147.0 / 49.258.3 / 60.5
RoLAQ62.9 / 63.571.0 / 71.234.7 / 35.370.5 / 74.667.1 / 73.850.3 / 49.759.4 / 61.4

Table 1. Downstream accuracy (%) with 2-bit content caches. Each pair reports w.o. / w. token protection (without / with 4 sink and 16 recent tokens retained in BF16). BF16 is a shared reference; bold marks the best 2-bit scores at the displayed precision within each setting.

Our contributions are as follows:

  • We develop joint rotation and range calibration for MLA, using a compact K/V search space and coupled thresholds and gains to control the shared latent’s response.

  • We demonstrate accuracy gains across three MLA models alongside long-context retrieval improvements, with ablations explaining the roles of rotation geometry, quantizer response, and calibration objectives.

  • We implement packed INT2 serving in SGLang with fused cache writes and optimized attention paths, delivering greater KV capacity, higher long-context throughput, and lower first-token tail latency.

MLA Cache Quantization: Structure and Challenges

One Cache, Two Roles

For each token tt, MLA caches a content latent ct∈Rdc_t \in\mathbb{R}^{d} and a decoupled RoPE key ktR∈Rdrk_t^{R} \in\mathbb{R}^{d_r} (Liu et al., [19]). Each head hh obtains its content key and value through frozen up-projections, kt,h=ctWK,hTk_{t,h}=c_tW_{K,h}^{T} and vt,h=ctWV,hTv_{t,h}=c_tW_{V,h}^{T}. Using row vectors, a query with content part qhq_h and positional part qhRq_h^{R} produces

αt,h=softmax⁡t[τ(qhktT+qhRktRT)],\alpha_{t,h}=\operatorname{softmax}_{t}\left[\tau\left(q_hk_{t}^{T}+q_h^{R}k_t^{R T}\right)\right],
y=∑h∑tαt,hvt,hWO,h,(1)y=\sum_h\sum_t\alpha_{t,h}v_{t,h}W_{O,h}, \tag*{(1)}

where τ\tau is the attention scale, softmax runs over causally visible positions, and WO,hW_{O,h} is head hh’s output-projection block. The shared latent therefore determines both where attention looks through the keys and what it reads through the values. Its quantization error propagates through both roles.

We quantize ctc_t to two bits and retain the lower-dimensional RoPE key ktRk_t^{R} in BF16 because of its quantization sensitivity (Zhang et al., [34]). An orthogonal rotation RR spreads outliers before quantization (Ashkboos et al., [1]; Liu et al., [22]). Writing QQ for quantization and DQ for dequantization, every head uses c^t=DQ⁡(Q(ctR))RT\hat{c}_t=\operatorname{DQ}(Q(c_tR))R^{T} for matching and readout.

Projection-Dependent Distortion

Let et=c^t−cte_t = \hat{c}_t - c_t be the reconstruction error. Its effects on the attention logit and value are

Δst,h=τqhWK,hetT,Δvt,h=etWV,hT.(2)\Delta s_{t,h} = \tau q_h W_{K,h} e_t^{\mathsf{T}}, \qquad\Delta v_{t,h} = e_t W_{V,h}^{\mathsf{T}}. \tag*{(2)}

Errors of equal magnitude can affect the two projections differently depending on their direction. Let WKW_K and WVW_V stack the corresponding up-projections across heads. For X∈{K,V}X \in\{K,V\}, the squared projection error is ∥eWXT∥2=eWXTWXeT\lVert eW_X^{\mathsf{T}}\rVert^2 = eW_X^{\mathsf{T}}W_Xe^{\mathsf{T}}. We define

HX=WXTWXtr⁡(WXTWX),H=HK+HV.(3)H_X = \frac{W_X^{\mathsf{T}}W_X}{\operatorname{tr}(W_X^{\mathsf{T}}W_X)}, \qquad H = H_K + H_V. \tag*{(3)}

Trace normalization gives both projections equal total weight. The quadratic form eHeTeHe^{\mathsf{T}} sums normalized squared K/V errors. Each eigenvalue of HH measures this error along its unit eigenvector.

fig:2a shows that the leading half of HH’s eigenvectors captures 62–75% of each projection’s energy across the three models, averaged over layers. This common basis separates directions by their influence on both projections, guiding the shared rotation search.

Sensitivity to Reconstruction Scale

Beyond error direction, reconstruction scale affects both matching and readout. The threshold controls four-level assignments, while the gain scales the reconstructed signal shared by both paths.

fig:2b isolates this effect by fixing OSCAR’s rotation and threshold and varying only its gain. Values below one indicate lower KL than the baseline with fixed g0=1.16g_0 = 1.16. On 8K-token documents, adjusting the gain alone reduces DeepSeek-V2-Lite’s next-token KL to BF16 by 52% within the sweep. Together, these observations motivate joint calibration of the shared rotation and quantization range. Appendix B.1 details both experiments and the full spectra.

Method

RoLAQ jointly calibrates the shared representation and its quantizer to preserve attention matching and value readout (Figure 3). The K/V-aware shared rotation uses the joint projection geometry to organize its search space (§3.1). The learnable quantization range adapts the decision boundary to this basis while preserving the centered signal’s linear response (§3.2). Joint calibration uses prediction matching and attention-output supervision to learn both components in the frozen model (Figure 3(d); §3.3).

K/V-Aware Shared Rotation

We use HH from Eq. (3) to divide rotation refinement between directions with high and low joint projection energy. Refining within these subspaces preserves this distinction while allowing the quantization basis to adapt to calibration data. Both subspaces contribute to the key and value paths.

Starting from OSCAR’s covariance-aware rotation R0R_0 ([36]), we express the geometry in the initial rotated coordinates as R0THR0=UΛUTR_0^{\mathsf{T}}H R_0 = U\Lambda U^{\mathsf{T}}. We sort the eigenvalues in descending order and split U=[U1,U2]U = [U_1,U_2] into two equal-dimensional subspaces. Within each, a learnable skew-symmetric generator defines the refinement:

R=R0Udiag⁡(eS1,eS2)UT,R = R_0 U \operatorname{diag}\left(e^{S_1},e^{S_2}\right)U^{\mathsf{T}},
Si=Ai−AiT,Ai∈Rd2×d2.(4)S_i = A_i - A_i^{\mathsf{T}}, \qquad A_i \in\mathbb{R}^{\frac{d}{2} \times\frac{d}{2}}. \tag*{(4)}

This parameterization keeps RR orthogonal throughout calibration; zero-initializing A1,A2A_1,A_2 recovers R0R_0. The two generators use d2/2d^2/2 trainable parameters, half the number in a full d×dd \times d generator. The calibration objective selects the rotation within this structured space. Section 5.2 evaluates this choice of rotation search space.

Response-Preserving Range Calibration

The range controls both the quantization assignments and the strength of the reconstructed signal. We adapt the assignments to the learned rotation while anchoring the linear response of the shared signal to its full-precision reference. We standardize each group of GG rotated coordinates using its mean μ\mu and standard deviation σ\sigma [36]. For a coordinate zz, reconstruction takes the form

x=z−μσ,z^=μ+σg aT(x).(5)x = \frac{z-\mu}{\sigma}, \qquad\hat{z} = \mu+ \sigma g\,a_T(x). \tag*{(5)}

Here aTa_T assigns xx to four ordered levels {±ain,±aout}\{\pm a_{\mathrm{in}}, \pm a_{\mathrm{out}}\} using boundaries (−T,0,T)(-T,0,T), with aout=3aina_{\mathrm{out}} = 3a_{\mathrm{in}}. The threshold TT controls assignment to the inner or outer levels, while the gain gg scales reconstruction around the group mean.

To separate systematic scale change from residual distortion, we use x∼N(0,1)x \sim\mathcal{N}(0,1) as a reference distribution. The quantized signal decomposes as g aT(x)=κx+ϵg\,a_T(x) = \kappa x + \epsilon, where E[xϵ]=0\mathbb{E}[x\epsilon] = 0 [5, 8] and

κ=gC(T),C(T)=E[x aT(x)].(6)\kappa= gC(T), \qquad C(T) = \mathbb{E}[x\,a_T(x)]. \tag*{(6)}

The coefficient κ\kappa measures the linear response to the input. In the original group scale, z^−μ=κ(z−μ)+σϵ\hat{z} - \mu= \kappa(z-\mu)+\sigma\epsilon. Changing TT and gg therefore changes the response of the centered signal reused by both attention paths. Appendix § 9.§ 3 derives C(T)C(T).

To enforce unit response under the Gaussian reference, we set the gain from the threshold:

g(T)=1C(T)⟹κ=1.(7)g(T) = \frac{1}{C(T)} \quad\Longrightarrow\quad\kappa= 1. \tag*{(7)}

Each layer learns TℓT_\ell (Appendix § 10.§ 3), and its gain follows from this constraint. The assignments can

therefore adapt while preserving unit response. § 5.3 tests this response after calibration across context lengths, complementing the initial gain sweep in Figure 2b.

Figure 2. Two observations on shared-latent quantization. (a) K/V energy in the leading half of the joint spectrum (mean ± layer std.; dashed: 50%). (b) Prediction KL at 8K with OSCAR’s rotation and threshold fixed, normalized by its value at g0=1.16g_0 = 1.16 (vertical dashed line). DS, ML, and CPM denote DeepSeek-V2-Lite, Moonlight, and MiniCPM3.

Joint Calibration and Inference

The rotation changes the distribution seen by the quantizer, so we learn the rotation generators and thresholds together across all LL layers. The backbone remains frozen. For the same input text, the BF16 model supplies target next-token distributions and attention outputs. We optimize

L=LKL+λLattn,\mathcal{L} = \mathcal{L}_{\mathrm{KL}} + \lambda\mathcal{L}_{\mathrm{attn}},
LKL=1∣I∣∑t∈IKL⁡(ptBF16∥pt2bit),\mathcal{L}_{\mathrm{KL}} = \frac{1}{|\mathcal{I}|}\sum_{t\in\mathcal{I}} \operatorname{KL}\left(p_t^{\mathrm{BF16}} \mathbin{\|} p_t^{\mathrm{2bit}}\right),
Lattn=1L∑ℓ=1L∥Yℓ2bit−YℓBF16∥F2∥YℓBF16∥F2.(8)\mathcal{L}_{\mathrm{attn}} = \frac{1}{L}\sum_{\ell=1}^{L}\frac{\left\|Y_\ell^{\mathrm{2bit}}-Y_\ell^{\mathrm{BF16}}\right\|_F^2}{\left\|Y_\ell^{\mathrm{BF16}}\right\|_F^2}. \tag*{(8)}

Here I\mathcal{I} contains the scored token positions, ptp_t is the next-token distribution, and YℓY_\ell collects attention outputs after WOW_O at those positions. Prediction KL aligns the complete quantized model with its BF16 teacher. The auxiliary output loss, weighted by λ\lambda, supplies a direct signal to each layer through both attention matching and value readout, following output-aware calibration [33]. Normalizing by teacher output energy balances layers with different scales.

We initialize the rotation and threshold from OSCAR and set the gain using Eq. (7). The forward pass uses the hard quantizer in Eq. (5). A straight-through estimator passes gradients to its inputs (Bengio et al., [3]), while a smooth threshold surrogate supplies gradients for bin assignment. The threshold also receives gradients through g(Tℓ)g(T_\ell). Calibration settings are in § 4; quantizer constants and checkpoint selection are in Appendix § 8.§ 3.

At inference, the learned rotation is exported as one dense matrix per layer, and each new latent is rotated once and stored as 2-bit codes with its group statistics. For z^t=DQ⁡(Q(ctR))\hat{z}_t = \operatorname{DQ}(Q(c_tR)), the read-side rotation in Figure 3(a)’s dashed box folds into MLA’s absorbed projections:

Figure 3. Overview of RoLAQ. (a) A shared 2-bit content cache supplies both K/V paths. The dashed box groups the read-side rotation with the projections that absorb it. (b) HK+HVH_K + H_V defines two spectral subspaces for learning the shared rotation. (c) The learned threshold determines the four-level assignments and gain g(T)=1/C(T)g(T) = 1/C(T). (d) A frozen BF16 teacher guides joint calibration through prediction KL and attention-output loss.

q~h=qhWK,hR,W~O,h=RTWV,hTWO,h,y=∑h(∑tαtz^t)W~O,h.(9)\begin{aligned} \widetilde{q}_h &= q_h W_{K,h}R,\\ \widetilde{W}_{O,h} &= R^{\mathsf{T}}W_{V,h}^{\mathsf{T}}W_{O,h},\\ y &= \sum_h \left(\sum_t \alpha_t \hat{z}_t\right)\widetilde{W}_{O,h}. \tag*{(9)} \end{aligned}

The content logit is τq~hz~tT\tau\widetilde{q}_h\widetilde{z}_t^{\mathsf{T}}, so both matching and readout operate in the rotated basis. The calibrated rotation, thresholds, and gains remain fixed throughout serving. Only the group statistics are computed from incoming tokens.

Experiments

Setup

Models and benchmarks. We evaluate DeepSeek-V2-Lite (Liu et al., [19]), Moonlight-16B-A3B (Liu et al., [21]), and MiniCPM3-4B (Hu et al., [15]) on six benchmarks: MMLU and CMMLU for knowledge (Hendrycks et al., [12]; Li et al., [18]), TriviaQA for question answering (Joshi et al., [16]), GSM8K for mathematics (Cobbe et al., [7]), and HumanEval and MBPP for code generation (Chen et al., [6]; Austin et al., [2]). We also evaluate long-context retrieval on the eight RULER retrieval tasks (Hsieh et al., [14]).

Baselines and cache settings. We compare with round-to-nearest quantization (RTN), QuaRot (Ashkboos et al., [1]), KVarN (Muller et al., [26]), and OSCAR (Zhou et al., [36]). QuaRot and KVarN are applied to the shared MLA latent; OSCAR uses its official MLA recipe. All comparisons use 2-bit content caches and BF16 RoPE keys. We evaluate every method both without token protection and with the first 4 sink tokens and most recent 16 tokens retained in BF16 (Xiao et al., [32]; Liu et al., [23]; Zhou et al., [36]). Accuracy is evaluated with simulated quantization in Hugging Face Transformers, giving all baselines a common evaluation framework.

Calibration. We calibrate RoLAQ on 1.43M Pile tokens [9] with the model frozen and select checkpoints by held-out prediction KL. Main results average three seeds; component, objective, and random-subspace ablations use one. Calibration takes about 22 minutes for the 16B models and 34 minutes for MiniCPM3 on one A100 GPU. Appendix § 8 provides model configurations, evaluation protocols, baseline implementations, and calibration hyperparameters.

Main Results

RoLAQ achieves the highest six-task average on all three models under both protection settings (Table 1). We first examine the setting in which every content token is quantized, which directly tests how well each method preserves accuracy under 2-bit storage. RoLAQ reaches 46.7, 60.1, and 59.4 on DeepSeek-V2-Lite, Moonlight, and MiniCPM3, exceeding the strongest baseline by 3.8, 2.8, and 1.1 points. The larger margins without protection highlight the benefit of calibrating the shared representation and its quantization range when the entire content history passes through the quantizer.

On DeepSeek-V2-Lite, GSM8K accuracy without protection improves from OSCAR’s 18.3 to 32.1. Moreover, RoLAQ without protection reaches a higher average than the strongest baseline with 20 protected tokens (46.7 vs. 45.3).

Retaining 4 sink and 16 recent tokens in BF16 further improves RoLAQ, which maintains the highest average accuracy on all three models. The calibrated cache thus benefits from mixed-precision token protection while retaining its advantage over the baselines. § 5.4 examines protection budgets; Appendix § 10.§ 1 reports all seeds and windows.

Appendix § 10.§ 4 illustrates these differences with arithmetic and retrieval examples, comparing the answers generated by BF16 and 2-bit models.

Long-Context Retrieval

We evaluate eight RULER retrieval tasks at 16K on DeepSeek-V2-Lite and 8K on Moonlight (Table 2), their longest evaluated contexts in this study. Both exceed the maximum calibration length of 4K. RoLAQ leads the 2-bit methods on both models, reaching 73.7% on DeepSeek-V2-Lite, 6.3 points above the strongest baseline. On Moonlight, it reaches 94.8%, compared with BF16’s 96.2%. DeepSeek-

MethodS1S2S3MK1MK2MK3MVMQAvg.
DeepSeek-V2-Lite
BF16100.0100.096.094.088.047.063.589.084.7
RTN86.055.021.023.00.00.033.025.230.4
QuaRot100.098.080.054.035.05.064.272.063.5
KVarN100.097.077.075.050.57.050.574.567.4
OSCAR100.089.070.052.07.01.055.862.554.7
RoLAQ100.0100.093.782.055.014.359.285.373.7
Moonlight-16B-A3B
BF16100.0100.099.097.0100.098.099.576.596.2
RTN100.099.093.080.073.049.085.881.282.6
QuaRot100.0100.085.079.088.061.091.084.886.1
KVarN100.098.083.069.077.073.093.889.885.4
OSCAR100.0100.096.092.097.078.096.294.294.2
RoLAQ100.0100.094.393.393.086.798.093.394.8

Table 2. Retrieval accuracy (%) on the eight RULER retrieval tasks with 4 sink and 16 recent tokens retained in BF16. Avg. denotes the task mean; bold marks the best 2-bit scores at the displayed precision.

V2-Lite’s MK2 accuracy also improves over OSCAR from 7.0 to 55.0. These results demonstrate transfer beyond the calibration length; § 5.3 examines response sensitivity up to 32K.

Ablations and Analysis

We examine how rotation, range, and calibration choices affect accuracy and serving efficiency.

Calibration Ablations

Calibration components. Joint calibration achieves the highest accuracy on both models (Table 3a). Allowing the range to adapt increases the gains from rotation calibration. For example, rotation calibration improves DeepSeek-V2-Lite’s MBPP accuracy by 2.2 points with a fixed range and by 4.0 points with a learned range. These

DeepSeekMoonlight
ConfigurationMMLUMBPPMMLUMBPP
(a) Calibration components
Initialization52.039.467.048.4
Rotation only54.541.667.248.8
Range only52.340.067.448.4
Rotation + Range55.944.067.949.2
(b) Calibration objective
ObjectiveAvg.Avg.
KL only47.562.0
Attention-output only47.762.2
KL + attention-output48.162.6
RotationParams.DeepSeek S↓S \downarrowDeepSeek Avg.↑\uparrowMoonlight S↓S \downarrowMoonlight Avg.↑\uparrow
Full (Exp.)d2d^20.66447.50.55962.0
Full (Cayley)d2d^20.66147.50.59262.3
Random subspacesd2/2d^2/20.62847.40.55061.9
HK−HVH_K-H_Vd2/2d^2/20.62447.10.57962.2
HK+HVH_K+H_Vd2/2d^2/20.62247.70.50862.3

Table 3. Ablations of calibration components and objectives. (a) MMLU and MBPP accuracy (%) for different component configurations. (b) Six-task average accuracy (%) for different calibration objectives.

results support adapting the quantizer jointly with the latent representation.

Calibration objective. With both components enabled, the combined objective yields the highest six-task mean on both models (Table 3b). Attention-output supervision alone slightly outperforms KL alone, while combining them raises the means to 48.1 on DeepSeek-V2-Lite and 62.6 on Moonlight. These gains support supervising both final predictions and per-layer attention outputs. We use λ=0.1\lambda= 0.1 for the combined objective.

Rotation Search Space

The HK+HVH_K+H_V partition uses half the trainable rotation parameters of full exponential and Cayley rotations while matching or improving their six-task accuracy (Table 4). It also reduces validation KL by 6.3% and 9.1% relative to full exponential rotation on DeepSeek-V2-Lite and Moonlight. The random control preserves block sizes, initialization, and calibration budget but replaces the K/V eigenbasis with a random orthogonal basis. The K/V basis improves both KL and accuracy over this con-

trol. These comparisons support a compact rotation search guided by MLA’s two projection paths (Appendix § 9.§ 2). The learned blocks export as a dense rotation, allowing the compact search space to use the same inference kernels as full rotations.

Quantizer Response

Range calibration controls the shared signal used by both attention paths. Under the Gaussian reference, minimizing reconstruction error can favor attenuation (Appendix § 9.§ 3). Coupling gain to threshold improves MiniCPM3’s normalized validation KL from 0.606 with free gain to 0.527 within the same HK+HVH_K+H_V search space (Appendix § 10.§ 2). The coupled setting also gives more consistent KL across the three calibration seeds.

We then examine response sensitivity by fixing a DeepSeek-V2-Lite checkpoint calibrated with κ=1\kappa= 1 and varying its gain at inference. Figure 4 shows the lowest prediction KL at κ=1\kappa= 1 across contexts from 2K to 32K. Amplification becomes more costly as context grows. Together, these results support adapting quantization boundaries while controlling the reconstructed signal shared by attention matching and value readout.

Figure 4. Effect of quantizer response on DeepSeek-V2-Lite. Prediction KL to BF16 is normalized by its value at κ=1\kappa= 1 for each context length. Using a checkpoint calibrated with full rotation and unit response, we vary the gain at inference while keeping the rotation and thresholds fixed.

Token Protection

The advantage of RoLAQ is largest without token protection: it exceeds the strongest baseline by 1.1–3.8 points in six-task mean accuracy across the three models (Table 1). With every content token quantized, these gains highlight the accuracy preserved by the learned latent quantization itself. We reuse the same calibrated checkpoints across protection budgets. Retaining sink and recent tokens in BF16 further improves RoLAQ, which maintains the highest mean across all three protection budgets (Figure 5). Latent calibration improves the low-bit representation, while token protection retains selected tokens at high precision; their benefits can therefore be combined. With only 4 sink and 8 recent tokens protected, RoLaQ already exceeds the strongest baseline using 4 sink and 16 recent tokens on each model (Table 8 and Table 1).

Figure 5. Effect of token protection on six-task mean accuracy (%). The horizontal axis gives the number of sink + recent content tokens retained in BF16.

MethodMMLUCMMLUTriviaQAGSM8KHumanEvalMBPPAvg.
BF1658.064.165.237.428.043.449.4
RTN43.049.655.013.318.926.034.3
QuaRot53.160.162.430.327.436.244.9
KVarN52.859.062.629.524.439.844.7
OSCAR49.957.461.218.425.637.841.7
RoLAQ55.562.164.433.827.442.147.6 ±0.6
BF1670.078.266.473.547.053.464.7
RTN65.171.862.360.939.047.257.7
QuaRot65.472.662.364.842.751.659.9
KVarN63.067.457.361.041.543.055.5
OSCAR67.574.963.068.840.248.060.4
RoLAQ67.575.764.270.043.949.361.8 ±0.4
BF1664.472.936.275.774.451.862.6
RTN58.966.932.164.168.946.856.3
QuaRot62.470.034.070.170.748.259.2
KVarN62.870.834.472.367.750.459.7
OSCAR63.071.434.573.570.150.260.5
RoLAQ63.471.134.973.473.450.761.1 ±0.1

Table 8. Accuracy (%) with 4 sink and 8 recent BF16 tokens.

Serving Efficiency

We integrate RoLaQ into SGLang (Zheng et al. [35]) with Triton kernels for packed INT2 cache writes and attention. We fold read-side rotations into projections and apply thresholds and gains during cache writes (§ 3.3). We benchmark DeepSeek-V2-Lite on one A100 80GB against SGLang’s default BF16 implementation with identical workloads and memory budgets (Appendix § 11).

Under the same memory budget, RoLaQ and OSCAR each accommodate 4.56M KV tokens, compared with 1.15M for BF16, providing 3.96×3.96 \times the capacity (Figure 6(a)). Decode throughput reaches 2.51×2.51 \times BF16 with 256K input tokens and 2.43×2.43 \times during the 128K–256K output interval (Figure 6(b,Figure 6c)). At 256 concurrent requests, P99 TTFT falls by 37.8%, from 588.6 s to 366.0 s (Figure 6(d)). These measurements demonstrate greater KV capacity, faster decoding, and lower first-token tail latency in a practical serving system.

Figure 6. Serving performance of DeepSeek-V2-Lite on an A100 80GB GPU. (a) KV token capacity. (b,c) Decode throughput for long inputs and successive output intervals, with four concurrent requests. (d) P99 time to first token (TTFT) under increasing concurrency. OSCAR and RoLaQ share the INT2 kernels, so their overlapping curves use timings measured with RoLaQ under the same workloads.

Related Work

KV cache quantization. KV cache quantization reduces the memory cost of long-context inference by storing cached states at lower precision. KIVI adapts quantization granularity to key and value statistics, while KVQuant combines nonuniform quantization with outlier handling ([23, 13]). GEAR combines low-bit quantization with low-rank and sparse components to compensate errors ([17]), while ZipCache assigns higher precision to salient tokens ([11]). Retaining recent tokens or attention sinks in full precision provides another way to control error ([23, 28]). SnapMLA combines FP8 MLA caches with hardware-aware decoding while retaining RoPE keys in high precision ([34]).

Rotation and calibration. Beyond the quantizer itself, representation transforms help control outliers at low bitwidths while preserving full-precision computation. QuaRot uses Hadamard rotations, while SpinQuant learns rotations through calibration ([1, 22]). RotateKV and KVarN adapt KV caches through outlier-aware rotations and variance normalization, respectively ([28, 26]). OmniQuant learns clipping and equivalent transformations with pretrained weights frozen, motivating joint calibration of representations and quantization ranges ([27]).

Recent methods further tailor calibration to how cache errors affect attention. OSCAR derives rotations from attention-aware covariance statistics and supports MLA ([36]), while OptR learns per-head key and value rotations through attention-output reconstruction after the output projection ([33]). QuantMLA learns offline-feasible transformations for content and RoPE caches, using attention-output and positional-QK reconstruction objectives, respectively ([29]). RoLaQ uses MLA’s K/V projection structure to guide joint calibration of the shared latent rotation and quantization range.

Conclusion

We presented ROLAQ for joint calibration of MLA’s latent rotation and quantization range at two bits. K/V projection geometry provides a compact rotation search space, while coupled thresholds and gains control reconstruction response. Experiments show higher average accuracy across three MLA models and better long-context retrieval, with further gains from token protection. Our SGLang implementation increases KV capacity and throughput while reducing latency at high concurrency.

Limitations

Further compression of MLA caches must account for both content and position. ROLAQ quantizes the shared content latent while retaining the RoPE key in BF16, leaving positional keys and group metadata as a substantial share of the remaining cache. Extending these savings calls for coordinated content and positional precision while preserving attention’s ability to distinguish positions.

The serving benefits of low-bit caches also depend on hardware and workload. Bandwidth savings are most valuable when reading a long history dominates decoding. At shorter contexts, quantization and unpacking overheads can offset them. Our serving measurements use DeepSeek-V2-Lite on an A100. Extending these benefits calls for kernels tailored to the target hardware and workload.

Implementation and Evaluation Details

Models and Evaluation

The three models let us examine shared-latent quantization across both mixture-of-experts and dense architectures (Table 5). DeepSeek-V2-Lite and Moonlight each have 16B total parameters; Moonlight follows the DeepSeek-V3 architecture. MiniCPM3 is a dense 4B model with a smaller latent and more layers. We use lm-evaluation-harness ([4]) with the few-shot settings in Table 6 and greedy decoding for generation tasks.

ModelTypeLayersdddrd_r
DeepSeek-V2-LiteMoE2751264
Moonlight-16B-A3BMoE2751264
MiniCPM3-4BDense6225632

Table 5. Model configurations; dd and drd_r are the content-latent and RoPE-key dimensions.

BenchmarkShotsMetric
MMLU5Accuracy
CMMLU5Accuracy
TriviaQA5Exact match
GSM8K5Exact match
HumanEval0pass@1
MBPP3pass@1

Table 6. Downstream evaluation settings.

The benchmarks cover both answer selection and free-form generation. MMLU and CMMLU report accuracy weighted by subject size; TriviaQA uses exact match, and GSM8K uses flexible answer extraction. HumanEval and MBPP report greedy pass@1. MiniCPM3 uses its chat template, with HumanEval code extracted from the generated response. For MBPP, we truncate code at the first new example or trailing assertion block and remove test calls before rescoring all methods with a common evaluator.

Our long-context evaluation focuses on RULER’s eight retrieval tasks: three single-key, three multi-key, one multi-value, and one multi-query task. This set tests whether the cache preserves the information needed to recover a specified item as the surrounding context grows. Each task contains 100 examples scored with the official evaluation functions.

Baseline Implementations

We compare the methods at the same point in the MLA computation: the shared content latent before the K/V up-projections. The RoPE key remains in BF16 for every method. The group size is 128; RTN, QuaRot, and OSCAR group latent coordinates within each token, whereas KVarN groups tokens for channel-wise quantization. The formulas below describe the transformations used in our MLA evaluation. We write Q^=DQ∘Q\widehat{Q} = D_Q \circ Q for quantization followed by reconstruction.

RTN. For a group xx, let mx=min⁡ixim_x = \min_i x_i and Mx=max⁡ixiM_x = \max_i x_i. With step size Δx=(Mx−mx)/3\Delta_x = (M_x - m_x)/3, the affine min–max quantizer is

qx=clip⁡[0,3](round⁡x−mxΔx),q_x = \operatorname{clip}_{[0,3]}\left(\operatorname{round}\frac{x-m_x}{\Delta_x}\right),
Q^mm(x)=mx+Δxqx.(10)\widehat{Q}_{\mathrm{mm}}(x) = m_x + \Delta_x q_x. \tag*{(10)}

Constant groups are reconstructed exactly. RTN applies Q^mm\widehat{Q}_{\mathrm{mm}} directly to each content-latent group.

QuaRot. Following the cache rotation in QuaRot ([1]), we use a block-diagonal matrix H128H_{128} of normalized 128-dimensional Hadamard transforms:

c^t=Q^mm(ctH128)H128T.(11)\widehat{c}_t = \widehat{Q}_{\mathrm{mm}}(c_t H_{128})H_{128}^{\mathsf{T}}. \tag*{(11)}

The Hadamard transform mixes coordinates before rounding, providing a data-independent rotation reference with the backbone frozen.

KVarN. KVarN ([26]) combines a normalized Hadamard rotation HH with variance balancing across tokens and latent channels. For a tile XX of up to 128 tokens, let Z=(XH)TZ = (XH)^{\mathsf{T}}. Diagonal scales DcD_c and DtD_t balance its channel and token axes, respectively:

Z~=Dc−1ZDt−1,\widetilde{Z} = D_c^{-1} Z D_t^{-1},
X^=(DcQ^mm(Z~)Dt)THT.(12)\widehat{X} = (D_c\widehat{Q}_{\mathrm{mm}}(\widetilde{Z})D_t)^{\mathsf{T}}H^{\mathsf{T}}. \tag*{(12)}

We use 16 alternating variance-normalization iterations and apply Q^mm\widehat{Q}_{\mathrm{mm}} to each row of Z~\widetilde{Z} across tokens. Padding is excluded from the statistics. We also quantize partial tiles; single-token updates use Hadamard rotation followed by RTN over groups of latent coordinates.

OSCAR. We use the official MLA recipe of OSCAR ([36]), with the per-layer rotation R0R_0 fitted on Pile text by its calibration code. Let Q^T0,g0\widehat{Q}_{T_0,g_0} denote its group-normalized four-level reconstruction in Eq. (5), with fixed threshold T0=0.9810653T_0 = 0.9810653 and gain g0=1.16g_0 = 1.16.

c^t=Q^T0,g0(ctR0)R0T.(13)\widehat{c}_t = \widehat{Q}_{T_0,g_0}(c_tR_0)R_0^{\mathsf{T}}. \tag*{(13)}

We also use R0R_0 to initialize RoLAQ.

Calibration and Storage

Calibration adapts the cache representation while leaving the language model unchanged. All three models use the settings in Table 7. The Pile training text is disjoint from the text used to fit OSCAR’s initial rotation. We update only the rotation and thresholds, with the teacher and backbone frozen. No tokens are protected during calibration, so the learned parameters are exposed to quantization throughout the sequence. We reuse these checkpoints across all protection budgets.

SettingValue
Calibration dataPile, 1,430,800 tokens
Sequence length512–4,096 tokens
Optimizer / updatesAdam / 427
Rotation learning rate10−310^{-3}
Threshold learning rate5×10−35 \times10^{-3}
Learning-rate scheduleCosine
Gradient-norm clipping1.0
Auxiliary weight λ\lambda0.1
Response κ\kappa1
Quantization group size128
Protected training tokens0
Random seeds42, 43, 44

Table 7. Calibration hyperparameters.

Selecting a checkpoint. We select checkpoints by prediction fidelity on held-out Pile text. For each context setting, rr denotes the teacher-forced KL to BF16 divided by OSCAR’s KL on the same text. The selection score is a weighted average of the KL ratios for short, 2K, and 4K contexts:

S=0.5rshort+0.25r2K+0.25r4K.(14)S = 0.5 r_{\mathrm{short}} + 0.25 r_{2K} + 0.25 r_{4K}. \tag*{(14)}

We keep the checkpoint with the lowest SS. Thus, S<1S < 1 indicates lower prediction divergence than OSCAR, and selection reflects behavior across several context lengths.

Quantization grid. We use groups of G=128G = 128 coordinates and OSCAR’s four-level affine grid, with aout=1.5095586a_{\mathrm{out}} = 1.5095586 and ain=aout/3a_{\mathrm{in}} = a_{\mathrm{out}}/3. The outer level and initial threshold T0=0.9810653T_0 = 0.9810653 follow its Gaussian Lloyd–Max construction; the inner levels give an equally spaced reconstruction grid. Each layer learns its threshold and derives the gain from g=1/C(T)g = 1/C(T), starting at g≈1.114g \approx1.114 for the initial threshold.

Storage accounting. The cache stores three kinds of information: packed content codes, group statistics, and the RoPE key. With two bits per content coordinate, two FP32 scalars per group, and a BF16 RoPE key, an unprotected token requires d/4+8d/G+2drd/4 + 8d/G + 2d_r bytes per layer. This gives 288 bytes for DeepSeek-V2-Lite and Moonlight, and 144 bytes for MiniCPM3. Protected tokens additionally require BF16 content storage. The allocation measurements in Appendix § 11 include the packed buffers, group metadata, and token-protection buffers.

Supplementary Method Analysis

The method combines a choice of rotation space with control over quantizer response. We first describe the observations behind these choices, then make the rotation variants explicit and derive the response constraint.

Motivating Observations

The two observations separate direction from scale. Projection energy measures how strongly latent directions affect the K/VK/V projections, while the gain intervention changes reconstruction strength without changing the rotation or the assignments.

Projection energy. For each layer, we extract the native, head-interleaved key and value blocks of the frozen up-projection and form HK,HVH_K, H_V as in Eq. (3). Let u1,…,udu_1,\ldots,u_d be the eigenvectors of HK+HVH_K + H_V, ordered by descending eigenvalue. For X∈{K,V}X \in\{K,V\}, the fraction of projection energy in the first rr directions is

FX(r)=∑i=1r∥WXui∥22∥WX∥F2.(15)F_X(r) = \frac{\sum_{i=1}^{r} \lVert W_X u_i \rVert_2^2}{\lVert W_X \rVert_F^2}. \tag*{(15)}

Figure 2a reports 100FX(d/2)100F_X(d/2), averaged equally over all 27 DeepSeek-V2-Lite layers, 27 Moonlight layers, and 62 MiniCPM3 layers. The error bars are sample standard deviations across layers. The same subspace is used for the key and value measurements within each layer. All matrix products and eigendecompositions use FP64 on the original stored weights. Figure 7 shows the full cumulative energy profiles for both projections.

Figure 7. Cumulative K/V projection energy in the common joint eigenbasis. Solid and dashed curves denote keys and values, respectively; shading shows one standard deviation across layers. The diagonal gives the isotropic reference. The vertical line marks the equal-dimensional split used in Figure 2a.

Gain intervention. Figure 2b uses the OSCAR rotation R0R_0 before learned refinement and its threshold T0=0.981065T_0 = 0.981065 in every layer. We vary the gain uniformly across layers, holding both R0R_0 and T0T_0 fixed. The six evaluated gains are approximately {1.025,1.069,1.114,1.160,1.203,1.248}\{1.025, 1.069, 1.114, 1.160, 1.203, 1.248\}; the original gain is g0=1.16g_0 = 1.16. All content tokens are quantized; RoPE keys remain in BF16. We use 12 natural documents, two each from PG-19, Wikipedia, EuroParl, HackerNews, arXiv, and Pile-CC, with 8,192 tokens of context. Each document contributes the mean DKL(pBF16∥pINT2)D_{\mathrm{KL}}(p_{\mathrm{BF16}}\|p_{\mathrm{INT2}}) over its final 1,024 next-token predictions. Each plotted value is the mean over documents divided by that model’s mean at g0g_0; the curves connect the six measured settings.

Rotation Search Spaces

All variants start from the same covariance-aware rotation R0R_0. They differ in which directions can mix during refinement and in how the orthogonal update is parameterized. Writing these choices explicitly separates the effect of the K/V geometry from the size of the trainable search space.

Full exponential rotation. A dense generator A∈Rd×dA \in\mathbb{R}^{d \times d} defines

Rfull=R0eΩ,Ω=A−AT.(16)R_{\mathrm{full}} = R_0 e^{\Omega}, \qquad\Omega= A - A^{\mathsf{T}}. \tag*{(16)}

Every latent direction can mix with every other direction. This provides the unrestricted exponential reference for the structured variants.

Cayley rotation. Using the same dense skew-symmetric generator, Cayley replaces the matrix exponential with

RCayley=R0(I−Ω)(I+Ω)−1.(17)R_{\mathrm{Cayley}} = R_0(I-\Omega)(I+\Omega)^{-1}. \tag*{(17)}

The trainable parameter count remains d2d^2, so this comparison changes the orthogonal map while keeping the generator unrestricted.

Joint-energy blocks: HK+HVH_K + H_V. The structured variants use B=diag⁡(eS1,eS2)B = \operatorname{diag}(e^{S_1},e^{S_2}), where Si=Ai−AiTS_i = A_i - A_i^{\mathsf{T}} and Ai∈Rd/2×d/2A_i \in\mathbb{R}^{d/2 \times d/2}. For the joint-energy basis,

R0T(HK+HV)R0=U+Λ+U+T,R+=R0U+BU+T.(18)R_0^{\mathsf{T}}(H_K+H_V)R_0 = U_+\Lambda_+U_+^{\mathsf{T}}, \qquad R_+ = R_0U_+BU_+^{\mathsf{T}}. \tag*{(18)}

We order eigenvalues from largest to smallest and split U+U_+ into two equal halves. These blocks separate high and low joint projection energy, while each still contributes to both keys and values.

K/V-contrast blocks: HK−HVH_K - H_V. Replacing the sum by the difference gives

R0T(HK−HV)R0=U−Λ−U−T,R−=R0U−BU−T.(19)R_0^{\mathsf{T}}(H_K-H_V)R_0 = U_-\Lambda_-U_-^{\mathsf{T}}, \qquad R_- = R_0U_-BU_-^{\mathsf{T}}. \tag*{(19)}

Here the signed eigenvalues measure the relative strength of the key and value projections along each direction. The leading half is more key-dominant; the trailing half is more value-dominant.

Random subspaces. The random control uses the same block sizes but replaces the K/V basis with a fixed random orthogonal basis:

Rrand=R0UrandBUrandT.(20)R_{\mathrm{rand}} = R_0U_{\mathrm{rand}}BU_{\mathrm{rand}}^{\mathsf{T}}. \tag*{(20)}

It therefore retains the d2/2d^2/2 trainable parameters of the spectral variants while removing their K/V-based grouping. All generators are initialized at zero, recovering R0R_0, and all variants export a dense d×dd \times d rotation for inference. The random control uses seed 42; the other variants use three seeds.

Response of the Four-Level Quantizer

Decision thresholds and reconstruction levels determine a scalar quantizer’s distortion [24, 25]. To isolate the scale change introduced by quantization, we separate the part of the reconstruction aligned with the input from its residual. This gives the linear response used in § 3.2. For x∼N(0,1)x \sim\mathcal{N}(0,1), let ϕ\phi denote the standard normal density. Symmetry of the code in Eq. (5) gives

E[xaT(x)]=2ain∫0Txϕ(x) dx+2aout∫T∞xϕ(x) dx=2ain[ϕ(0)−ϕ(T)]+2aoutϕ(T),(21)\mathbb{E}[x a_T(x)] = 2a_{\mathrm{in}} \int_{0}^{T} x\phi(x)\,dx + 2a_{\mathrm{out}} \int_{T}^{\infty} x\phi(x)\,dx = 2a_{\mathrm{in}}[\phi(0)-\phi(T)] + 2a_{\mathrm{out}}\phi(T), \tag*{(21)}

which is C(T)C(T), using ∫xϕ(x) dx=−ϕ(x)\int x\phi(x)\,dx=-\phi(x). Since E[x2]=1\mathbb{E}[x^2]=1, the least-squares coefficient of g aT(x)g\,a_T(x) on xx is κ=g C(T)\kappa=g\,C(T), and the residual ϵ=g aT(x)−κx\epsilon=g\,a_T(x)-\kappa x satisfies E[xϵ]=0\mathbb{E}[x\epsilon]=0 ([5, 8]). Setting κ=1\kappa=1 preserves the component aligned with the input, while ϵ\epsilon captures the remaining quantization noise.

For a fixed threshold, the gain that minimizes the Gaussian reconstruction error is gMSE=C(T)/E[aT(x)2]g_{\mathrm{MSE}}=C(T)/\mathbb{E}[a_T(x)^2], which gives κMSE=C(T)2/E[aT(x)2]≈0.88\kappa_{\mathrm{MSE}}=C(T)^2/\mathbb{E}[a_T(x)^2]\approx0.88 near T=1T=1. Thus, reducing reconstruction error can favor a weaker reconstructed signal. Coupling gg to TT through 1/C(T)1/C(T) instead anchors the aligned component while allowing the decision boundary to adapt. § 5.3 tests how this response affects prediction fidelity across context lengths.

We bound T∈[0.5,1.25]T\in[0.5,1.25] so that g=1/C(T)≲1.3g=1/C(T)\lesssim1.3. The official setting (T,g)=(0.981,1.16)(T,g)=(0.981,1.16) gives κ=1.041\kappa=1.041, and κ=1\kappa=1 at the official threshold corresponds to g=1.114g=1.114.

Additional Results

These results expand the main comparisons along three dimensions: token-protection budget, calibration seed, and range calibration. We then examine the learned thresholds and concrete model responses to connect the aggregate scores with the behavior of the cache.

Token Protection and Calibration Seeds

The intermediate budget of 4 sink and 8 recent tokens fills the gap between the two settings in Table 1. Table 8 reports all six tasks at this budget, where RoLAQ again has the highest mean among the compared 2-bit methods on all three models. Together with the main table, it shows how latent calibration and token protection combine across protection budgets.

Table 9, Table 10, and Table 11 expand the method averages into seeds 42, 43, and 44 for the three protection settings. Each seed corresponds to one calibrated checkpoint reused across protection budgets, so the tables show both calibration variation and the effect of protecting more tokens. Standard deviations are computed across seeds for each task; for Avg., they are computed from the three six-task means. DS, ML, and CPM denote DeepSeek-V2-Lite, Moonlight, and MiniCPM3.

ModelSeedMMLUCMMLUTriviaQAGSM8KHumanEvalMBPPAvg.
DS4255.161.563.831.626.842.446.9
DS4355.361.564.132.526.242.247.0
DS4454.861.664.332.323.240.846.2
std0.210.040.240.471.960.870.44
ML4267.174.863.065.738.447.259.4
ML4367.674.863.067.042.748.860.7
ML4467.575.263.566.940.247.860.2
std0.260.240.270.772.140.810.66
CPM4263.371.035.170.768.350.059.7
CPM4363.070.934.370.464.050.058.8
CPM4462.371.134.570.268.951.059.7
std0.540.090.420.272.660.580.53

Table 9. Per-seed accuracy (%) without protection. Avg. averages six tasks; std denotes sample standard deviation.

ModelSeedMMLUCMMLUTriviaQAGSM8KHumanEvalMBPPAvg.
DS4255.662.564.434.129.943.248.3
DS4355.461.864.233.826.841.447.2
DS4455.762.164.533.525.641.847.2
std0.150.340.160.302.200.950.61
ML4267.375.964.771.347.047.462.3
ML4367.775.664.068.842.751.061.6
ML4467.575.564.070.042.149.661.4
std0.170.190.421.292.661.810.44
CPM4263.471.135.073.173.250.261.0
CPM4363.471.234.873.373.851.261.3
CPM4463.571.135.073.873.250.661.2
std0.060.040.120.390.350.500.15

Table 10. Per-seed accuracy (%) with 4 sink and 8 recent BF16 tokens.

ModelSeedMMLUCMMLUTriviaQAGSM8KHumanEvalMBPPAvg.
DS4255.962.564.834.626.844.048.1
DS4355.561.664.834.329.342.848.0
DS4455.962.165.033.625.040.647.0
std0.250.450.140.542.141.720.60
ML4267.976.265.770.446.349.262.6
ML4367.876.165.270.144.551.662.5
ML4468.075.964.971.042.149.461.9
std0.090.180.410.462.141.330.42
CPM4263.771.135.374.176.250.461.8
CPM4363.471.435.275.173.248.861.2
CPM4463.471.335.474.572.049.861.1
std0.170.130.100.502.200.810.41

Table 11. Per-seed accuracy (%) with 4 sink and 16 recent BF16 tokens.

Range Calibration on MiniCPM3

With the HK+HVH_K+H_V search space fixed, Table 12 compares freely learned gain with gain coupled to the threshold on MiniCPM3. Coupling gain to threshold reduces the mean validation KL ratio from 0.606 to 0.527 and its variation across calibration seeds. Thus, response control improves prediction fidelity within the same structured rotation space.

RangeValidation KL S↓S \downarrow
Free gain0.606±0.0310.606 \pm0.031
κ=1\kappa= 10.527±0.008\mathbf{0.527} \pm0.008

Table 12. Range calibration with HK+HVH_K + H_V on MiniCPM3. SS is validation KL relative to OSCAR (lower is better); values are mean ±\pm sample standard deviation over three seeds.

Learned Thresholds

The response constraint leaves each layer free to choose its quantization boundary. Figure 8 shows the resulting profiles across rotations and seeds. Most layers move below the initial Lloyd–Max threshold, with thresholds concentrated around T≈0.91T\approx0.91, 0.89, and 0.85 for the three models. Lower thresholds narrow the central assignment region, while the coupled gain preserves unit response. The layerwise profiles therefore show how the quantizer adapts its assignments under a shared response constraint.

Figure 8. Learned per-layer thresholds with κ=1\kappa= 1 for all rotations and seeds. The dashed line is the Lloyd–Max threshold used by OSCAR.

Case Study

Table 13 and Table 14 present four selected examples from DeepSeek-V2-Lite. With the same token protection budget, RoLAQ preserves the correct BF16 answers while both QuaRot and OSCAR fail.

(a) Counting both bags
QuestionMitchell is making nachos for his family. He buys two bags of chips with 55 chips each. If his family has five members, how many chips does each person get if they all get the same number?
Answer22
BF1622
QuaRotEach person gets 55 / 5 = <<55/5=11>>11 chips. #### 11
OSCARThere are 55 chips in each bag. If there are five people, each person gets 55 / 5 = <<55/5=11>>11 chips. #### 11
RoLAQMitchell buys 2 * 55 = <<2*55=110>>110 chips. There are 5 members in his family, so each person gets 110 / 5 = <<110/5=22>>22 chips. #### 22
(b) Subtracting the available line
QuestionThe caretaker of the docks needs to buy some new line. He wants 3 feet of line for every foot of dock. Right now, there is 200 feet of dock, and he has 6 feet of new line. How many feet of line does he need to buy in total?
Answer594
BF16594
QuaRotHe needs 3200 = <<3200=600>>600 feet of line. #### 600
OSCARHe needs 2003 = <<2003=600>>600 feet of line. #### 600
RoLAQHe needs 3 feet of line for every foot of dock, so he needs 3200 = <<3200=600>>600 feet of line. He has 6 feet of line, so he needs to buy 600-6 = <<600-6=594>>594 feet of line. #### 594

Table 13. GSM8K examples on DeepSeek-V2-Lite. (a) Both bags must be counted. (b) The available line must be subtracted. We show BF16 final answers and the quantized models’ solutions. All quantized methods retain 4 sink and 16 recent tokens in BF16; RoLAQ uses calibration seed 42.

(a) Retrieving the matching value
NeedleOne of the special magic numbers for hesitant-finding is: 4868456.
QueryWhat is the special magic number for hesitant-finding mentioned in the provided text?
BF164868456.
QuaRot4806456.
OSCAR1807270.
RoLAQ4868456.
(b) Retrieving all requested values
NeedlesOne of the special magic numbers for overjoyed-strip is: 8531380. One of the special magic numbers for drunk-notice is: 3564729. One of the special magic numbers for towering-shear is: 2264218. One of the special magic numbers for dysfunctional-brushing is: 9289908.
QueryWhat are all the special magic numbers for overjoyed-strip, drunk-notice, towering-shear, and dysfunctional-brushing mentioned in the provided text?
BF169289908, 8531380, 2264218, and 3564729.
QuaRot10000000, 10000000, 10000000, and 10000000, respectively.
OSCAR8531380, 2264218, 2264218, and 8531380.
RoLAQ8531380, 2264218, 9289908, and 3564729.

Table 14. RULER examples from the 16K evaluation on DeepSeek-V2-Lite. (a) A single key is queried among multiple keys. (b) Four keys are queried together. We show the relevant context sentences and each model’s first answer line, with the same protection budget and calibration seed as Table 13.

In Table 13(a), both baselines divide the chips in one bag among five people, overlooking the second bag. RoLAQ counts both bags and obtains 22 chips per person. In (b), both baselines return the total requirement of 600 feet; RoLAQ subtracts the 6 feet already available and answers 594. Across all 1319 GSM8K problems, RoLAQ solves 277 that OSCAR misses and misses 69 that OSCAR solves.

In 16K retrieval (Table 14), QuaRot changes two digits of the value requested by a single-key query, while OSCAR returns a different number. For four queried keys, OSCAR repeats two values and omits the others; QuaRot repeats an unrelated number. RoLAQ retrieves the correct value or complete set in each case.

Serving Benchmarks

We evaluate serving from three perspectives: how much context fits in the cache, how quickly decoding proceeds as the cache grows, and how long requests wait for their first token under concurrency. Tables 15–17 report the capacity, throughput, and latency measurements in Figure 6.

The experiments use the final HK+HVH_K + H_V, κ=1\kappa= 1 checkpoint of DeepSeek-V2-Lite (seed 42) on one A100 80GB PCIe GPU. Tensor parallelism is one and the static memory fraction is 0.8. The content cache uses two-bit codes; RoPE keys, 4 sink tokens, and 16 recent tokens remain in BF16. Both BF16 and RoLAQ use Triton prefill and decode kernels under the same workload and memory budget. WikiText-2 requests arrive together and generate fixed-length outputs with greedy decoding. Prefix reuse and early stopping are disabled. We report one timed run per workload after warmup.

OSCAR uses the same packed-cache layout and kernels as RoLAQ. Its curves in Figure 6(b–Figure 6d) therefore reuse the RoLAQ timing values under this shared implementation. The allocation runs give the same KV capacity for both methods.

MethodKV tokensGiBRatio
BF161,151,70533.361.00×
OSCAR4,564,01233.333.96×
RoLAQ4,564,01233.333.96×

Table 15. Allocated KV capacity in Figure 6(a). GiB measures KV memory; ratios use BF16 as the reference.

Long-input and long-output workloads expose the growing cost of reading a larger history in two ways. The former sweeps 1K–256K input tokens with 128 output tokens; the latter starts from 128 input tokens and generates 256K tokens. Both use four concurrent requests, with K denoting 1,024 tokens. For the input sweep, decode throughput is the aggregate token rate after all requests finish prefill and before the first completes. For the output sweep, throughput is measured in successive output-token intervals beginning with the first generated token; Figure 6c plots each rate at the upper end of its interval.

Input lengthBF16RoLAQSpeedup
1K366.1323.60.88×
2K350.9310.10.88×
4K318.4308.50.97×
8K271.6275.41.01×
16K210.5250.21.19×
32K144.4200.31.39×
64K88.8154.51.74×
128K50.1107.42.14×
256K27.067.72.51×
Output intervalBF16RoLAQSpeedup
1–1K379.8338.30.89×
1K–2K361.6319.50.88×
2K–4K334.8297.40.89×
4K–8K293.2294.31.00×
8K–16K236.1261.81.11×
16K–32K169.7222.31.31×
32K–64K106.8177.31.66×
64K–128K63.2128.02.03×
128K–256K34.884.42.43×

Table 16. Decode throughput (tok/s) underlying Figure 6(b,Figure 6c). Both workloads use four concurrent requests. Speedups relative to BF16 are computed from unrounded measurements.

The concurrency workload instead fixes each request at 16K input and 1K output tokens and increases simultaneous arrivals from 1 to 256. P99 TTFT is measured within each burst and includes queueing and prefill. This captures the delay experienced by requests as the service becomes more heavily loaded. Capacity counts the allocated KV token slots under the same memory budget and request-slot limit, including group metadata and protected-token buffers.

Concurrent requestsBF16RoLAQ
11.401.44
22.832.86
45.605.73
811.1911.46
1622.2822.97
3244.6046.16
6489.1993.29
128254.87182.29
256588.58365.99

Table 17. P99 TTFT (s) underlying Figure 6(d). Each request has 16K input and 1K output tokens.

AI Assistance

We used AI assistants for code development, manuscript organization, and language editing. The authors take responsibility for the final work.

References

  1. [1]Saleh Ashkboos, Amirkeivan Mohtashami, Maximilian L Croci, Bo Li, Pashmina Cameron, Martin Jaggi, Dan Alistarh, Torsten Hoefler, and James Hensman. 2024. Quorot: Outlier-free 4-bit inference in rotated llms. Advances in Neural Information Processing Systems, 37:100213–100240.arxiv.org/abs/2404.00456
  2. [2]Jacob Austin, Augustus Odena, Maxwell Nye, Maarten Bosma, Henryk Michalewski, David Dohan, Ellen Jiang, Carrie Cai, Michael Terry, Quoc Le, et al. 2021. Program synthesis with large language models. arXiv preprint arXiv:2108.07732.arxiv.org/abs/2108.07732
  3. [3]Yoshua Bengio, Nicholas Léonard, and Aaron Courville. 2013. Estimating or propagating gradients through stochastic neurons for conditional computation. arXiv preprint arXiv:1308.3432.
  4. [4]Stella Biderman, Hailey Schoelkopf, Lintang Sutawika, Leo Gao, Jonathan Tow, Baber Abbasi, Alham Fikri Aji, Pawan Sasanka Ammanamanchi, Sidney Black, Jordan Clive, et al. 2024. Lessons from the trenches on reproducible evaluation of language models. arXiv preprint arXiv:2405.14782.
  5. [5]Julian Jakob Bussgang et al. 1952. Crosscorrelation function of amplitude-distorted Gaussian signals. Technical report, Research Laboratory of Electronics, Massachusetts Institute of Technology.
  6. [6]Mark Chen, Jerry Tworek, Heewoo Jun, Qiming Yuan, Henrique Ponde De Oliveira Pinto, Jared Kaplan, Harri Edwards, Yuri Burda, Nicholas Joseph, Greg Brockman, et al. 2021. Evaluating large language models trained on code. arXiv preprint arXiv:2107.03374.
  7. [7]Karl Cobbe, Vineet Kosaraju, Mohammad Bavarian, Mark Chen, Heewoo Jun, Lukasz Kaiser, Matthias Plappert, Jerry Tworek, Jacob Hilton, Reiichiro Nakano, et al. 2021. Training verifiers to solve math word problems. arXiv preprint arXiv:2110.14168.
  8. [8]Ozlem Tugfe Demir and Emil Bjornson. 2020. The Bussgang decomposition of nonlinear systems: Basic theory and MIMO extensions [lecture notes]. IEEE Signal Processing Magazine, 38(1):131–136.
  9. [9]Leo Gao, Stella Biderman, Sid Black, Laurence Golding, Travis Hoppe, Charles Foster, Jason Phang, Horace He, Anish White, Noa Nabeshima, et al. 2020. The pile: An 800gb dataset of diverse text for language modeling. arXiv preprint arXiv:2101.00027.
  10. [11]Yefei He, Luoming Zhang, Weijia Wu, Jing Liu, Hong Zhou, and Bohan Zhuang. 2024. Zipcache: Accurate and efficient kv cache quantization with salient token identification. Advances in Neural Information Processing Systems, 37:68287–68307.
  11. [12]Dan Hendrycks, Collin Burns, Steven Basart, Andy Zou, Mantas Mazeika, Dawn Song, and Jacob Steinhardt. 2020. Measuring massive multitask language understanding. arXiv preprint arXiv:2009.03300.
  12. [13]Coleman Hooper, Sehoon Kim, Hiva MohammadZadeh, Michael W Mahoney, Yakun Shao, Kurt Keutzer, and Amir Gholami. 2024. Kvquant: Towards 10 million context length llm inference with kv cache quantization. Advances in Neural Information Processing Systems, 37:1270–1303.
  13. [14]Cheng-Ping Hsieh, Simeng Sun, Samuel Kriman, Shantanu Acharya, Dima Reches, Fei Jia, Yang Zhang, and Boris Ginsburg. 2024. RULER: What’s the real context size of your long-context language models? arXiv preprint arXiv:2404.06654.
  14. [15]Shengding Hu, Yuge Tu, Xu Han, Chaoqun He, Ganqu Cui, Xiang Long, Zhi Zheng, Yewei Fang, Yuxiang Huang, Weilin Zhao, et al. 2024. MiniCPM: Unveiling the Potential of Small Language Models with Scalable Training Strategies. arXiv preprint arXiv:2404.06395.
  15. [16]Mandar Joshi, Eunsol Choi, Daniel S Weld, and Luke Zettlemoyer. 2017. Triviaga: A large scale distantly supervised challenge dataset for reading comprehension. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1601–1611.arxiv.org/abs/1705.03551
  16. [17]Hao Kang, Qingru Zhang, Souvik Kundu, Geonhwa Jeong, Zaoxing Liu, Tushar Krishna, and Tuo Zhao. 2024. Gear: An efficient kv cache compression recipe for near-lossless generative inference of llm. arXiv preprint arXiv:2403.05527.arxiv.org/abs/2403.05527
  17. [18]Haonan Li, Yixuan Zhang, Fajri Koto, Yifei Yang, Hai Zhao, Yeyun Gong, Nan Duan, and Timothy Baldwin. 2024. Cmmlu: Measuring massive multitask language understanding in chinese. In Findings of the Association for Computational Linguistics: ACL 2024, pages 11260–11285.arxiv.org/abs/2306.09212
  18. [19]Aixin Liu, Bei Feng, Bin Wang, Bingxuan Wang, Bo Liu, Chenggang Zhao, Chengqi Deng, Chong Ruan, Damai Dai, Daya Guo, et al. 2024a. Deepseek-v2: A strong, economical, and efficient mixture-of-experts language model. arXiv preprint arXiv:2405.04434.arxiv.org/abs/2405.04434
  19. [21]Jingyuan Liu, Jianlin Su, Xingcheng Yao, Zhejun Jiang, Guokun Lai, Yulun Du, Yidao Qin, Weixin Xu, Enzhe Lu, Junjie Yan, et al. 2025a. Muon is scalable for llm training. arXiv preprint arXiv:2502.16982.arxiv.org/abs/2502.16982
  20. [22]Zechun Liu, Changsheng Zhao, Igor Fedorov, Bilge Soran, Dhruv Choudhary, Raghuraman Krishnamoorthi, Vikas Chandra, Yuandong Tian, and Tijmen Blankevoort. 2025b. Spinquant: Llm quantization with learned rotations. In International Conference on Learning Representations, volume 2025, pages 92009–92032.arxiv.org/abs/2405.16406
  21. [23]Zirui Liu, Jiayi Yuan, Hongye Jin, Shaochen Zhong, Zhaozhuo Xu, Vladimir Braverman, Beidi Chen, and Xia Hu. 2024c. Kivi: A tuning-free asymmetric 2bit quantization for kv cache. arXiv preprint arXiv:2402.02750.DOI
  22. [24]Stuart Lloyd. 1982. Least squares quantization in PCM. IEEE transactions on information theory, 28(2):129–137.DOI
  23. [25]Joel Max. 1960. Quantizing for minimum distortion. IRE Transactions on Information Theory, 6(1):7–12.DOI
  24. [26]Lorenz K Muller, Philippe Bich, Chiara Boretti, Hyun-Min Chang, Jiawei Zhuang, and Lukas Cavigelli. 2026. KVarN: Variance-Normalized KV-Cache Quantization Mitigates Error Accumulation in Reasoning Tasks. arXiv preprint arXiv:2606.03458.arxiv.org/abs/2606.03458
  25. [27]Wenqi Shao, Mengzhao Chen, Zhaoyang Zhang, Peng Xu, Lirui Zhao, Zhiqian Li, Kaipeng Zhang, Gao Peng, Yu Qiao, and Ping Luo. 2024. Omniquant: Omnidirectionally calibrated quantization for large language models. In International Conference on Learning Representations, volume 2024, pages 45472–45496.arxiv.org/abs/2308.13137
  26. [28]Zunhai Su, Zhe Chen, Wang Shen, Hanyu Wei, Linge Li, Huangqi Yu, and Kehong Yuan. 2025. Rotatekv: Accurate and robust 2-bit kv cache quantization for llms via outlier-aware adaptive rotations. arXiv preprint arXiv:2501.16383.arxiv.org/abs/2501.16383
  27. [29]Zunhai Su, Yuxuan Sun, Jianchao Su, Tao Zhang, Ruihan Hu, Yuchen Xie, Xunliang Cai, and Ngai Wong. 2026. QuantMLA: Function-Aligned Dual-Path Quantization for Low-Bit MLA KV Caching. arXiv preprint arXiv:2609.36760.arxiv.org/abs/2609.36760
  28. [31]Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. Advances in neural information processing systems, 30.arxiv.org/abs/1706.03762
  29. [32]Guangxuan Xiao, Yuandong Tian, Beidi Chen, Song Han, and Mike Lewis. 2024. Efficient streaming language models with attention sinks. In International Conference on Learning Representations, volume 2024, pages 21875–21895.arxiv.org/abs/2309.17453
  30. [33]Vincent-Daniel Yun, Woosang Lim, Minsoo Cheong, Sunwoo Lee, Murali Annavaram, Sai Praneeth Karimireddy, and Sungjoo Yoo. 2026. Output-Aware Rotation for INT2 KV-Cache Quantization. Preprint, arXiv:2608.02691.arxiv.org/abs/2608.02691
  31. [34]Yifan Zhang, Zunhai Su, Shuhao Hu, Rui Yang, Wei Wu, Yulei Qian, Yuchen Xie, and Xunliang Cai. 2026. SnapMLA: Efficient Long-Context MLA Decoding via Hardware-Aware FP8 Quantized Pipelining. arXiv preprint arXiv:2602.10718.arxiv.org/abs/2602.10718
  32. [35]Lianmin Zheng, Liangsheng Yin, Zhiqiang Xie, Chuyue Sun, Jeff Huang, Cody H Yu, Shiyi Cao, Christos Kozyrakis, Ion Stoica, Joseph E Gonzalez, et al. 2024. Sglang: Efficient execution of structured language model programs. Advances in neural information processing systems, 37:62557–62583.arxiv.org/abs/2312.07104
  33. [36]Zhongzhu Zhou, Donglin Zhuang, Jisen Li, Ziyan Chen, Shuaiwen Leon Song, Ben Athiwatkun, and Xiaoxia Wu. 2026. OSCAR: Offline Spectral Covariance-Aware Rotation for 2-bit KV Cache Quantization. arXiv preprint arXiv:2605.17757.arxiv.org/abs/2605.17757

Paper details

vlnc:W_tyd694d2
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 11

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents