alphaFeedback

WorksComputer Science

LoopVQ: Sub 1-bit KV Cache Quantization for Looped Transformers

AI contributions
Not recorded for this paper
View details
Ancillary data
1 code link
View

Abstract

Looped transformers are a parameter-efficient alternative to standard transformers for language modeling. By reapplying the same layers across multiple loop steps, recent looped language models match the performance of non-looped models several times their size. While this architecture effectively reduces parameter memory, each loop step still stores its own keys and values, so the key-value (KV) cache grows linearly with the number of loop steps and becomes the main memory bottleneck. We observe that the KV cache of looped models is highly redundant along the loop axis and that the loop steps differ substantially in their sensitivity to quantization. Based on these observations, we propose LoopVQ\textbf{LoopVQ}, a KV cache vector quantization method for looped transformers that codes channels of multiple loop steps jointly, and fine-tunes the codebooks to match the output of the full-precision model. At 0.5 bits per element, LoopVQ outperforms existing KV cache vector quantization methods for standard LLMs on general, long chain-of-thought reasoning, and long-context retrieval tasks with Ouro and Huginn models. Its design is orthogonal to these methods, and combined with TaSQ, it retains much of the BF16 accuracy even at 0.25 bits per element. We also implement LoopVQ in SGLang, where it nearly halves the decode latency at a 32K-token context and raises the peak serving throughput by up to 4.3×4.3\times and 6.1×6.1\times on the 1.4B and 2.6B Ouro models compared to the BF16 baseline.

[!GitHub] Code: https://github.com/mscheong01/LoopVQ

Introduction

Looped transformers [10, 15, 30, 14] (Zhu et al. 2025) apply the same layers over multiple loop steps, effectively reusing the same parameters across multiple iterations. Built on this parameter-efficient architecture, Ouro-1.4B performs on par with non-looped models several times its size ((Zhu et al., 2025)).

This parameter efficiency, however, does not extend to the key-value (KV) cache. Although the loop steps share their weights, each loop step stores its own keys and values, so the KV cache grows linearly with the number of loop steps. As Figure 1a shows, Ouro-1.4B requires six times the per-token KV cache of Llama-3.1-8B ([16]), and the model’s KV cache exceeds its weights in memory even at moderate context lengths. This limits the batch size and context length at which the looped models can be served, making KV cache compression a promising way to improve their efficiency.

Parameter memory versus KV cache per token and GSM8K accuracy versus bits per element

Figure 1. Looped LMs trade parameter memory for KV cache. (a) Parameter memory versus KV cache per token, both in bf16, for standard LLMs and the looped Ouro models with four loop steps. Arrows mark the KV cache of Ouro under LoopVQ from 4 to 0.25 bits per element. (b) GSM8K accuracy of Ouro-2.6B versus the bitwidth of KV cache quantization.

Among various KV cache compression methods, quantization compresses the KV cache by storing each key and value at lower precision, without discarding any tokens. It has been widely studied for standard LLMs, with both scalar ([26, 18, 1]) and vector quantization ([6, 31] (Zhang et al. 2024)). These methods can also be applied to looped models, but they do not exploit the redundancy of the cache across loop steps, and below one bit per element they lose much of their accuracy (Figure 1b).

We find that the keys and values of a layer are strongly correlated across loop steps. Grouping channels of several loop steps into one sub-vector exploits this correlation and substantially reduces the reconstruction error at the same bitwidth, which makes the loop dimension an additional axis for vector quantization, complementary to the channel axis used by existing methods. We also find that quantization errors at different loop steps affect the model output to very different degrees.

Based on these observations, we propose LoopVQ, a KV cache quantization method for looped models with two components. Loop-axis vector quantization codes channels of several loop steps jointly, so that one index is shared by multiple loop steps with no additional cost in bits. Loop-aware codebook fine-tuning refines the codebooks to match the output of the full-precision model, accounting for the unequal sensitivity of the loop steps.

We evaluate LoopVQ on general benchmarks with Ouro-1.4B, Ouro-2.6B ((Zhu et al., 2025)), and Huginn-3.5B ([14]), and on long chain-of-thought reasoning and needle-in-a-haystack (NIAH) tasks with the two Ouro models. Combined with TaSQ ([6]), which exploits structure along the channel axis, LoopVQ comes close to the BF16 baseline at 0.5 bit. We further implement LoopVQ in SGLang ((Zheng et al., 2023)), where the loop steps share the same indices and each reads them through its own slice of the codebook.

Our contributions are as follows:

  • We show that the KV cache of looped models is highly redundant along the loop axis and that the loop steps differ substantially in their sensitivity to quantization.

  • We propose LoopVQ, which combines loop-axis vector quantization with loop-aware codebook fine-tuning and is orthogonal to channel-axis methods such as TaSQ. At 0.5 and 0.25 bits per element, LoopVQ outperforms vector quantization baselines designed for non-looped LLMs on general, reasoning, and long-context benchmarks.

  • We implement LoopVQ in SGLang, where the quantized cache stores one index row for several loop steps. It nearly halves the decode latency at long contexts and increases the peak throughput by up to 4.3× and 6.1× on the 1.4B and 2.6B Ouro models compared to the BF16 baseline.

Preliminaries

Looped language models. A looped transformer ([14] (Zhu et al. 2025)) applies the same LbL_b decoder layers TT times, where the first layer of each loop step takes the previous loop step’s output as its input. Starting from the embedded sequence h1:N(0)h^{(0)}_{1:N}, loop step t∈{1,…,T}t \in\{1,\ldots,T\} computes

h1:N(t)=Fθ(h1:N(t−1)),(1)h^{(t)}_{1:N} = F_{\theta}\left(h^{(t-1)}_{1:N}\right), \tag*{(1)}

where FθF_{\theta} denotes the LbL_b layers, shared across loop steps. The output distribution pjp_j is read from the final hidden state hj(T)h_j^{(T)}. Each layer stores a separate KV cache at every loop step. Token jj produces a key kj,h(t,ℓ)∈RDk_{j,h}^{(t,\ell)} \in\mathbb{R}^{D} and a value vj,h(t,ℓ)∈RDv_{j,h}^{(t,\ell)} \in\mathbb{R}^{D} for each loop step tt, layer ℓ\ell and KV head h≤Hh \le H. The cache is TT times larger than that of a non-looped model with the same weights.

Vector quantization of the KV cache. Prior work compresses the KV cache with vector quantization ((Zhang et al., 2024)). Every cached vector x∈RDx \in\mathbb{R}^{D} (x=kx = k or vv of one loop step, layer, and head) is split into D/GD/G sub-vectors z∈RGz \in\mathbb{R}^{G} of GG contiguous channels. Each sub-vector is stored as the index of its nearest entry in a codebook B={e1,…,eK}⊂RG\mathcal{B} = \{e_1,\ldots,e_K\} \subset\mathbb{R}^{G} of K=2bK = 2^b entries,

a(z)=arg min⁡r≤K ∥z−er∥22,z^=ea(z),(2)a(z) = \underset{r \le K}{\operatorname{arg\,min}}\ \lVert z-e_r\rVert_2^2,\qquad\hat{z}=e_{a(z)}, \tag*{(2)}

at a cost of b/Gb/G bits per element. Keys are quantized before the rotary embedding (RoPE), so attention reconstructs each key from its indices and applies RoPE to it, reading D/GD/G indices per cached vector. When these methods are applied to a looped model, codebooks are learned per loop step and layer (t,ℓ)(t,\ell), and the TT loop steps of a layer are quantized as unrelated caches.

Codebook calibration. Codebooks are learned offline from sub-vectors {zn}\{z_n\} collected on a small calibration set, typically by kk-means on their squared reconstruction error. This objective treats all sub-vectors alike, although the error in some may affect the model output more than others. To address this, prior work weights each sub-vector by its sensitivity ωn=∥∂L/∂zn∥22\omega_n = \lVert\partial\mathcal{L}/\partial z_n\rVert_2^2 to the next-token loss L\mathcal{L}, which equals the sum of the diagonal empirical Fisher information over its coordinates:

min⁡B∑nωnmin⁡r≤K∥zn−er∥22.(3)\min_{\mathcal{B}} \sum_n \omega_n \min_{r \le K} \lVert z_n - e_r \rVert_2^2. \tag*{(3)}

This gradient-based weighting has been reported to improve over unweighted kk-means in KV cache quantization [18] (Zhang et al. 2024). It only shapes the codebooks; encoding remains the nearest-entry rule (2).

Motivation

Unlike the caches of different layers in a non-looped model, the TT caches of a layer in a looped model are produced by applying the same parameters. We investigate whether this property can be used to compress the cache beyond what is achievable for a non-looped model.

Redundancy along the loop axis. The keys and values of a layer are highly similar across loop steps, as they are computed by the same projection weights from hidden states of the same token (1). In Figure 2a, the keys of one head show nearly the same channel pattern at all four loop steps. Averaged over all layers and heads of Ouro-1.4B, the correlation between adjacent loop steps increases from 0.69 between the first two loop steps to 0.94 between the last two.

Three-panel visualization of KV cache redundancy across loop steps

Figure 2. The KV cache of a looped LM is redundant along the loop axis. (a) Pre-RoPE keys of one head of Ouro-1.4B at each loop step. (b) Mean absolute correlation between (loop step, channel) pairs within a 16-channel group, averaged over all groups, heads, and layers of Ouro-1.4B. (c) kk-means reconstruction error at equal bitwidth when each 8-bit code spans GG channels of one loop step (channel) or G/4G/4 channels across four loop steps (loop), both with plain kk-means.

This redundancy runs along a different axis from the one that existing vector quantization methods exploit. Figure 2b shows the correlation between every pair of (loop step, channel) coordinates within a 16-channel sub-vector. A key channel correlates with the same channel at the adjacent loop step at ∣r∣=0.85|r| = 0.85 on average, but with the other channels of its own sub-vector at only 0.16, and the gap is even wider for values. Figure 2c measures how much this matters for quantization. At the same bitwidth and with the same number of codebooks, we only change which coordinates share a code: GG channels of one loop step, or G/4G/4 channels at each of four consecutive loop steps. With plain kk-means, the second grouping roughly halves the reconstruction error of Ouro-1.4B at 0.5 bit, and reduces it substantially for both models at every bitwidth.

Unequal quantization sensitivity across loop steps. Grouping along the loop axis places coordinates from different loop steps in one sub-vector, which is then encoded by a single index. However, the loop steps do not affect the output equally. An error in the cache of an early loop step perturbs the hidden state passed to all later loop steps (1), whereas an error at the last loop step affects only that loop step.

Table 1 confirms this. We quantize the cache of a single loop step with loop-axis codebooks calibrated by (3), keep all other loop steps in full precision, and measure the KL divergence of the output distribution from that of the full-precision model. The sensitivity varies by roughly a factor of five across loop steps: quantizing the first loop step is by far the most harmful, and the third loop step the least.

Bitwidth1234
0.5 bit0.0690.0180.0130.030
0.25 bit0.1230.0290.0260.065

Table 1. KL divergence from the full-precision output of Ouro-1.4B when only one loop step is quantized (loop-axis grouping, Fisher-weighted kk-means codebooks, sequences not used for calibration).

The calibration objective (3) cannot express this difference within a coupled sub-vector. Its weight ωn\omega_n is a single scalar per sub-vector, and its distance is the unweighted squared error, so an error is penalized equally regardless of the loop step on which it falls. The codebooks allocate the same precision to every loop step of a sub-vector, although errors at some loop steps affect the output far more than errors at others.

Existing KV cache quantization methods do not account for two properties of the looped structure: the cache is highly redundant along the loop axis, and the loop steps differ substantially in how strongly their quantization errors affect the output. § 4 builds on both observations.

Method

LoopVQ builds on the two properties identified in § 3: the redundancy of the cache along the loop axis (§ 4.1) and the unequal sensitivity of the loop steps (§ 4.2). Figure 3 gives an overview.

Overview of LoopVQ

Figure 3. Overview of LoopVQ. Each loop step of a looped LM writes its own KV cache. LoopVQ codes G/TcG/T_c channels across TcT_c loop steps, so one index serves all of them at the same bitwidth as coding each loop step separately, and fine-tunes the codebooks against the full-precision output through the loop. At inference, each loop step reads the shared indices through its own slice BtB_t of the codebook.

Loop-axis vector quantization

LoopVQ partitions the TT loop steps into blocks of TcT_c consecutive loop steps, where TcT_c divides both TT and GG; block β\beta contains the loop steps βTc+m+1\beta T_c + m + 1 with m<Tcm < T_c. A code then covers c=G/Tcc = G/T_c channels at each of the TcT_c loop steps of a block. For x∈{k,v}x \in\{k,v\}, layer ℓ\ell, head hh, and channel group g<D/cg < D/c, the coupled vector of token jj is

[zj(β,ℓ,h,g)]iTc+m=xj,h,gc+i(βTc+m+1,ℓ),i<c, m<Tc.(4)\left[z_j^{(\beta,\ell,h,g)}\right]_{iT_c+m}=x_{j,h,gc+i}^{(\beta T_c+m+1,\ell)}, \qquad i<c,\ m<T_c. \tag*{(4)}

As in existing KV cache vector quantization methods, LoopVQ quantizes the keys before RoPE is applied, and attention applies RoPE to the reconstructed keys (§ 2). The coupled vector is encoded by its nearest entry (2) in a codebook Bβ,ℓ,h,g⊆RG\mathcal{B}_{\beta,\ell,h,g} \subseteq\mathbb{R}^{G}, and loop step βTc+m+1\beta T_c+m+1 is reconstructed from its share of that entry:

x^j,h,gc+i(βTc+m+1,ℓ)=[ea(zj)]iTc+m.(5)\hat{x}^{(\beta T_c+m+1,\ell)}_{j,h,g_c+i} = [e_{a(z_j)}]_{iT_c+m}. \tag*{(5)}

One index serves TcT_c loop steps, and the bitwidth remains b/Gb/G bits per element. The codebooks are initialized with Fisher-weighted kk-means (3), where ωn=∥∂L/∂zn∥22\omega_n = \lVert\partial\mathcal{L}/\partial z_n \rVert_2^2 sums the squared gradients over all TcT_c loop steps covered by znz_n.

Loop-aware codebook fine-tuning

We refine the kk-means codebooks by matching the output of the quantized model to that of the original model, as in knowledge distillation (Hinton et al., [17]) and the end-to-end fine-tuning of vector-quantized LLM weights (Egiazarian et al., [11]; Malinovskii et al., [27]). For a calibration sequence ss, let CC be the cache of the unquantized forward pass and pjp_j its output distribution at position jj. Let C^(B)\hat{C}(\mathcal{B}) be the cache reconstructed from the codes of CC by (2) and (5), where B\mathcal{B} collects all key and value codebooks, and let qj(B)q_j(\mathcal{B}) be the output when all TT loop steps attend to C^(B)\hat{C}(\mathcal{B}) instead of CC. With the model weights frozen, we minimize

J(B)=Es[1N∑jKL⁡(pj∥qj(B))].(6)\mathcal{J}(\mathcal{B}) = \mathbb{E}_s\left[\frac{1}{N}\sum_j \operatorname{KL}\left(p_j \mathbin{\|} q_j(\mathcal{B})\right)\right]. \tag*{(6)}

where the sum runs over the NN positions after the bf16 sink tokens.

Fisher-weighted kk-means (3), like any weighted kk-means objective, penalizes the error of each coded vector independently. It cannot account for the interaction between the errors of different loop steps, which propagate to later loop steps and combine (Appendix § 10.§ 1); its weights also treat all TcT_c loop steps of a coupled vector equally, although they differ in sensitivity (§ 3). Minimizing (6) retains both effects. On Ouro-1.4B, fine-tuning roughly halves the KL divergence from the full-precision output (Figure 4).

KL divergence during fine-tuning

Figure 4. KL divergence from the full-precision Ouro-1.4B during fine-tuning, starting from the kk-means codebooks (circles). One iteration processes one calibration sequence (48 iterations = 4 epochs).

System implementation

We implement LoopVQ in SGLang (Zheng et al., 2023) (Figure 5). Coupling loop steps affects how the codes are stored, when a token can be encoded, and how attention at one loop step reads codes shared by several loop steps.

Serving LoopVQ in SGLang

Figure 5. The KV cache keeps the sink and recent tokens in bf16 at every loop step, and all other tokens as codebook indices shared across loop steps. At loop step tt, the LoopVQ attention kernel loads BtB_t, the slice of the codebook entries for loop step tt, into shared memory once and looks up the keys and values of each token from its indices in registers; the bf16 kernel reads the bf16 keys and values of loop step tt directly. Both attend with the query q(t)q^{(t)} of the new token, and their outputs are merged. The key and value of each new token are written in bf16, and after every 8 generated tokens the oldest recent page is encoded into indices.

Cache layout. The first nsn_s tokens (sink) and the most recent nrn_r tokens of a request are kept in bf16, and all other tokens are stored as codebook indices. The cache is organized in pages of 8 tokens, and nsn_s and nrn_r are multiples of 8, so every page is either bf16 or quantized as a whole. Since one index is shared across TcT_c loop steps (5), a quantized page stores one index row per block of TcT_c loop steps, and LoopVQ occupies the same memory per token as coding each loop step separately at the same GG.

Encoding. A coupled vector (4) can be encoded only once all TcT_c loop steps of its block have been computed. During prefill, the keys and values of each loop step are held until the last loop step of their block, and the block is then encoded by computing the distances to all codebook entries as a matrix product on tensor cores. During decoding, the key and value of each new token are written to the bf16 recent window, where all its loop steps are available by the end of the forward pass. After every δ\delta generated tokens, the oldest page of the window is encoded across all layers and loop steps into one quantized page, so the window holds nrn_r to nr+7n_r+7 tokens.

Attention. At loop step tt, one kernel attends to the bf16 pages and another to the quantized pages (Algorithm 1). The

Algorithm 1 LoopVQ attention kernel. Decode attention at loop step tt for one head and one split SS.

Require: query q(t)q^{(t)}; codebook slices Btk\mathcal{B}_t^k, Btv\mathcal{B}_t^v; key and value indices anka_n^k, anva_n^v of each token n∈Sn \in S

