Quantizing Recurrent Language Models Is Easier Than You Think
The post-training quantization (PTQ) stack has been developed for softmax attention. For linear attention and hybrids, it remains underexplored. This work aims to change that. We differentiate between extra-state weight/activation (W/A) quantization and state quantization during decode in low precision, investigating how both differ from quantization in classical softmax attention. Storing linear attention state during decode, our final scheme LoReS combines value-axis grouping, stochastic rounding, and decay-based mixed precision.
Abstract
Linear recurrences are becoming an increasingly common building block in large language models, replacing the growing KV cache of softmax attention with a fixed-size recurrent state that enables efficient decoding. However, the quantization stack has largely been developed around softmax Transformers, whose numerical properties and inference state differ from those of recurrent models, motivating quantization schemes tailored to recurrences. We study how quantizing linear recurrences differs from quantizing softmax attention along two complementary axes. First, extra-state quantization concerns weights and activations outside the recurrent state, whose distributions are shaped indirectly by the sequence mixer during training. In controlled 1.3B models, we find that decayed recurrences develop much weaker residual outlier channels than softmax attention and are therefore easier to quantize without incoherence processing. Second, intra-state quantization concerns the recurrent state itself during decode, where repeated updates and recurrent decay create a different numerical problem from KV cache quantization. We use these insights to develop LoReS, a pipeline that combines value-axis scale grouping, decay-based mixed-precision allocation and stochastic rounding for low-bit recurrent state quantization. Across Qwen-3.5 9B, Nemotron-H 8B, and Kimi-Linear 48B-A3B, LoReS supports robust 8-bit state quantization and lower effective precision on shorter decode horizons. We implement LoReS in vLLM and demonstrate end-to-end decode speedups.
Architectural Differences: Linear vs. Softmax
Softmax attention and linear attention maintain fundamentally different objects for sequence mixing. While softmax attention appends keys and values to a growing KV cache, linear attention updates a fixed-size matrix state in place. This changes the quantization problem.
Language-model layer
Recurrent state
KV cache
We differentiate between two quantization objectives. Extra-state quantization covers weights and activations. Its dependence on the sequence mixer is implicit. Intra-state quantization acts on the state stored during decode. Its dependence on the sequence mixer is explicit.
Extra-State Weight and Activation Quantization
We vary the sequence mixer in 1.3B models while keeping the surrounding backbone and training recipe fixed. All experiments in Table 1 use GPTQ with per-output-channel weight scales and dynamic activation scales. We test rotations of the residual stream and the inputs to the MLP down-projection and mixer output projection.
Decayed recurrences are robust
Without incoherence processing, decayed linear recurrences are more robust than softmax attention to W4A4 quantization. Keeping other recurrent degrees of freedom fixed, decay consistently helps, with diagonal decay working best. Applying all three rotations brings perplexity increases to similar levels across models. Robustness differences are thus mainly due to learned distributions, not error propagation under different algebraic properties of the sequence mixer itself.
| Mixer-zoo variant | W4A4 | W4A4 + rotations |
|---|---|---|
| Softmax | 98.4% | 10.6% |
| Linear attention | 111.4% | 12.5% |
| Mamba-2 | 56.6% | 11.9% |
| GLA | 45.0% | 9.3% |
| Gated DeltaNet | 55.4% | 11.8% |
| KDA | 47.8% | 11.2% |
Residual stream outliers
Softmax attention learns an outlier channel in its residual stream whose magnitude is approximately constant across tokens and layers. This channel coarsens the quantization grid, leading to larger quantization error. Decayed linear recurrences have weaker outliers. Across our mixer zoo, stronger outliers accompany larger W4A4 perplexity increases without rotations.
Softmax attention
KDA
Residual magnitudes at layer 12, across 2,048 channels and every second token of a 128-token window. Both plots use the same height and color scales. Softmax attention has a persistent outlier channel, peaking at 18.875. KDA peaks at 4.0625.
Loading activation data…
The nearly constant outlier channel acts as a bias on queries, keys and values. In softmax attention, the query/key bias can sharpen the attention distribution. Linear recurrences lack this softmax mechanism and instead use decay to focus on a few tokens. We hypothesize that this explains their weaker residual outliers.
LoReS: State Quantization
We organize our analysis around properties that distinguish recurrent state quantization from KV cache quantization:
- Scale grouping. The state has two channel axes, whereas a KV cache has a channel axis and a time axis.
- Mixed precision. Recurrent decay suppresses quantization error, inhibiting temporal error propagation.
- Rounding. The state is requantized after every decode step, so rounding errors can accumulate.
- Rotations. Rotations can reduce one-step error but worsen error propagation across steps.
The resulting quantization scheme, LoReS, keeps updates in full precision and quantizes the state stored between decode steps.
(1/4) Scale grouping
The recurrent state of linear attention has two feature axes. The KV cache only has one. We compare value- and key-axis grouping. Under round-to-nearest (RTN), value-axis (row) grouping is more robust. It is the LoReS default.
Mathematical details
Proposition (per-channel readout error). For a fixed state and unit-norm query, assume independent, uniform rounding errors within half a grid step. With \(\mathbf e=\mathbf E\mathbf q\),
Here \(M_i=\max_j|S_{ij}|\), \(C_j=\max_i|S_{ij}|\), and \(r=2^{b-1}-1\).
To interpret this result, recall that each value row of the state produces one output channel. Under value-axis grouping, the expected squared error in that output channel is proportional to the square of the row’s largest absolute entry. Under key-axis grouping, every channel has the same expected squared error, determined by the column ranges and the query. Large entries in one row can therefore set coarse quantization steps for other rows.
Value-axis versus key-axis grouping
How does a row- or column perturbation impact the output under key- and value-axis grouping?
animation details
For a \(4\times4\) state and unit-norm query, we display the readout and predicted RMS rounding error:
Here \(\mathbf E\) follows the independent uniform-error model in the proposition above.
(2/4) Mixed precision
Decay attenuates quantization error over time, so we allocate more bits to the slowest-decaying heads or channels.
Mathematical details
Proposition (decaying error). With identical initial states and fixed keys, values, and gates, assume \(\lVert\boldsymbol\alpha_t\rVert_\infty\le\alpha<1\). Delta correction, if used, has unit-norm keys and \(0<\beta_t<2\). Then accumulated state error satisfies
Each fresh quantization error \(\boldsymbol\varepsilon_\tau\) is suppressed exponentially as it propagates through later updates.
Decay of an injected quantization error
Change the decay factor to see how much of a single injected error survives each update.
animation details
For one injected error, constant scalar decay, and no further rounding, we plot the surviving fraction:
(3/4) Rounding
Unlike RTN, stochastic rounding (SR) is conditionally unbiased. Under SR, interactions between errors from different quantization steps vanish in expectation, while RTN can reinforce them. LoReS uses SR with value grouping.
Mathematical details
Proposition (repeated quantization). Assume scalar decay, no delta correction, and keys, values, and gates fixed independently of rounding. Let \(\boldsymbol\varepsilon_\tau\) be fresh quantization error and \(\gamma_{\tau,t}=\prod_{j=\tau+1}^t\alpha_j\). For RTN and conditionally unbiased SR,
RTN can reinforce errors across steps. Under SR, these cross terms vanish in expectation.
RTN versus SR
The histogram isolates interactions between rounding errors from different steps. RTN can reinforce these errors, producing positive values. Under SR, these interactions vanish in expectation.
animation details
After 100 synthetic scalar updates \(S_t=\alpha S_{t-1}+a v_tk_t\) on a fixed grid, we plot the remainder from the proposition:
Here \(E_t=\widehat S_t-S_t\). A fresh error \(\varepsilon_\tau\) survives as \(\gamma_{\tau,t}\varepsilon_\tau=\alpha^{t-\tau}\varepsilon_\tau\). Squaring gives the exponent \(2(t-\tau)\). Each trajectory contributes one RTN value and the mean of SR values.
(4/4) Rotations
Random Hadamard rotations reduce quantization reconstruction error. This benefit need not persist under repeated state quantization.
Scale feedback loop
Rounding error can raise the next quantization scale and amplify later errors. Compare scales and accumulated error when scales come from the previously quantized state or an unquantized copy.
animation details
For a group \(G\) of 64 scalar recurrences sharing a scale, we compare two scale sources over 200 SR updates:
Here \(\mathbf S_t\) is the unquantized state, \(\mathbf E_{t-1}\) is accumulated error, and \(r=2^{b-1}-1\) for \(b\) bits. Earlier errors affect the noisy scale. Using an unquantized copy removes this dependence, as in the paper’s experiment. We plot \(s_{G,t}\) and \(\lVert\widehat{\mathbf S}_t-\mathbf S_t\rVert_2\), with identical writes and SR draws.
Query alignment
Queries can suppress state quantization error by placing little weight on the affected dimensions. Rotations can weaken this suppression. This need not increase readout error, but we observe such increases in some of our experiments.
Rotation and query alignment
The distributions show how rotation changes query–error alignment. Change the query direction to vary how strongly the query suppresses rounding error.
animation details
For synthetic \(8\times8\) states after 128 key–value updates, we plot query alignment:
Here \(d_k=8\), \(\mathbf q\) has unit norm, \(\boldsymbol\varepsilon\) is fresh rounding error, and expectations are over SR. We compare no rotation with a random Hadamard applied to both state and query. The slider shifts query weight between lower- and higher-error channels of the unrotated state. Rotations stay fixed until resampling. The fixed horizontal range covers the central 99% at every query setting. Sparse tails outside it are omitted.
Results
Accuracy
INT8 states preserve most of the accuracy of FP32 states in Qwen-3.5 9B, Nemotron-H 8B, and Kimi-Linear 48B-A3B. Larger losses generally appear with 4-bit weights.
Qwen-3.5 9B
| W/A/S | GSM8K | MMLU-Pro | GPQA | AIME | RULER |
|---|---|---|---|---|---|
| 16/16/32 | 95.9 | 82.6 | 80.1 | 82.3 | 94.6 |
| 16/16/8 | 96.4 | 82.2 | 79.6 | 79.5 | 94.7 |
| 8/16/32 | 96.5 | 82.5 | 80.1 | 83.1 | 94.6 |
| 8/16/8 | 96.0 | 82.3 | 79.1 | 80.1 | 94.5 |
| 8/8/32 | 96.8 | 82.4 | 80.3 | 82.1 | 94.6 |
| 8/8/8 | 96.5 | 82.2 | 79.8 | 78.6 | 94.7 |
| 4/8/32 | 97.1 | 80.7 | 75.0 | 73.5 | 94.9 |
| 4/8/8 | 96.1 | 80.1 | 73.6 | 70.9 | 94.8 |
Nemotron-H 8B
| W/A/S | GSM8K | MMLU-Pro | GPQA | AIME | RULER |
|---|---|---|---|---|---|
| 16/16/32 | 92.3 | 70.6 | 54.1 | 51.2 | 88.0 |
| 16/16/8 | 92.0 | 70.1 | 53.5 | 48.4 | 88.3 |
| 8/16/32 | 92.9 | 70.4 | 54.0 | 51.7 | 88.4 |
| 8/16/8 | 92.5 | 70.0 | 53.1 | 49.4 | 88.2 |
| 8/8/32 | 93.3 | 70.3 | 54.8 | 50.9 | 88.4 |
| 8/8/8 | 92.6 | 70.1 | 53.5 | 49.5 | 88.5 |
| 4/8/32 | 90.9 | 67.8 | 49.0 | 43.3 | 85.4 |
| 4/8/8 | 91.8 | 67.0 | 49.7 | 41.0 | 85.1 |
Kimi-Linear 48B-A3B
| W/A/S | GSM8K | MMLU-Pro | GPQA | AIME | RULER |
|---|---|---|---|---|---|
| 16/16/32 | 89.1 | 70.3 | 63.5 | 63.6 | 93.7 |
| 16/16/8 | 89.2 | 70.2 | 63.8 | 62.6 | 93.8 |
| 8/16/32 | 89.8 | 70.4 | 63.9 | 64.3 | 93.5 |
| 8/16/8 | 89.6 | 70.2 | 61.9 | 62.4 | 94.0 |
| 8/8/32 | 88.9 | 70.1 | 63.3 | 62.3 | 93.7 |
| 8/8/8 | 88.4 | 69.7 | 62.6 | 63.6 | 93.9 |
| 4/8/32 | 86.4 | 65.9 | 53.6 | 56.9 | 93.4 |
| 4/8/8 | 88.9 | 65.5 | 52.6 | 55.2 | 93.3 |
animation details
The tabs select the paper’s measured benchmark results for three hybrid models. Each table compares weight, activation, and state precisions. Highlighted rows use INT8 states.
Lower state precision
Allocating precision by decay lets us use 5 effective state bits for Qwen-3.5 and 5.5 for Nemotron-H on GSM8K with less than a 5% relative accuracy drop from FP32 states.
Qwen-3.5
Nemotron-H
Speedup
State-quantization speedups grow with batch size. Weight-quantization gains are largest at small batches. The two therefore complement each other.
Each bar splits the speedup into the gain from INT4 weights and the additional gain from INT8 states.
Citation
Enjoy Reading This Article?
Here are some more articles you might like to read next: