Manuscript Offprint

arXiv:2611.04137

LoopKV: Loop-Aware KV Cache Compression for Serving Looped Transformers

Tianle Zhou, Yang Zhang, Tianyu Wu, Zhuohan Wang, William Nixon, Juncheng Yang

ABSTRACT

Looped transformers apply a shared block several times per token to improve accuracy without adding parameters. For models such as Ouro that keep a separate key-value (KV) cache per loop, cache memory limits the batch size that amortizes repeated weight reads. Uniform-bit quantization and fixed rules per loop do not allocate precision according to each layer's sensitivity in each loop. Measurements on Ouro show that quantization sensitivity varies across (loop, layer) cells, and the sum of individual cell damages approximates the overall output damage. Sharing damage also varies by cell, with later loops generally tolerating sharing better. Skipping low-attention values to save reads produces errors that compound across loops. LoopKV uses a one-time offline profile to choose 4-bit storage, 2-bit storage or reuse of the final loop's KV for each cell. The planner minimizes reads under budgets for predicted damage and storage. During decoding, each loop reads the high 2 bits of each 4-bit value and fetches the low bits only where its own attention weights require 4-bit precision. A single fused kernel in vLLM executes the plan. Serving Ouro-1.4B on one RTX PRO 6000, the memory-optimized LoopKV-M plan stores 35% less KV than uniform 4-bit quantization (KIVI-4) on the same fused kernel and CUDA graph. It sustains 1.7–2.2× KIVI-4's goodput under a latency service-level objective with a 16K-token maximum length. None of its averages on six public benchmarks falls significantly below BF16's.

Figure

Figure 1. Overview of LoopKV. The offline phase of LoopKV, run once per model, chooses a storage option for every (loop, layer) pair, which we call a cell, from the KL damage measured by profiling each cell independently (C1). A cell may reuse the final loop's KV through a pointer when its KL damage is low, which we show costs little accuracy (C2). In the online phase, V is stored as a high and a low 2-bit plane, so that the attention scores decide at decode time which tokens also read the low plane (C3). We then combine all three into one fused kernel that runs every cell type in a single launch. With vLLM's whole-step CUDA graph, this cuts LoopKV-M's host launches per decode step from 504 to 17.

*Equal contribution. ¹Harvard University ²University of California San Diego ³University of Chicago. Correspondence to: Tianle Zhou tianle_zhou@fas.harvard.edu.

1 INTRODUCTION

Looped transformers, which reuse one block of layers for several iterations per token, are increasingly used as an architectural component of large language models (Dehghani et al., 2019; Saunshi et al., 2025). Because every iteration reuses the same weights, a looped model reaches the effective depth of a much deeper model, i.e., the number of layers times the number of loops, while storing far fewer layers. It therefore needs less memory to hold its parameters and achieves higher accuracy per parameter (Saunshi et al., 2025). For example, Ouro matches standard models with two to three times its parameter count by looping its layers four times (Zhu et al., 2025). Huginn, with 3.5B parameters, keeps improving its reasoning as it iterates its recurrent block more, up to a compute load equivalent to a 50B-parameter model (Geiping et al., 2025). Mixture-of-Recursions chooses for each token how many times the shared block runs and reaches lower perplexity than standard transformers at equal training compute with fewer unique parameters (Bae et al., 2025b;a).

Serving these models, however, is costly, because for some of them the KV cache is large and each decode step reads many more KV blocks from memory than a standard model of the same size does. Ouro, for example, keeps a separate KV cache for every loop, so Ouro-1.4B stores 768 KiB of KV per token in BF16, four times what a dense model with the same layers would store, and every decode step re-reads its 2.5 GB of weights four times. A larger batch amortizes these weight re-reads, but then KV memory becomes the bottleneck, because the cache stored per request sets how many requests fit in a batch and the bytes read per step set the decode time (§2.2). At BF16's peak-throughput batch for 8K-token contexts on Ouro-1.4B, the KV cache accounts for 84% of the bytes each decode step reads. In this setting, compressing the cache raises both the batch size and the decoding speed, which is the key to higher throughput and goodput.

General KV quantization methods, including FP8, KIVI (Liu et al., 2024b), KVQuant (Hooper et al., 2024) and rotation-based methods (Ashkboos et al., 2024; Zandieh et al., 2025), treat each loop of a looped transformer as one more layer with the same bits. Only a few works target the features specific to looped transformers, and we find two concurrent works that exploit the loop structure. FlashLoop updates only a subset of tokens in each loop, guides each loop's sparse attention with the previous loop and quantizes chained INT4 residuals (Yang & Liu, 2026). ResidualQuant keeps an INT4 copy of the final loop and stores only 2-bit residuals for every earlier loop (Kim et al., 2026). Both assign precision on a per-loop basis. A per-loop setting, however, treats every layer of a loop alike, which is harmful when the layers within a loop behave differently.

Figure

Figure 2. P1: damage depends on the cell. Each point shows the damage when one cell (one layer in one loop) is stored at INT2 while every other cell stays exact. The damage on the y-axis is the share of next-token predictions that change (fp32, 16 documents). The top 19 of the 72 cells hold half of the total difference, and KL ranks the cells alike (Spearman 0.95).