Ensure: partial output oo and its logsumexp λ\lambda

  1. load Btk\mathcal{B}_t^k into shared memory

  2. for n∈Sn \in S in parallel do

    1. k^n←Btk[ank]\hat{k}_n \leftarrow\mathcal{B}_t^k[a_n^k] ▷ D/cD/c indices

    2. sn←q(t)⋅RoPE⁡(k^n,n)/Ds_n \leftarrow q^{(t)} \cdot\operatorname{RoPE}(\hat{k}_n,n)/\sqrt{D}

  3. end for

  4. μ←max⁡nsn, pn←esn−μ, Z←∑npn\mu\leftarrow\max_n s_n,\ p_n \leftarrow e^{s_n-\mu},\ Z \leftarrow\sum_n p_n

  5. load Btv\mathcal{B}_t^v into shared memory

  6. o←1Z∑n∈SpnBtv[anv]o \leftarrow\frac{1}{Z}\sum_{n\in S}p_n\mathcal{B}_t^v[a_n^v]

  7. return o, λ=μ+log⁡Zo,\ \lambda=\mu+\log Z

quantized kernel looks up each index in BtB_t, the slice of every entry that holds the coordinates of loop step t=βTc+m+1t = \beta T_c + m + 1, i.e., [e]iTc+m[e]_{iT_c+m} for i<ci < c (5), cut once when the model is loaded. Each loop step uses an ordinary vector quantizer with groups of cc channels, and the baselines, which code each loop step separately, run on the same kernel. Keys are cached before the rotary embedding, which the kernel applies to the reconstructed keys. At each loop step, the kernel reads D/cD/c indices per head and token. As in Flash-Decoding Dao et al. [9], the quantized tokens are divided into splits processed by separate thread blocks, and the partial outputs of all splits are combined using the logsumexp of their attention scores Dao [8], which recovers the exact softmax over all tokens. The bf16 pages are attended by SGLang’s Triton decoding kernel, which uses the same scheme, and its splits are combined with those of the quantized kernel. For batched decoding, the quantized kernel is optimized to process multiple requests per thread block, sharing the loads of the rotary coefficients and codebooks Appendix § 12.

Experiments

Experimental setup

Models. We evaluate Ouro-1.4B and Ouro-2.6B Zhu et al. (2025) (Lb=24L_b = 24 and 4848, T=4T = 4, H=16H = 16, D=128D = 128), using their Thinking variants for reasoning tasks, and Huginn-3.5B Geiping et al. [14], which iterates a four-layer core block r=32r = 32 times between a two-layer prelude and coda (132 KV caches per token, 55 heads of dimension 96).

Methods. All methods quantize keys and values with 8-bit codes (K=256K = 256) and G∈{16,32}G \in\{16, 32\}, i.e., 0.5 or 0.25 bits per element. The baselines are CQ Zhang et al. (2024), with a separate Fisher-weighted kk-means codebook (3) per loop step and layer, and TaSQ Cheong et al. [6], which transforms the keys before coding each loop step. LoopVQ couples Tc=4T_c = 4 consecutive loop steps, so a code spans c=G/Tcc = G/T_c channels (c=4c = 4 at 0.5 bit, c=8c = 8 at 0.25 bit); on Huginn, the 32 loop steps form eight blocks, and the prelude and coda, which have no loop axis, are coded per layer as in CQ. TaSQ+LoopVQ applies TaSQ’s key transforms before coupling Appendix § 11; its per-token key scale adds 0.008 bits per key element (0.003 on Huginn). Every method keeps the first and the most recent tokens in bf16: 8 and 64 on the general benchmarks, 64 and 256 on the reasoning and long-context benchmarks.

Calibration. All codebooks are fitted separately for each model, including the Thinking variants, on 16 sequences of 2,048 tokens from the GPQA main set excluding the Diamond subset, which does not overlap with the evaluation set. LoopVQ fine-tunes the kk-means codebooks on 12 of these sequences with Adam (learning rate 10−310^{-3}, one sequence per iteration) for four epochs and keeps the epoch with the lowest KL on the other four. On one RTX 6000 Ada GPU, the kk-means calibration and the fine-tuning take 6.1 and 2.3 minutes for Ouro-1.4B and 14.3 and 5.9 minutes for Ouro-2.6B.

Benchmarks. We evaluate three settings, all with accuracy (%) as the metric. General benchmarks: the base models are evaluated with greedy decoding on GSM8K [7] (3-shot chain of thought, flexible extraction), MATH500 [22] (zero-shot), and HumanEval [4] and MBPP [2] (pass@1). Long chain-of-thought reasoning: the Thinking models are evaluated with thinking enabled on AIME’24, AIME’25 [28], GPQA-Diamond [29], HumanEval+, and MBPP+ [24], with the decoding settings of the model card (temperature 1.0, top-p 0.7, up to 32,768 generated tokens), averaged over three sampling seeds. Long-context retrieval: the base models are evaluated on the eight needle-in-a-haystack (NIAH) tasks of RULER [19] at context lengths from 4K to 64K tokens, the maximum context length of Ouro, with 200 examples per length, averaged over three seeds for the haystack and needle placement.

Implementation and hardware

All methods run in SGLang (Zheng et al., 2023) and store the quantized tokens as code indices. Decoding attends to the codes through a custom attention kernel; prefill attends to the exact keys and values of the current chunk and encodes each block of TcT_c loop steps once its last loop step is computed. Efficiency is measured on an NVIDIA RTX 6000 Ada GPU (48 GB), and results on A100 (40 GB) are reported in Appendix § 13.§ 1.

Main results

General benchmarks. Table 2 reports the results on the base models. CQ and TaSQ lose much of the BF16 accuracy already at 0.5 bit, especially on MATH500 and HumanEval. LoopVQ substantially outperforms both baselines at both bitwidths, and TaSQ+LoopVQ further improves on LoopVQ, nearly matching BF16 at 0.5 bit. At 0.25 bit, the advantage of TaSQ+LoopVQ over LoopVQ becomes larger. LoopVQ and TaSQ+LoopVQ also outperform both baselines on Huginn-3.5B.

ModelBitwidthMethodBits (K/V)GSM8KMATH500HumanEvalMBPPAvg.
Ouro-1.4BBF1616/1678.7777.2073.1773.5475.67
Ouro-1.4B0.5 bitCQ0.5/0.546.7817.8014.6350.0032.30
Ouro-1.4B0.5 bitTaSQ0.508/0.557.3238.8024.3953.9743.62
Ouro-1.4B0.5 bitLoopVQ0.5/0.575.8269.4063.4164.5568.29
Ouro-1.4B0.5 bitTaSQ+LoopVQ0.508/0.577.5675.2070.1271.4373.58
Ouro-1.4B0.25 bitCQ0.25/0.2542.9912.2010.9846.5628.18
Ouro-1.4B0.25 bitTaSQ0.258/0.2544.8812.8012.2048.4129.57
Ouro-1.4B0.25 bitLoopVQ0.25/0.2558.9141.2025.6154.5045.05
Ouro-1.4B0.25 bitTaSQ+LoopVQ0.258/0.2570.9663.4055.4959.2662.28
Ouro-2.6BBF1616/1686.1377.4081.1081.2281.46
Ouro-2.6B0.5 bitCQ0.5/0.554.0624.6014.6357.4137.67
Ouro-2.6B0.5 bitTaSQ0.508/0.569.0749.2031.1061.3852.69
Ouro-2.6B0.5 bitLoopVQ0.5/0.585.2274.6075.0075.9377.69
Ouro-2.6B0.5 bitTaSQ+LoopVQ0.508/0.585.3778.6078.6678.5780.30
Ouro-2.6B0.25 bitCQ0.25/0.2547.4614.6012.8053.7032.14
Ouro-2.6B0.25 bitTaSQ0.258/0.2552.9917.6014.0256.0835.18
Ouro-2.6B0.25 bitLoopVQ0.25/0.2570.2052.0028.6660.0552.73
Ouro-2.6B0.25 bitTaSQ+LoopVQ0.258/0.2581.8068.6062.8069.5870.70
Huginn-3.5BBF1616/1634.0412.8017.0735.9824.97
Huginn-3.5B0.5 bitCQ0.5/0.519.035.406.7123.5413.67
Huginn-3.5B0.5 bitTaSQ0.503/0.519.115.8010.3723.8114.77
Huginn-3.5B0.5 bitLoopVQ0.5/0.532.379.4012.8034.9222.37
Huginn-3.5B0.5 bitTaSQ+LoopVQ0.503/0.533.1312.2012.2036.5123.51
Huginn-3.5B0.25 bitCQ0.25/0.2519.117.204.2721.1612.93
Huginn-3.5B0.25 bitTaSQ0.253/0.2519.186.604.8821.1612.96
Huginn-3.5B0.25 bitLoopVQ0.25/0.2525.028.2013.4127.7818.60
Huginn-3.5B0.25 bitTaSQ+LoopVQ0.253/0.2528.139.8013.4132.5420.97

Table 2. General performance under low-bit KV cache quantization. All results use greedy decoding. Bold denotes the best quantized result; higher is better.

Long chain-of-thought reasoning. Table 3 reports the results on the Thinking models. The baselines degrade more severely than on the general benchmarks and fall far below BF16 at both bitwidths. LoopVQ retains most of the BF16 accuracy at 0.5 bit, and combined with TaSQ it preserves much of the reasoning ability even at 0.25 bit, achieving the best result on every benchmark.

ModelBitwidthMethodBits (K/V)AIME’24AIME’25GPQA-DHumanEval+MBPP+Avg.
Ouro-1.4B-ThinkingBF1616/1647.78±5.0947.78 \pm5.0932.22±5.0932.22 \pm5.0945.12±2.2845.12 \pm2.2884.55±0.7084.55 \pm0.7072.49±1.3272.49 \pm1.3256.43±1.5456.43 \pm1.54
0.5 bitCQ0.5/0.51.11±1.921.11 \pm1.922.22±1.922.22 \pm1.9211.78±1.0511.78 \pm1.0527.85±0.7027.85 \pm0.7035.27±2.3135.27 \pm2.3115.65±0.7615.65 \pm0.76
TaSQ0.508/0.54.44±1.924.44 \pm1.925.56±1.925.56 \pm1.9212.12±2.3112.12 \pm2.3135.16±2.1435.16 \pm2.1440.12±2.7240.12 \pm2.7219.48±0.9919.48 \pm0.99
LoopVQ0.5/0.538.89±5.0938.89 \pm5.0931.11±3.8531.11 \pm3.8540.57±1.2740.57 \pm1.2775.81±1.2775.81 \pm1.2767.64±1.1967.64 \pm1.1950.80±1.3550.80 \pm1.35
TaSQ+LoopVQ0.508/0.545.56±8.3945.56 \pm8.3934.44±5.0934.44 \pm5.0942.76±3.0442.76 \pm3.0481.50±1.5381.50 \pm1.5370.11±0.7070.11 \pm0.7054.87±2.0854.87 \pm2.08
0.25 bitCQ0.25/0.250.00±0.000.00 \pm0.001.11±1.921.11 \pm1.9211.62±3.0711.62 \pm3.0725.61±2.7925.61 \pm2.7933.86±0.0033.86 \pm0.0014.44±0.9214.44 \pm0.92
TaSQ0.258/0.252.22±1.922.22 \pm1.921.11±1.921.11 \pm1.9211.45±3.7911.45 \pm3.7927.03±2.8227.03 \pm2.8232.01±0.2632.01 \pm0.2614.76±1.0914.76 \pm1.09
LoopVQ0.25/0.257.78±3.857.78 \pm3.858.89±3.858.89 \pm3.8514.48±4.0814.48 \pm4.0831.50±1.2731.50 \pm1.2737.13±1.4637.13 \pm1.4619.95±1.4119.95 \pm1.41
TaSQ+LoopVQ0.258/0.2536.67±3.3336.67 \pm3.3326.67±5.7726.67 \pm5.7736.53±4.5836.53 \pm4.5876.63±2.3176.63 \pm2.3163.84±0.8563.84 \pm0.8548.07±1.6948.07 \pm1.69
Ouro-2.6B-ThinkingBF1616/1657.78±11.7157.78 \pm11.7151.11±5.0951.11 \pm5.0954.04±3.3154.04 \pm3.3186.18±0.9386.18 \pm0.9375.49±0.8175.49 \pm0.8164.92±2.6564.92 \pm2.65
0.5 bitCQ0.5/0.53.33±0.003.33 \pm0.005.56±1.925.56 \pm1.927.24±3.047.24 \pm3.0430.08±2.7530.08 \pm2.7536.68±1.1036.68 \pm1.1016.58±0.9316.58 \pm0.93
TaSQ0.508/0.510.00±3.3310.00 \pm3.3312.22±1.9212.22 \pm1.9222.73±3.3122.73 \pm3.3143.90±2.7943.90 \pm2.7952.73±1.9952.73 \pm1.9928.32±1.2328.32 \pm1.23
LoopVQ0.5/0.547.78±5.0947.78 \pm5.0935.56±1.9235.56 \pm1.9247.81±2.0447.81 \pm2.0484.76±1.6184.76 \pm1.6174.34±1.3274.34 \pm1.3258.05±1.2458.05 \pm1.24
TaSQ+LoopVQ0.508/0.561.11±3.8561.11 \pm3.8543.33±5.7743.33 \pm5.7751.01±4.6351.01 \pm4.6388.21±0.9388.21 \pm0.9375.49±1.5075.49 \pm1.5063.83±1.7163.83 \pm1.71
0.25 bitCQ0.25/0.252.22±1.922.22 \pm1.923.33±3.333.33 \pm3.338.25±1.548.25 \pm1.5430.89±1.9630.89 \pm1.9638.80±2.9038.80 \pm2.9016.70±1.0916.70 \pm1.09
TaSQ0.258/0.251.11±1.921.11 \pm1.925.56±1.925.56 \pm1.9210.94±0.7710.94 \pm0.7733.33±0.9333.33 \pm0.9339.42±0.2639.42 \pm0.2618.07±0.6018.07 \pm0.60
LoopVQ0.25/0.2510.00±3.3310.00 \pm3.335.56±1.925.56 \pm1.9213.13±3.3113.13 \pm3.3143.50±2.1443.50 \pm2.1448.50±1.2548.50 \pm1.2524.14±1.1324.14 \pm1.13
TaSQ+LoopVQ0.258/0.2543.33±3.3343.33 \pm3.3334.44±5.0934.44 \pm5.0948.15±1.2748.15 \pm1.2782.72±0.3582.72 \pm0.3571.43±1.1571.43 \pm1.1556.02±1.2756.02 \pm1.27

Table 3. Long CoT reasoning performance under low-bit KV cache quantization. All results are averaged over three sampling seeds (mean ±\pm std). Bold denotes the best quantized result; higher is better.

Long-context retrieval. Figure 6 shows the NIAH results, which follow the same ordering. The baselines remain far below BF16 at every context length, while LoopVQ retrieves a large fraction of the needles at 0.5 bit. TaSQ+LoopVQ achieves the highest accuracy at every context length and bitwidth. Results on LongBench, which follow the same trend, are reported in Appendix § 13.§ 5.

RULER needle-in-a-haystack accuracy plots for Ouro-1.4B and Ouro-2.6B under 0.5- and 0.25-bit KV cache quantization

Figure 6. RULER needle-in-a-haystack (NIAH) accuracy of Ouro-1.4B and Ouro-2.6B versus context length under 0.5- and 0.25-bit KV cache quantization (8-bit codes, G=16G=16 and 32). Each point averages the eight NIAH tasks over three seeds.

System efficiency

We measure the serving efficiency of LoopVQ on Ouro-1.4B-Thinking with one RTX 6000 Ada GPU, keeping 8 sink and 64 recent tokens in bf16; results on an A100 GPU are reported in Appendix § 13.§ 1.

Prefill and decoding latency. Prefill with LoopVQ is slightly slower than with BF16, because of the encoding of each block of TcT_c loop steps, and the overhead decreases with the context length (Figure 8a). During decoding, the kernel reads D/cD/c indices per head and token at each loop step, 8× and 16× fewer bytes than the bf16 keys and values. As decoding at long contexts is bound by reading the cache, the reduction in decode latency grows with the context length, reaching about half of the BF16 latency at 32K tokens (Figure 8b). Appendix § 13.§ 3 breaks down the GPU time by kernel type.

Prefill and decode latency of LoopVQ

Figure 8. Latency of LoopVQ at 0.5 and 0.25 bit on Ouro-1.4B-Thinking with one RTX 6000 Ada GPU. (a) Prefill latency and (b) decode latency per token at batch size 1, each with the change relative to BF16.

Batched throughput. For long generation, the batch size is limited by the KV cache (Figure 7). With BF16, only a few requests fit in memory, while LoopVQ can serve tens to over a hundred concurrent requests. At the same batch size LoopVQ is also faster, for the same reason as its lower decode latency. As a result, the peak throughput of LoopVQ exceeds that of BF16 by 3.2× to 4.3×, with the gap widening as the output grows longer and the BF16 batch shrinks. On Ouro-2.6B-Thinking, the BF16 cache holds even fewer requests, and the gain reaches 5.0× to 6.1× (Appendix § 13.§ 2).

End-to-end throughput of LoopVQ for 2K input and 4K, 8K, and 16K output

Figure 7. End-to-end throughput of LoopVQ on Ouro-1.4B-Thinking with one RTX 6000 Ada GPU, versus batch size up to the largest batch that fits in memory.

Discussion

Ablation study

We ablate LoopVQ on Ouro-1.4B with GSM8K and HumanEval; all other settings follow § 5.1.

Components. To isolate the contribution of each component, we apply loop-axis coupling and loop-aware fine-tuning separately to CQ and TaSQ (Table 4). Coupling accounts for most of the gain at both bitwidths. Fine-tuning has little effect on GSM8K, whereas on HumanEval it tends to improve accuracy, most clearly with TaSQ. Combining both components gives the best or tied-best result in every setting. At 0.25 bit, coupling benefits TaSQ more than CQ.

Base+ Coupling+ FTGSM8K 0.5GSM8K 0.25HumanEval 0.5HumanEval 0.25
CQ46.843.014.611.0
CQ✓75.457.561.623.8
CQ✓48.742.514.611.0
CQ✓✓75.858.963.425.6
TaSQ57.344.924.412.2
TaSQ✓77.568.770.150.6
TaSQ✓59.747.131.714.0
TaSQ✓✓77.671.070.155.5

Table 4. Loop-axis coupling and loop-aware fine-tuning (FT) applied to CQ and TaSQ on Ouro-1.4B at 0.5 and 0.25 bits per element. With both, CQ and TaSQ become LoopVQ and TaSQ+LoopVQ. BF16: 78.8 (GSM8K) and 73.2 (HumanEval).