For example, our experiments show that under aggressive quantization a few middle layers cause most of the damage, while some later layers are much less sensitive (§2.4). Some layers can therefore use fewer bits and leave more of the budget to the layers that matter more. What remains missing is a decision at the granularity of each (loop, layer) pair, e.g., which precision each pair needs and whether a pair can reuse another loop's KV instead of storing its own when its damage is low enough.

We propose LoopKV, which compresses the KV cache of looped transformers at the granularity of a (loop, layer) pair, which we call a cell. LoopKV first profiles the damage of each cell offline and then jointly chooses every cell's precision and whether it shares the final loop's KV, so that the bytes saved on robust cells can be spent on the more sensitive ones. This planner minimizes the bytes read per decode step under budgets for KL damage and storage. Looping also raises two questions that a transformer with one KV cache per layer does not, i.e., whether the KV of the late loops converges enough to be shared, and whether an error introduced in one loop compounds as later loops process it again. Our measurements of Ouro's KV cache answer both questions and show why the decision must be made per cell rather than per loop (§2.4, Figures 2–4).

(P1) Sensitivity depends on the cell: a few cells cause most of the quantization damage, and which cells they are depends on the model. Cell damages also approximately add up to the model's final KL divergence, so a single profile per model predicts a plan's damage before it is served (Figure 2).

(P2) Sharing does less damage in later loops: for some cells, reading the final loop's KV costs less than storing their own INT2 copy, e.g., in 21 of the 24 loop-3 layers and 6 loop-2 layers, but in no loop-1 layer (Figure 3).

(P3) The loops compound read errors: each loop injects nearly the same error, so skipping the pages of unimportant tokens costs more on looped models than on plain ones. In Ouro-1.4B, page skipping in all four loops costs 1.8× the sum of its one-loop damages in KL, over 50% more than the at most 1.17× of plain models such as Qwen2.5 and Qwen3.

Figure

Figure 3. P2: some cells can share with little loss. Each point shows the damage (the y-axis, as in Figure 2) when one cell reads the final loop's KV instead of storing its own, while every other cell stays exact. Some cells (green) do less damage when sharing than when stored at INT2

Figure

Figure 4. P3: the loops compound read errors. Quest drops the low-ranked far pages that are not in the sink and window, while LoopKV-style reading keeps them and reads the values of low-attention far tokens at 2 bits. Both read 85% of the far bytes. (a) Relative damage †^{\dagger} of Quest as k grows, applied to the first k loops of Ouro-1.4B, to k of four layer slices of Ouro-1.4B that each span all loops, or to k of four layer groups of Qwen2.5 and Qwen3. (b) Damage of LoopKV-style reading and of Quest in all four loops of Ouro-1.4B at the same 85% of bytes read. Damage is the fp32 KL to the exact model. †^{\dagger}Damage when the k groups are treated together, divided by the sum of their damages when page skipping is applied to each group alone.

At equal bytes, LoopKV-style reads, which read the values of unimportant tokens at 2 bits instead of skipping them, cause 4.7×4.7 \times less damage. Loops that share a block, moreover, attend to different tokens (Jaccard 0.83 for loops 3 and 4), so which values need full precision depends on the loop that reads them and must be decided at run time (Figure 4).

In the offline phase, LoopKV profiles every cell once and measures its damage under each storage option, i.e., 4-bit codes, 2-bit codes (P1) or a pointer to the final loop's KV (P2). It then solves a knapsack over these profiles that minimizes the KV bytes each decode step reads under a damage budget. Adding a tight storage budget gives the memory-optimized plan (LoopKV-M), and leaving storage unconstrained gives the read-optimized plan (LoopKV-R). In the online phase, LoopKV stores each 4-bit value as two 2-bit planes and reads them at a precision set by the attention each token receives, i.e., a loop reads the low plane only for the tokens that its own attention marks as important (P3). Loops that share a block can therefore read

it at different precisions without extra bytes. In vLLM, one fused kernel executes every cell type in a single launch, and the whole decode step replays as one CUDA graph, which cuts LoopKV-M's host launches per decode step from 504 to 17 (Figure 1). Our contributions are:

• Characterization. We measure three properties of the per-loop KV cache on Ouro-1.4B (P1–P3) and show that its sensitivity profile is specific to each model, since it differs across Ouro-2.6B, Dory-4B and Huginn-3.5B. On each of these models, a plan computed from the model's own per-cell profile beats hand-made plans of equal bytes ( §2.4,§5.7§2.4, §5.7).

• Design. LoopKV turns each property into one mechanism, and one fused kernel executes all three in a single launch. They include per-cell mixed-precision allocation (C1), cross-loop KV sharing as a per-cell option, with the planner deciding which cells share (C2), and read-time, attention-aware V precision (C3) ( §3,§4§3, §4). Restricting the plan to one option per layer costs 1.4−1.9×1.4-1.9\times the KL at equal bytes.

• Evaluation. On Ouro-1.4B, Ouro-2.6B and Dory-4B, LoopKV-M reaches 1.13−4.44×1.13-4.44\times the decode throughput of vLLM's BF16 cache at 16K context on three kinds of GPUs, and none of its suite averages falls more than 0.5 percentage points below BF16's (up to six suites per model) (Table 1, Table 7, §5.7). On Ouro-1.4B, against uniform INT4 (KIVI-4) on the same kernel and CUDA graph, LoopKV-M stores 35% less KV and sustains 1.7−2.2×1.7-2.2\times KIVI-4's request rate under a latency SLO (Figure 5).

References (80)