Calibration corpus. We next test whether LoopVQ depends on the choice of calibration data by recalibrating every method on WikiText-2, C4, or SlimPajama (Figure 9). The corpus noticeably affects the baselines, with CQ varying by up to 11 points on GSM8K. TaSQ+LoopVQ is less sensitive overall, varying by at most 4 points on GSM8K and 1 point on HumanEval, and remains the best method on every corpus.

Accuracy of Ouro-1.4B at 0.25 bit with every method calibrated on a different corpus

Figure 9. Accuracy of Ouro-1.4B at 0.25 bit with every method calibrated on a different corpus. GPQA is the calibration set of the main experiments.

Calibration-set size. We then vary the number of 2,048-token GPQA calibration sequences from 8 to 32 (Table 5). Accuracy improves consistently as the set grows, most markedly on HumanEval, and even the smallest set keeps both variants well ahead of the baselines. As calibration takes only minutes (§ 5.1), the set can be enlarged at little cost.

GSM8KHumanEval
Sequences8163281632
LoopVQ57.558.960.822.625.628.0
TaSQ+LoopVQ69.371.071.949.455.559.8

Table 5. Accuracy of Ouro-1.4B at 0.25 bit versus the number of 2,048-token GPQA calibration sequences (16 in the main experiments).

Reasoning stability

When evaluating quantization methods, efficiency is usually measured as throughput or latency per generated token ignoring how many tokens are needed to reach an answer. Compression errors can lengthen reasoning or keep it from terminating, significantly wasting computation and decoding time ([25, 5]). On GPQA-Diamond, CQ and TaSQ exhaust the 32K-token budget on most problems and generate about twice as many tokens as BF16, whereas LoopVQ and TaSQ+LoopVQ follow the length distribution of BF16 (Figure 10). As a result, the throughput gains of LoopVQ (§ 5.4) carry over to the time needed to answer. Appendix § 13.§ 4 extends this analysis, including early termination, to both models and bitwidths.

Generation length on GPQA-Diamond of Ouro-1.4B-Thinking under 0.5-bit KV cache quantization

Figure 10. Generation length on GPQA-Diamond of Ouro-1.4B-Thinking under 0.5-bit KV cache quantization, with the share of problems that reach the 32K-token budget.

Related work

Quantization of LLMs

Weight quantization methods for LLMs include scalar quantization with error compensation or activation-aware scaling ([13, 23]), joint quantization of weights and activations ([1] (Xiao et al. 2023)), and vector quantization with codebooks ([32, 11]). For the KV cache, scalar methods quantize keys and values per channel or per token ([26, 18, 1]), and vector quantization methods code groups of channels jointly ([6, 31] (Zhang et al. 2024)). These methods target non-looped models, where each layer writes one cache, and quantize the caches of different layers independently.

Quantization of looped transformers

The recurrence of looped transformers has motivated quantization methods tailored to it. LoopQ ([12]), LoopQuant (Zhao et al., 2026), and Loopy (Li et al., 2026) quantize the weights and activations of the shared block, accounting for the distribution shift and error accumulation across loop steps. For the KV cache, which dominates the memory of a looped model (Figure 1a), FlashLoop (Yang & Liu, 2026) and ResidualQuant ([20]) apply scalar quantization at 2 to 4 bits per element. LoopVQ instead applies vector quantization along the loop axis to a pretrained model, so that one index codes several loop steps, and compresses the KV cache below one bit per element.

Conclusion

We presented LoopVQ, a KV cache quantization method for looped transformers. LoopVQ groups channels of multiple loop steps into a sub-vector that shares one index, and fine-tunes the codebooks to match the output of the full-precision model, accounting for the different quantization sensitivities of the loop steps. We showed that, at 0.5 and 0.25 bits per element, LoopVQ outperforms existing vector quantization methods on general, reasoning, and long-context benchmarks, and that our SGLang implementation reduces the decode latency and raises the serving throughput over the BF16 baseline. The appendix provides further analysis of the fine-tuning objective, implementation and kernel optimization details, and additional experiment results.

Limitations

Our efficiency evaluation compares LoopVQ with BF16 serving in SGLang and does not include the baseline quantization methods. The serving efficiency of each method depends on kernels optimized for its own cache format, and it is difficult to determine a comparable level of optimization for every method. To avoid a comparison biased toward the method we optimized most, we compare against BF16 serving, which SGLang already supports with highly optimized kernels.

We also do not compare accuracy with FlashLoop (Yang & Liu, 2026) and ResidualQuant [20], the existing KV cache quantization methods for looped transformers. Both apply scalar quantization, which stores at least one bit per element and cannot reach the sub-1-bit regime that LoopVQ targets. They are designed for 2 to 4 bits per element and do not specify a configuration for lower bitwidths, so they cannot be compared with LoopVQ at matched bitwidths.

Analysis of Loop-Aware Fine-Tuning

This appendix supports two statements of § 4.2. First, the shortcomings of Fisher-weighted kk-means cannot be removed by changing its weights, which is why we optimize the output objective (6) directly (Appendix § 10.§ 1). Second, although code assignment is discrete, the codebook entries receive an exact gradient and can be trained by ordinary backpropagation (Appendix § 10.§ 2).

Throughout, ss is a calibration sequence, CC the cache of its unquantized forward pass, and δ=C^(B)−C\delta= \hat{C}(\mathcal{B}) - C the quantization error, viewed as one vector over all tokens, loop steps, layers, heads, and channels.

Limitation of weighted kk-means

A natural alternative to fine-tuning is to improve the weighted kk-means calibration itself (3). We show that no choice of weights can represent the fine-tuning objective (6).

The objective couples coded vectors. For small δ\delta, the KL divergence is quadratic in the error,

J(B)≈12Es[δTFδ],F=1N∑jFj,(7)\mathcal{J}(\mathcal{B}) \approx\frac{1}{2}\mathbb{E}_{s}\left[\delta^{\mathsf{T}}F\delta\right], \qquad F = \frac{1}{N}\sum_j F_j, \tag*{(7)}

where FjF_j is the Fisher information of qjq_j with respect to the cache. Splitting δ\delta into the errors δn=ea(zn)−zn\delta_n = e_a(z_n) - z_n of the individual coded vectors (4),

δTFδ=∑nδnTFnnδn+∑n≠n′δnTFnn′δn′,(8)\delta^{\mathsf{T}}F\delta= \sum_n \delta_n^{\mathsf{T}}F_{nn}\delta_n + \sum_{n\ne n'}\delta_n^{\mathsf{T}}F_{nn'}\delta_{n'}, \tag*{(8)}

where Fnn′F_{nn'} is the block of FF that pairs vectors nn and n′n'. The cross terms Fnn′F_{nn'} connect, among others, the codes of a token at different loop steps and layers: by the recurrence (1), the error of an early loop step propagates to the later loop steps and interacts with their errors.

A weighted kk-means objective cannot express the cross terms. Any weighted kk-means objective, Fisher-weighted kk-means included, is a sum of terms that each depend on a single coded vector, ∑nδnTWnδn\sum_n \delta_n^{\mathsf{T}}W_n\delta_n; Fisher-weighted kk-means sets Wn=ωnIW_n = \omega_n I. Since each term involves only one vector, kk-means can assign every vector to its nearest entry independently of the others and update each entry from the vectors assigned to it. For the same reason, such an objective can at best match the diagonal blocks FnnF_{nn} of (8) and always drops the cross terms. A better WnW_n could account for the unequal sensitivity of the loop steps within a coded vector (§ 3), but not for the interaction between coded vectors. Fine-tuning minimizes (6) itself, which keeps both and, unlike any quadratic surrogate, also holds for large errors.

Gradient with respect to the codebook entries

Vector quantization selects entries by an arg min, which has no useful derivative. We show that the codebook entries nevertheless receive an exact gradient, because the selection does not need to be differentiated.

The reconstruction C^(B)\hat{C}(\mathcal{B}) depends on B\mathcal{B} through the assignments a(zj)a(z_j) and the decoding (5). The coupled vectors zjz_j are formed from the unquantized cache CC and do not depend on B\mathcal{B}. Each assignment a(zj)a(z_j) is constant as long as the nearest entry of zjz_j does not change, i.e., everywhere except on the measure-zero set of codebooks for which zjz_j is equidistant from two entries. Off that set, ∂a(zj)/∂B=0\partial a(z_j)/\partial\mathcal{B}=0, and (5), which copies coordinate iTc+miT_c+m of the selected entry into the reconstruction of loop step βTc+m+1\beta T_c+m+1, is linear in that entry. For an entry ere_r of Bβ,ℓ,h,g\mathcal{B}_{\beta,\ell,h,g}, the chain rule gives

[∂J∂er]iTc+m=∑j:a(zj)=r∂J∂x^j,h,gc+i(βTc+m+1,ℓ)(9)\left[\frac{\partial\mathcal{J}}{\partial e_r}\right]_{iT_c+m} = \sum_{j:a(z_j)=r} \frac{\partial\mathcal{J}}{\partial\hat{x}^{(\beta T_c+m+1,\ell)}_{j,h,g_c+i}} \tag*{(9)}

for i<ci<c and m<Tcm<T_c, where the sum runs over the calibration tokens assigned to ere_r. Each entry accumulates the gradient of every token assigned to it, at each of the TcT_c loop steps it covers. Because the coupled vectors zjz_j do not depend on B\mathcal{B}, no straight-through estimator is needed.

In practice, the backward pass runs in two stages: through the network down to the reconstructed cache, and then from the cache to the entries via (9), in chunks of tokens. This yields the same gradient as a single backward pass through one graph while bounding the memory of the second stage. After each update, the assignments are recomputed with the current codebooks.

Orthogonal application with TaSQ

TaSQ ([6]) improves key quantization along the channel axis: it transforms the channels of each key so that those sharing a code are correlated and the reconstruction error reflects the attention logits. LoopVQ is orthogonal to it, as it shares codes along the loop axis. TaSQ+LoopVQ applies TaSQ’s transform before loop-axis coupling, so that each code groups correlated channels across correlated loop steps.

Formulation

TaSQ maps the pre-RoPE key of loop step tt in block β\beta, layer ℓ\ell, and head hh to

uj,h(t,ℓ)=Pβ,ℓ,hwh(t,ℓ)⊙kj,h(t,ℓ)σj(t,ℓ),(10)u^{(t,\ell)}_{j,h} = P_{\beta,\ell,h} \frac{w^{(t,\ell)}_h \odot k^{(t,\ell)}_{j,h}}{\sigma^{(t,\ell)}_j}, \tag*{(10)}

where wh(t,ℓ)w^{(t,\ell)}_h weights each channel by the second moment MM of the post-RoPE queries that read this cache, wi2∝Miiw_i^2 \propto M_{ii}, σj(t,ℓ)\sigma^{(t,\ell)}_j is the root mean square of w⊙kw\odot k over all heads and channels of token jj, and Pβ,ℓ,hP_{\beta,\ell,h} is a channel permutation. TaSQ+LoopVQ builds the coupled key vectors (4) from uu instead of kk,

[zj(β,ℓ,h,g)]iTc+m=uj,h,gc+i(βTc+m+1,ℓ),i<c, m<Tc,(11)\left[z^{(\beta,\ell,h,g)}_j\right]_{iT_c+m} = u^{(\beta T_c+m+1,\ell)}_{j,h,g_c+i}, \qquad i<c,\ m<T_c, \tag*{(11)}

so that each code spans cc channels chosen by PP along the channel axis and TcT_c loop steps along the loop axis.

Grouping under loop coupling

In TaSQ, PP groups channels with high covariance into the same code, keeping each RoPE pair {i,i+D/2}\{i,i+D/2\} together so that RoPE can be applied after decoding. Under (11), a code contains the same channels at all TcT_c loop steps, so the grouping must be shared by the loop steps of a block. We compute Pβ,ℓ,hP_{\beta,\ell,h} from the covariance of the transformed keys of the whole block,

Σβ,ℓ,h=Cov⁡j[k~j,h(βTc+1,ℓ),…,k~j,h(βTc+Tc,ℓ)],(12)\Sigma_{\beta,\ell,h} = \operatorname{Cov}_j\left[\tilde{k}^{(\beta T_c+1,\ell)}_{j,h},\ldots,\tilde{k}^{(\beta T_c+T_c,\ell)}_{j,h}\right], \tag*{(12)}

a TcD×TcDT_cD\times T_cD matrix over the stacked loop steps with k~=w⊙k/σ\tilde{k}=w\odot k/\sigma, and group RoPE pairs taken at all TcT_c loop steps (2Tc2T_c coordinates) until a group holds G=cTcG=cT_c coordinates. This grouping accounts for the correlation between channels both within and across loop steps.

Calibration and bitwidth

The Fisher weights of (3) are computed with respect to uu. During fine-tuning (§ 4.2), ww and PP are fixed and σ\sigma is recomputed from the keys. TaSQ in fp16 costs 16/(HD)16/(HD) bits per key element, about 0.008 on Ouro and 0.003 on Hugin, which gives the key bitwidths of TaSQ and TaSQ+LoopVQ in Table 2.

Optimizing pre-RoPE vector quantization serving efficiency

LoopVQ, like CQ and TaSQ, quantizes keys before the rotary embedding (RoPE) (§ 2), since RoPE rotates the same key differently at every position and would spread the keys of one channel group over many more codebook entries. The decode attention kernel then has to apply RoPE to every reconstructed key (Algorithm 1), which requires the cosine and sine of D/2D/2 frequencies at the position of each cached token. Evaluating them in the kernel adds transcendental operations for every token and frequency, so the kernel reads them from a table precomputed for all positions, one row of DD values per position.

With one request per thread block, every block reads the table row of each token it attends to, and the blocks of different requests read the same rows again. At large batch sizes these reads account for about 40% of the kernel time. Since a token’s RoPE position depends only on its index in the sequence, the rows needed by two requests coincide wherever both requests have a token. The kernel assigns two requests to each thread block and cuts both into splits at the same boundaries, sized by the longer request, so that one load of a table row serves the tokens of both requests at the same index. The two requests also share the codebook slices BtkB_t^k and BtvB_t^v staged in shared memory, which halves the codebook loads per request. The shared-memory buffers of each request are halved accordingly, so a block uses the same shared memory as with one request. Each lane further handles the two channel groups that share the same frequencies, so that it loads their cosines and sines with single vector loads. At batch size 1 the kernel processes one request per block.

On an RTX 6000 Ada GPU with Ouro-1.4B-Thinking, this kernel reduces the decode attention time at batch size 64 and a 6K-token context by 37% and 48% at 0.5 and 0.25 bit compared with one request per block, and raises the end-to-end throughput at batch size 64 with 2K-token prompts and 1K-token outputs by 46% and 63%.

Additional experiment results

Efficiency results on an A100 (40 GB) GPU

We repeat the measurements of § 5.4 on one NVIDIA A100 (40 GB) GPU with the same settings. The results follow the same trends as on the RTX 6000 Ada. The prefill overhead of LoopVQ decreases with the context length, and the reduction in decode latency grows with it, reaching about half of the BF16 latency at 32K tokens (Figure 11). As BF16 fits only a few long requests in memory, the peak throughput of LoopVQ exceeds that of BF16 by 2.8× to 3.7× (Figure 12). On the A100, the k-means calibration and the fine-tuning take 5.5 and 2.0 minutes for Ouro-1.4B and 11.2 and 4.6 minutes for Ouro-2.6B.

Latency of LoopVQ at 0.5 and 0.25 bit on Ouro-1.4B-Thinking with one A100 (40 GB) GPU

Figure 11. Latency of LoopVQ at 0.5 and 0.25 bit on Ouro-1.4B-Thinking with one A100 (40 GB) GPU. (a) Prefill latency and (b) decode latency per token at batch size 1, each with the change relative to BF16.

End-to-end throughput of LoopVQ on Ouro-1.4B-Thinking with one A100 (40 GB) GPU, versus batch size

Figure 12. End-to-end throughput of LoopVQ on Ouro-1.4B-Thinking with one A100 (40 GB) GPU, versus batch size up to the largest batch that fits in memory.

Efficiency results on Ouro-2.6B-Thinking

We repeat the measurements of § 5.4 on Ouro-2.6B-Thinking with the same GPU and settings. Prefill with LoopVQ is 5 to 9% slower than with BF16, and the decode latency at 16K tokens is about 35% lower (Figure 13). As Ouro-2.6B has twice as many layers as Ouro-1.4B, BF16 fits only one to three long requests in memory, and the peak throughput of LoopVQ exceeds that of BF16 by 5.0× to 6.1× (Figure 14).

Latency of LoopVQ at 0.5 and 0.25 bit on Ouro-2.6B-Thinking

Figure 13. Latency of LoopVQ at 0.5 and 0.25 bit on Ouro-2.6B-Thinking with one RTX 6000 Ada GPU. (a) Prefill latency and (b) decode latency per token at batch size 1, each with the change relative to BF16.

End-to-end throughput of LoopVQ on Ouro-2.6B-Thinking with one RTX 6000 Ada GPU, versus batch size up to the largest batch that fits in memory

Figure 14. End-to-end throughput of LoopVQ on Ouro-2.6B-Thinking with one RTX 6000 Ada GPU, versus batch size up to the largest batch that fits in memory.

Time profile breakdown

Figure 15 breaks down the GPU time by kernel type, measured with the PyTorch profiler under the settings of § 5.4. During decoding, the linear layers take the same time in all methods, and the difference comes from attention. With BF16, attention grows with the context length and accounts for most of the decode time at 32K tokens, whereas with LoopVQ it stays below the time of the linear layers. At batch size 16, attention takes 1.87 ms per generated token with BF16 and 0.63 and 0.54 ms with LoopVQ at 0.5 and 0.25 bit. Encoding takes under 1% of the decode time and 5 to 7% of the prefill time.

GPU time of LoopVQ and BF16 on Ouro-1.4B-Thinking with one RTX 6000 Ada GPU, by kernel type

Figure 15. GPU time of LoopVQ and BF16 on Ouro-1.4B-Thinking with one RTX 6000 Ada GPU, by kernel type. (a) Decode time per token at batch size 1. (b) Decode time per generated token at batch size 16 with 2K-token prompts. (c) Prefill time. Attention includes the bf16 window, the LoopVQ kernel, and the merge of their splits.

Reasoning stability across models and bitwidths

Figure 16 extends Figure 10 to both Thinking models and both bitwidths. CQ and TaSQ exhaust the generation budget on a large share of problems in every setting. TaSQ+LoopVQ follows the length distribution of BF16 in all four settings, and LoopVQ does so at 0.5 bit.

Generation length on GPQA-Diamond of Ouro-1.4B-Thinking and Ouro-2.6B-Thinking under 0.5- and 0.25-bit KV cache quantization

Figure 16. Generation length on GPQA-Diamond of Ouro-1.4B-Thinking and Ouro-2.6B-Thinking under 0.5- and 0.25-bit KV cache quantization, with the share of problems that reach the 32K-token budget.

Quantization errors can also end the reasoning early. With BF16, 16% and 22% of the generations of Ouro-1.4B-Thinking and Ouro-2.6B-Thinking end within 2K tokens. At 0.25 bit, this share rises to 33% and 59% with CQ and to 30% and 47% with TaSQ, whereas it stays at or below 30% with LoopVQ and TaSQ+LoopVQ in every setting.

LongBench results

We also evaluate the base models on the 16 English tasks of LongBench ([3]), using the official prompts and metrics, greedy decoding, and prompts truncated in the middle to 64K tokens. As in the other long-context experiments, 64 sink and 256 recent tokens are kept in bf16. CQ and TaSQ fall 7 to 13 points below the BF16 average (Table 6). LoopVQ outperforms both baselines on average in every setting, and TaSQ+LoopVQ comes within 1.5 points of BF16 at 0.5 bit and achieves the highest average at both bitwidths.

ModelBitwidthMethodNrtvQAQasperMF-enHotpotQA2WikiMQAMusiqueGovReportQMSumMultiNewsTRECTriviaQASAMSumPCountPReLccRB-PAvg.
Ouro-1.4BBF167.8123.5634.7533.1719.7513.1526.9420.5223.0864.5088.5736.181.5032.5019.9928.7229.67
0.5 bitCQ4.9310.3822.1020.1816.358.0816.8817.4415.7244.0079.1233.071.504.5019.6827.9521.37
TaSQ7.0213.3925.0524.9017.469.2218.3817.8816.5847.0081.7934.071.004.5021.8527.8723.00
LoopVQ7.3119.2930.7132.6319.2312.8223.7318.9421.0658.5087.8035.612.0016.0022.0929.6027.33
TaSQ+LoopVQ8.1122.8433.3434.5618.8912.6026.0719.6822.1564.0089.0336.091.5023.0022.1630.5529.04
0.25 bitCQ4.299.2221.1320.5116.837.1715.7917.1114.9644.5078.4433.011.004.5020.5528.4521.09
TaSQ5.6910.4621.6520.7316.566.7616.5017.2215.6945.0079.2031.981.004.5020.5427.6921.32
LoopVQ5.8113.1822.9824.1817.059.3019.1617.7917.0045.0082.5034.211.504.5021.6928.9722.80
TaSQ+LoopVQ6.4019.6130.4832.5718.7112.6722.8818.3619.7756.5087.0934.391.006.5022.0529.6926.17
Ouro-2.6BBF169.9031.5447.8042.3839.1628.0028.0823.5325.7372.0088.7613.500.0070.0036.9537.4637.18
0.5 bitCQ7.4915.8631.7326.2931.4913.4217.5819.1816.7048.5081.2812.040.007.0038.9133.6025.07
TaSQ8.4117.8235.2432.5133.2420.2419.0319.1717.7452.0085.7411.250.009.0040.4735.8127.35
LoopVQ10.2125.5345.3041.8435.0323.2022.6121.3222.3962.0088.9313.210.0027.0040.3839.2232.39
TaSQ+LoopVQ9.8329.4148.4643.1838.9326.1125.8022.3824.3972.0089.0112.870.0049.0039.7339.9335.69
0.25 bitCQ7.4815.2231.2025.6030.7312.9116.8418.8415.1747.0081.1212.070.007.5038.5133.8524.63
TaSQ6.9315.1931.5426.2731.3614.8617.1318.6615.9647.5082.3711.040.007.5039.3734.4825.01
LoopVQ8.9318.1335.2930.6932.3516.5919.2719.4918.6450.5086.1412.560.008.0038.8136.4026.99
TaSQ+LoopVQ8.9023.4243.6041.7334.7225.4021.6220.2920.9366.5088.5112.240.0028.5040.6438.5632.22

Table 6. LongBench performance of Ouro-1.4B and Ouro-2.6B under low-bit KV cache quantization on the 16 English tasks, with the official metric of each task. All results use greedy decoding. Bold denotes the best quantized result; higher is better.

References

  1. [1]Ashkboos, S., Mohtashami, A., Croci, M. L., Li, B., Cameron, P., Jaggi, M., Alistarh, D., Hoefler, T., and Hensman, J. Quarot: Outlier-free 4-bit inference in rotated llms. Advances in Neural Information Processing Systems, 37:100213–100240, 2024.arxiv.org/abs/2404.00456
  2. [2]Austin, J., Odena, A., Nye, M., Bosma, M., Michalewski, H., Dohan, D., Jiang, E., Cai, C., Terry, M., Le, Q., and Sutton, C. Program Synthesis with Large Language Models. arXiv e-prints, art. arXiv:2108.07732, August 2021. doi: 10.48550/arXiv.2108.07732.DOI
  3. [3]Bai, Y., Lv, X., Zhang, J., Lyu, H., Tang, J., Huang, Z., Du, Z., Liu, X., Zeng, A., Hou, L., Dong, Y., Tang, J., and Li, J. LongBench: A Bilingual, Multitask Benchmark for Long Context Understanding. arXiv e-prints, art. arXiv:2308.14508, August 2023. doi: 10.48550/arXiv.2308.14508.DOI
  4. [4]Chen, M., Tworek, J., Jun, H., Yuan, Q., Ponde de Oliveira Pinto, H., Kaplan, J., Edwards, H., Burda, Y., Joseph, N., Brockman, G., Ray, A., Puri, R., Krueger, G., Petrov, M., Khlaaf, H., Sastry, G., Mishkin, P., Chan, B., Gray, S., Ryder, N., Pavlov, M., Power, A., Kaiser, L., Bavarian, M., Winter, C., Tillet, P., Petroski Such, F., Cummings, D., Plappert, M., Chantziz, F., Barnes, E., Herbert-Voss, A., Hebgen Guss, W., Nichol, A., Paino, A., Tezak, N., Tang, J., Babuschkin, I., Balaji, S., Jain, S., Saunders, W., Hesse, C., Carr, A. N., Leike, J., Achiam, J., Misra, V., Morikawa, E., Radford, A., Knight, M., Brundage, M., Murati, M., Mayer, K., Welinder, P., McGrew, B., Amodei, D., McCandlish, S., Sutskever, I., and Zaremba, W. Evaluating Large Language Models Trained on Code. arXiv e-prints, art. arXiv:2107.03374, July 2021. doi: 10.48550/arXiv.2107.03374.arxiv.org/abs/2107.03374
  5. [5]Cheong, M., Lim, W., Yun, V.-D., and Yoo, S. KV-rescue: Recovering reasoning language model kv eviction loss via stepwise interleaving. arXiv preprint arXiv:2608.15797, 2026a.arxiv.org/abs/2608.15797
  6. [6]Cheong, M., Son, D., and Yoo, S. Tailoring the quantization space for 1-bit kv cache compression. arXiv preprint arXiv:2610.03027, 2026b.arxiv.org/abs/2610.03027
  7. [7]Cobbe, K., Kosaraju, V., Bavarian, M., Chen, M., Jun, H., Kaiser, L., Plappert, M., Tworek, J., Hilton, J., Nakano, R., Hesse, C., and Schulman, J. Training Verifiers to Solve Math Word Problems. arXiv e-prints, art. arXiv:2110.14168, October 2021. doi: 10.48550/arXiv.2110.14168.DOI
  8. [8]Dao, T. Flashattention-2: Faster attention with better parallelism and work partitioning. In International Conference on Learning Representations, volume 2024, pp. 35549–35562, 2024.arxiv.org/abs/2307.08691
  9. [9]Dao, T., Haziza, D., Massa, F., and Sizov, G. Flash-decoding for long-context inference. https://crfm.stanford.edu/2023/10/12/flashdecoding.html, 2023.
  10. [10]Dehghani, M., Gouws, S., Vinyals, O., Uszkoreit, J., and Kaiser, Ł. Universal transformers. arXiv preprint arXiv:1807.03819, 2018.arxiv.org/abs/1807.03819
  11. [11]Egiazarian, V., Panferov, A., Kuznedelev, D., Frantar, E., Babenko, A., and Alistarh, D. Extreme compression of large language models via additive quantization. arXiv preprint arXiv:2401.06118, 2024.arxiv.org/abs/2401.06118
  12. [12]Fang, R., Chen, H.-W., Cheng, C.-M., and Chen, M.-S. SLoopQ: Quantization for Looped Language Models. arXiv e-prints, art. arXiv:2605.16343, May 2026. doi: 10.48550/arXiv.2605.16343.DOI
  13. [13]Frantar, E., Ashkboos, S., Hoefler, T., and Alistarh, D. Gptq: Accurate post-training quantization for generative pre-trained transformers. arXiv preprint arXiv:2210.17323, 2022.arxiv.org/abs/2210.17323
  14. [14]Geiping, J., McLeish, S., Jain, N., Kirchenbauer, J., Singh, S., Bartoldson, B., Kaikhura, B., Bhatele, A., and Goldstein, T. Scaling up test-time compute with latent reasoning: A recurrent depth approach. Advances in Neural Information Processing Systems, 38:41340–41391, 2026.arxiv.org/abs/2502.05171
  15. [15]Giannou, A., Rajput, S., Sohn, J.-y., Lee, K., Lee, J. D., and Papailiopoulos, D. Looped transformers as programmable computers. In International Conference on Machine Learning, pp. 11398–11442. PMLR, 2023.arxiv.org/abs/2301.13196
  16. [16]Grattafiori, A., Dubey, A., Jauhari, A., Pandey, A., Kadian, A., Al-Dahle, A., Letman, A., Mathur, A., Schelten, A., Vaughan, A., Yang, A., Fan, A., Goyal, A., Hartshorn, A., Yang, A., Mitra, A., Sravankumar, A., Korenev, A., Hinsvark, A., Rao, A., Zhang, A., Rodriguez, A., Gregerson, A., Spataru, A., Roziere, B., Biron, B., Tang, B., Chern, B., Cauchois, C., Nayak, C., Bi, C., Marra, C., McConnell, C., Keller, C., Touret, C., Wu, C., Wong, C., Canton Ferrer, C., Nikolaidis, C., Allonsius, D., Song, D., Pintz, D., Livshits, D., Wyatt, D., Esiobu, D., Choudhary, D., Mahajan, D., Garcia-Olano, D., Perino, D., Hupkes, D., Lakomkin, E., AlBadawy, E., Lobanova, E., Dinan, E., Smith, E. M., Radnovic, F., Guzmán, F., Zhang, F., Synnaeve, G., Lee, G., Anderson, G. L., Thattai, G., Nail, G., Mialon, G., Pang, G., Cucurell, G., Nguyen, H., Korevaar, H., Xu, H., Touvron, H., Zarov, I., Arrieta Ibarra, I., Klopman, I., Misra, I., Evtimov, I., Zhang, J., Copet, J., Lee, J., Geffert, J., Vranes, J., Park, J., Mahadeokar, J., Shah, J., van der Linde, J., Billock, J., Hong, J., Lee, J., Fu, J., Chi, J., Huang, J., Liu, J., Wang, J., Yu, J., Bitton, J., Spisak, J., Park, J., Rocca, J., Johnston, J., Saxe, J., Jia, J., Vasuden Alwala, K., Prasad, K., Upasani, K., Plawiak, K., Li, K., Heafield, K., Stone, K., El-Arini, Lin, L., Tang, J., Tang, H., Yang, S., Chen, W-M. Wang, K., Iyer, K., Mali, K., Chiu, K., Bhalla, K., Lakhotia, K., W.-C., Xiao, G., Dang, X., Gan, C., and Han, S. Awq: Activation-aware weight quantization for on-device llm compression and acceleration. Proceedings of machine learning and systems, 6:87–100, 2024. Rantala-Yearly, L., van der Maaten, L., Chen, L., Tan, L., Jenkins, L., Martin, L., Madaan, L., Malo, L., Blecher, L., Landzaat, L., de Oliveira, L., Muzzi, M., Pasupuleti, M., Singh, M., Paluri, M., Kardas, M., Tsimpoukelli, M., Oldham, M., Rita, M., Pavlova, M., Kambadur, M., Lewis, M., Si, M., Singh, M. K., Hassan, M., Goyal, N., Torabi, N., Bashlykov, N., Bogoychev, N., Chatterji, N., Zhang, N., Duchenne, O., Çelebi, O., Alrassy, P., Zhang, P., Li, P., Vasic, P., Weng, P., Bhargava, P., Dubal, P., Krishnan, P., Singh Koura, P., Xu, P., He, Q., Dong, Q., Srinivasan, R., Ganapathy, R., Calderer, R., Silveira Cabral, R., Stojnic, R., Raileanu, R., Maheswari, R., Girdhar, R., Patel, R., Sauvestre, R., Polidoro, R., Sumbaly, R., Taylor, R., Silva, R., Hour, R., Wang, R., Hosseini, S., Chennabasappa, S., Singh, S., Bell, S., Kim, S. S., Edunov, S., Nie, S., Narang, S., Raparthy, S., Shen, S., Wan, S., Bhosale, S., Zhang, S., Vandendriessche, S., Batra, S., Whitman, S., Soolia, S., Collot, S., Gururangan, S., Borodinsky, S., Herman, T., Fowler, T., Sheasha, T., Georgiou, T., Scialom, T., and Speckbacher, T. The Llama 3 Herd of Models. arXiv e-prints, art. arXiv:2407.21783, July 2024. doi: 10.48550/arXiv.2407.21783.
  17. [17]Hinton, G., Vinyals, O., and Dean, J. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.arxiv.org/abs/1503.02531
  18. [18]Hooper, C., Kim, S., Mohammadzadeh, H., Mahoney, M. W., Shao, Y. S., Keutzer, K., and Gholami, A. Kvquant: Towards 10 million context llm inference with kv cache quantization. Advances in Neural Information Processing Systems, 37:1270–1303, 2024.arxiv.org/abs/2401.18079
  19. [19]Hsieh, C.-P., Sun, S., Kriman, S., Acharya, S., Rekesh, D., Jia, F., Zhang, Y., and Ginsburg, B. Ruler: What’s the real context size of your long-context language models? arXiv preprint arXiv:2404.06654, 2024.arxiv.org/abs/2404.06654
  20. [20]Kim, H., Lee, J., Cho, S., Han, D., Han, I., and Kim, S. Residualquant: Kv cache quantization for looped transformers with 2-bit residuals. arXiv preprint arXiv:2610.10381, 2026.arxiv.org/abs/2610.10381
  21. [22]Lightman, H., Kosaraju, V., Burda, Y., Edwards, H., Baker, B., Lee, T., Leike, J., Schulman, J., Sutskever, I., and Cobbe, K. Let’s verify step by step. In International Conference on Learning Representations, volume 2024, pp. 39578–39601, 2024.arxiv.org/abs/2305.20050
  22. [23]Lin, J., Tang, J., Tang, H., Yang, S., Chen, W.-M., Xiao, G., Dang, X., Gan, C., and Han, S. Awq: Activation-aware weight quantization for on-device llm compression and acceleration. Proceedings of machine learning and systems, 6:87–100, 2024.DOI
  23. [24]Liu, J., Xia, C. S., Wang, Y., and Zhang, L. Is your code generated by chatgpt really correct? rigorous evaluation of large language models for code generation. Advances in neural information processing systems, 36:21558–21572, 2023.arxiv.org/abs/2305.01210
  24. [25]Liu, M., Palnitkar, A., Rabbani, T., Jae, H., Rui Sang, K., Yao, D., Shabihi, S., Zhao, F., Li, T., Zhang, C., Huang, F., and Zhang, K. Hold Onto That Thought: Assessing KV Cache Compression On Reasoning. arXiv e-prints, art. arXiv:2512.12008, December 2025. doi: 10.48550/arXiv.2512.12008.DOI
  25. [26]Liu, Z., Yuan, J., Jin, H., Zhong, S., Xu, Z., Braverman, V., Chen, B., and Hu, X. Kivi: A tuning-free asymmetric 2bit quantization for kv cache. arXiv preprint arXiv:2402.02750, 2024.DOI
  26. [27]Malinovskii, V., Mazur, D., Ilin, I., Kuznedelev, D., Burlachenko, K., Yi, K., Alistarh, D., and Richtarik, P. Pv-tuning: Beyond straight-through estimation for extreme llm compression. Advances in Neural Information Processing Systems, 37:5074–5121, 2024.arxiv.org/abs/2405.14852
  27. [28]Mathematical Association of America. American invitational mathematics examination (AIME). https://maa.org/math-competitions/american-invitational-mathematics-examination-aime, 2025.
  28. [29]Rein, D., Hou, B. L., Stickland, A. C., Petty, J., Pang, R. Y., Dirani, J., Michael, J., and Bowman, S. R. Gpqa: A graduate-level google-proof q&a benchmark. arXiv preprint arXiv:2311.12022, 2023.arxiv.org/abs/2311.12022
  29. [30]Saunshi, N., Dikkala, N., Li, Z., Kumar, S., and J Reddi, S. Reasoning with latent thoughts: On the power of looped transformers. In International Conference on Learning Representations, volume 2025, pp. 14855–14881, 2025.arxiv.org/abs/2502.17416
  30. [31]Son, D., Choi, E., and Yoo, S. Nsnquant: A double normalization approach for calibration-free low-bit vector quantization of kv cache. Advances in Neural Information Processing Systems, 38:43124–43159, 2026.arxiv.org/abs/2505.18231
  31. [32]Tseng, A., Chee, J., Sun, Q., Kuleshov, V., and De Sa, C. Quip#: Even better llm quantization with hadamard incoherence and lattice codebooks. Proceedings of machine learning research, 235:48630, 2024.arxiv.org/abs/2402.04396

Paper details

vlnc:W_7srt5hed
v1 · latestHistory (1)

published · Fresh — added to the Hub within the last 30 days

added ·

Usage

views · 10

downloads · 0

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

CC BY 4.0

Original source

  • Computer Science

Not recorded for this paper · View statement →

Looking for related papers…
Contents