Albert Q. Jiang et al. (2023). Mistral 7B (Sliding Window Attention). arXiv:2310.06825
Yutao Sun et al. (2024). You Only Cache Once: Decoder-Decoder Architectures for Language Models (YOCO). arXiv:2405.05254
Songlin Yang et al. (2024). Gated Delta Networks: Improving Mamba2 with Delta Rule. arXiv:2412.06464
Kimi Team, Yu Zhang, Zongyu Lin et al. (2025). Kimi Linear: An Expressive, Efficient Attention Architecture. arXiv:2510.26692
Bohong Wu et al. (2025). Parallel Loop Transformer for Efficient Test-Time Computation Scaling (PLT & G-SWA). arXiv:2510.24824
Yutao Sun et al. (2026). Universal YOCO for Efficient Depth Scaling. arXiv:2604.01220
Wanqi Yang, Shiwei Liu (2026). FlashLoop: Fast and Memory-Efficient Looped Transformers via Lazy Updates. arXiv:2609.29812
BeNice! Authors (2026). BeNice!: Closing Looping's Inference-Memory Gap via KV-Sharing. arXiv:2610.31633
Zirui Liu et al. (2024). KIVI: A Tuning-Free Asymmetric 2bit Quantization for KV Cache. arXiv:2402.02750
Woosuk Kwon et al. (2023). Efficient Memory Management for Large Language Model Serving with PagedAttention (vLLM). arXiv:2309.06180
Rewriting a 32-layer Transformer as 8 physical layers × 4 loops shrinks checkpoint weights to 0.25×, yet naive execution still materializes all 32 full-length KV Cache tables and re-streams 100% of core weights over HBM on every batch-1 decoded token. Separating weight compression from memory and bandwidth efficiency turns on three mechanisms: bounded-state mixers, cross-layer cache sharing, and cross-loop scheduling.
1. Bounded-State Mixers, SWA's Four Costs, and the Hybrid Crossover#
Every KV compression mechanism trades state memory and compute complexity against long-range exact retrieval fidelity (assuming fixed model width $d$, per-head dimension $d_h$, and Chunked WY block size $C$ for linear recurrences):
Dimension
Full Softmax
Sliding Window · SWA
Linear / State-Space · RetNet / GDN / KDA
State Scaling
Linear in length, $O(Nd)$
Ring buffer $O(Wd)$ · $O(1)$ in $N$
Fixed $d_k \times d_v$ matrix · $O(1)$ in $N$
Prefill / Decode
$O(N^2 d)$ / $O(Nd)$
$O(NWd)$ / $O(Wd)$
Chunked WY $O(N d d_h)$ / $O(d d_h)$
Recall Fidelity
Arbitrary exact recall
Trailing $W$ tokens only
Bounded by orthogonal slots $d_k$
Note
The linear-attention Prefill term omits the intra-chunk quadratic cost $O(NC^2 n_h)$, which is subdominant to $O(N d d_h)$ projections and state updates when $C \ll d_h$.
In practice, Sliding Window Attention (SWA) collapses state memory to $O(Wd)$, yet incurs four hard systems and modeling costs:
Hard blind spots and the multi-layer "telephone game" vs. the small-window trade-off: Consider a 6-token sequence $[t_1, t_2, t_3, t_4, t_5, t_6]$ under $W = 3$. When $t_4, t_5, t_6$ arrive, the ring buffer holds only $[t_4, t_5, t_6]$ and physically evicts $t_1, t_2, t_3$, creating a hard blind spot past distance $W$ inside a single layer. Reaching across $L \cdot W$ tokens requires multi-hop relay across $L$ layers—a "telephone game" that degrades verbatim lookup. Counter-intuitively, production hybrids like MiMo-V2-Flash (5:1 SWA/Full ratio with W = 128) and Qwen3.8-Flash find that shrinking SWA down to 128 tokens can outperform larger windows: narrow windows force SWA layers to specialize strictly on local syntax while routing long-range recall reliably through periodic Full Attention layers.
⤢ Zoom
Figure 1: Sliding Window Attention mask matrix vs. Vanilla Attention alongside multi-layer effective context length growth across stacked layers (arXiv:2310.06825). (Source: Jiang et al., 2023, Fig. 1)
In the middle panel above, $W=3$ restricts attention to a three-token diagonal band and zeros out earlier keys, while the right-hand pyramid illustrates how stacking $L$ layers extends effective receptive field linearly to $L \times W$.
<BOS> sink eviction collapse and two fixes: Because Softmax probabilities sum to $1$, queries with no matching key dump excess mass onto token $0$ (<BOS>), the Attention Sink. Once a sliding ring buffer evicts <BOS>, Softmax loses its normalization anchor and activations/perplexity destabilize. StreamingLLM prevents this by pinning initial sink tokens in cache alongside the sliding window, whereas OpenAI GPT-OSS adds a learnable softmax sink bias in the attention denominator so heads absorb idle probability mass without storing physical <BOS> KV entries.
Dual KV cache pools: Hybrid SWA + Full models force serving engines to manage two heterogeneous allocators—fixed-capacity overwriting ring buffers alongside append-only PagedAttention blocks.
SWA KV must never be shared across layers: Unlike global contextual caches, each SWA layer extracts sharp, depth-specific local positional interactions; sharing SWA KV buffers across layers degrades accuracy sharply.
Checking exact byte counts also clarifies why frontier long-context systems favor mixed linear-full ratios rather than purely linear replacements. With $n_h = 32$ heads and head dimension $d_k = d_v = 128$ in FP32, one linear recurrence layer maintains a constant matrix state of $32 \times 128 \times 128 \times 4\text{ B} = \mathbf{2\text{ MiB/layer}}$. By comparison, one BF16 GQA-8 attention layer ($n_{\text{kv}} = 8, d_{\text{head}} = 128$) consumes $2 \times 8 \times 128 \times 2\text{ B} = \mathbf{4\text{ KiB/token}}$, putting the state breakeven at $2\text{ MiB} / 4\text{ KiB} = \mathbf{512\text{ tokens}}$.
When the baseline instead uses FP8 MLA as sized in Memory Arithmetic for LLM Serving: TP/EP, KV Crossover, and Looped Decode ($d_c + d_R = 576$ dimensions at $1\text{ B/element}$, i.e., 576 B/token), that breakeven shifts roughly $7\times$ higher to $2{,}097{,}152\text{ B} / 576\text{ B} \approx \mathbf{3{,}640\text{ tokens}}$. Linear state only beats full KV memory past those thresholds; pairing three constant-state layers with one full attention layer—such as 3 GDN + 1 Full Attention in Qwen3-Next and 3 KDA + 1 NoPE MLA in Kimi Linear—balances throughput with verbatim recall.
2. YOCO: One Global KV Cache and the Source of Its $30.3\times$ Prefill Speedup#
Rather than changing the internal operator of every layer, YOCO (You Only Cache Once) (Sun et al., 2024) eliminates cross-layer cache replication across depth. An $L$-layer stack splits evenly into two halves: the lower Self-Decoder (layers $1 \dots L/2$) executes an $O(N)$ attention variant (such as RetNet or SWA) and exports a single shared global key-value pair $(K^{(L/2)}, V^{(L/2)})$ at its midpoint; the upper Cross-Decoder (layers $L/2+1 \dots L$) replaces self-attention entirely with cross-attention reading that single shared cache. Total KV memory immediately drops from $L$ full tables to one (plus negligible $O(1)$ sliding-window or linear state in the lower half).
⤢ Zoom
Figure 2: YOCO Decoder–Decoder architecture where the lower L/2-layer Self-Decoder exports a single global KV cache shared by the upper L/2-layer Cross-Decoder (arXiv:2405.05254). (Source: Sun et al., 2024, Fig. 2)
The headline Prefill metric is TTFT (Time To First Token)—the latency from receiving a prompt to emitting the first output token. Trace a 5-token dependency chain ["Author", "of", "Dream", "of", "Red", "Chamber"] -> "Cao" through a 32-layer model: a standard 32-layer Transformer must propagate all prefix tokens through every upper-half Attention and FFN block solely to populate upper-layer KV caches.
In YOCO's Cross-Decoder, by contrast, a token at position $N$ in layer $\ell > L/2$ depends only on $(K^{(L/2)}, V^{(L/2)})$ and its own upper-layer FFN chain, never on intermediate upper-layer states $h_j^{(\ell')}$ of prior positions $j < N$:
During Prefill, once the Self-Decoder completes its $O(N)$ pass over the prefix and materializes $(K^{(L/2)}, V^{(L/2)})$ at layer $L/2$, historical prefix tokens exit early—retiring not only upper-half Cross-Attention, but upper-half FFNs as well. The Cross-Decoder runs solely on the final query token $q_N$ against the single global cache in $O(N)$ time. The H100 3B scaling benchmarks reported in the paper reflect this architectural asymmetry:
Context Length
Prefill Speedup (vs. Transformer)
VRAM Reduction & Serving Throughput
Short Prompt
$\sim 2\times$
Retires upper-half prefix Attention and FFN
32K
$\sim 2.9\times$
Total VRAM compression up to $6.4\times$
512K
$30.3\times$ · 180s → <6s
Total VRAM compression up to $9.4\times$; throughput $\sim 9.6\times$
1M
Scales without OOM
Standard baseline hits HBM ceiling or minute-scale stalls
By splitting Prefill from Generation, YOCO skips all upper-half Cross-Decoder computation across the entire prompt prefix—cutting 512K prefill latency from 180s down to under 6s($30.3\times$)—before activating Cross-Decoder strictly per generated decode token.
Under Prefill-Decode (PD) Disaggregation, YOCO provides an additional systems advantage: because only a single midpoint cache $(K^{(L/2)}, V^{(L/2)})$ persists globally, cross-node RDMA KV transfer from Prefill workers to Decode workers shrinks proportionally.
At the same time, four sharp limitations explain why YOCO remains rare in frontier open-weights checkpoints:
Prompt depth halved: every prefix token stops mixing context at layer $L/2$ before entering the midpoint bottleneck (with Phi-4-mini-flash as one of the few deployed production examples);
The 50/50 vs. 75/25 dilemma: splitting layers 50/50 sacrifices prompt encoding depth, whereas shifting to 75% Self-Decoder / 25% Cross-Decoder shrinks both KV savings and TTFT speedups;
Decode-heavy CoT mismatch: for reasoning workloads where autoregressive output chains vastly outweigh prompt tokens, every generated token still traverses all $L/2$ upper Cross-Attention and FFN weight matrices;
YOCO + UT loses $25\%\text{–}40\%$ naively: community experiments pairing YOCO naively with a Universal Transformer lose $25\%\text{–}40\%$ of parameter-matched gains. Universal YOCO (YOCO-U) (Sun et al., 2026) resolves this by structurally confining weight-shared looping strictly inside the lower Universal Self-Decoder (e.g., $W=512$ SWA), exporting 1 global KV cache at the midpoint to a non-looped Cross-Decoder—cutting 256K KV memory on a 1.3B model to 542 MB ($18.9\times$ below a standard Transformer's 10,240 MB) and achieving 76.3K tok/s prefill ($20.4\times$ faster than full-loop RINS).
⤢ Zoom
Figure 3: Universal YOCO (YOCO-U) confining T recurrent iterations strictly to the lower Self-Decoder before exporting a single global KV cache to the non-looped Cross-Decoder (arXiv:2604.01220). (Source: Sun et al., 2026, Fig. 1)
Comparing standard YOCO above directly against YOCO-U highlights the single structural addition: the red dashed T Iterations feedback loop on the lower left, wrapping exclusively from the Self-Decoder FFN output back into Self-Attention input before exporting the single global K/V cache to the non-looped Cross-Decoder.
3. Loop-Specific KV and Bandwidth Designs: LSE Merge, G-SWA, PLT, and FlashLoop#
Rewriting a 32-layer Transformer as 8 physical layers × 4 loop passes shrinks weights by $75\%$, yet still generates $8 \times 4 = 32$ full-length KV tables unless loops share or compress cache across passes. Four recent techniques tackle loop cache capacity and weight bandwidth directly, alongside late-2026 production variants.
3.1 Exact Two-Line LSE Merging and Global + SWA Traces#
The cleanest capacity reduction separates global long-range anchoring from local pass refinement. Pass $r = 1$ materializes a normal full-length global cache $K_{\text{global}} \in \mathbb{R}^{N \times d_k}$, whereas subsequent passes $r \ge 2$ write keys and values only into short complementary local sliding windows $K_{\text{local}}^{(r)}$ of width $W$. Tracing token #10,001 under $N = 10{,}001,\; R = 3,\; W = 4$: pass 1 appends row 10,001 and attends over all 10,001 global keys; passes 2 and 3 overwrite only their 4-slot ring buffers [9998, 9999, 10000, 10001] while reading the preceding 9,997 global entries alongside the 4 local slots—shrinking per-layer rows from $30{,}003$ down to $10{,}001 + 2\times 4 = \mathbf{10{,}009}$.
Combining distant global memory with a local window requires careful normalization. Consider a 5-token sequence ["Once", "upon", "a", "high", "peak"] with $W=2$: naively concatenating the full global cache with the overlapping local window (Overlap Double-Count) counts ["high", "peak"] twice inside the Softmax denominator, biasing local scores. Partitioning disjoint indices ["Once", "upon", "a"] vs. ["high", "peak"] (Replace-Concat) or running two separate FlashAttention calls returning $(O_1, m_1 = \mathrm{LSE}_1)$ and $(O_2, m_2 = \mathrm{LSE}_2)$ reproduces exact monolithic Softmax attention with zero HBM concatenation:
3.2 G-SWA and Four Limits of Global + SWA Sharing#
Although exact LSE merging is mathematically lossless, Parallel Loop Transformer (Wu et al., 2025) highlights an asymptotic quirk on ultra-long contexts: as context length $N$ expands, the global denominator $m_1 = \log\sum \exp(q^\top k_j / \sqrt{d})$ drifts upward at roughly $\mathcal{O}(\log N)$, progressively shrinking the local window weight $w_2 = \sigma(m_2 - m_1)$ regardless of local token relevance. G-SWA (Gated Sliding Window Attention) replaces $\sigma(m_1 - m_2)$ with a learned hidden-state gate $g_t = \sigma(w_g^\top h_t)$, emitting $O_{\text{G-SWA}} = g_t O_1 + (1 - g_t) O_2$.
All Global + SWA loop schemes share four structural limits:
Cross-round distant blind spot: passes $r \ge 2$ never write updated distant keys, leaving long-range retrieval locked to pass-1 keys;
Zero savings when $N \le W$: short prompts fit entirely inside the local window;
Pass-1 depth floor: if the physical core is too shallow on pass 1, the sole global KV table cannot capture deep long-range entities;
Train-inference consistency constraint: altering window splits or G-SWA gating post-hoc shifts attention entropy unless matched during training or exact LSE calibration.
3.3 PLT: Cross-Pass Pipelined Batching Against the HBM Bandwidth Wall#
As analyzed in Memory Arithmetic for LLM Serving: TP/EP, KV Crossover, and Looped Decode, looping a multi-gigabyte core $R$ times for $B=1$ Decode misses the $50\text{ MB}$ H100 L2 cache on every pass and still transfers $R \times (M_W/R) = M_W$ weight bytes from HBM. PLT (Parallel Loop Transformer) (Wu et al., 2025) restructures the computation graph across consecutive sequence positions (note that Wu et al. denote the per-block loop count as $L = 3$ in Fig. 2, matching our $R = 3$ notation).
Look at Current Step (predicting $t_5$) on the right side of the figure below: inside a single batched Loop Transformer forward pass of size $R = 3$, all 3 parallel slots inject the current token embedding $t_4$, added to cached hidden states carried over from Previous Step: slot 1 computes $(t_4 + 0) \to h_4^1$ (Loop-1), slot 2 computes $(t_4 + h_3^1) \to h_3^2$ (Loop-2), and slot 3 computes $(t_4 + h_2^2) \to h_2^3$ (Loop-3). Crucially, only the final-loop slot $h_2^3$ projects to predict $t_5$ (while $h_4^1$ and $h_3^2$ route forward along the dashed lines into the next step's Loop-2 and Loop-3 slots—the three streams are not pooled together at readout). Because all $R$ passes sit inside one batched GEMM, the GPU streams the compressed core weights $M_W / R$ from HBM only once per generated token, achieving a true $1/R$ cut in single-request weight I/O.
⤢ Zoom
Figure 5: Parallel Loop Transformer (PLT) staggered cross-loop pipelining for $L=3$, injecting $t_4$ into all three Loop-1/2/3 slots at Current Step and predicting $t_5$ solely from $h_2^3$ (arXiv:2510.24824). (Source: Wu et al., 2025, Fig. 2)
Three critical caveats bound PLT in practice:
3-token staggered "7" failure trace: consider predicting "7" at the end of a reasoning chain $[\dots, t_2, t_3, t_4] \to \text{"7"}$. As Current Step shows, the newest conditional token $t_4$ enters $(t_4 + h_2^2) \to h_2^3 \to t_5$ through only Loop-3 (1 physical pass) before predicting $t_5$, while earlier positions have accumulated 2 and 3 passes diagonally; any answer "7" requiring multi-step compositional transformation of $t_4$ itself suffers effective depth collapse to 1 pass;
Non-post-hoc graph invariant: PLT shifts cross-pass edges diagonally and re-injects current embeddings at every loop during training ($h_3^2$ depends on $t_4 + h_3^1$ rather than repeating $t_3$ in place), so it cannot be applied post-hoc at inference to an existing serial Loop checkpoint;
Frontline reproduction critique: community reproductions note that total FLOPs remain $R \times C$ (narrowing concurrency gains in Prefill-heavy or compute-bound regimes), and ablation comparisons indicate that gains come mostly from the bundled G-SWA mechanism rather than staggered cross-token batching alone.
3.4 FlashLoop, Recurrent Linear Cores, and Late-2026 Production Schemes#
For already-pretrained looped models where graph modifications are undesirable, FlashLoop (Wanqi Yang, Shiwei Liu, 2026) exploits strong similarity between consecutive loop passes—directly analogous to I-frames vs. P-frames in MP4 video compression. Across transitions 1->2, 2->3, and 3->4, hidden-state deltas grow sharply sparser: in the authors' example, while pass-1 keys $K^{(1)} = [12.43, -8.71, 3.15, 0.42]$ span $21.14$, the inter-loop residual $\Delta K = K^{(2)} - K^{(1)} = [+0.01, 0.00, +0.05, -0.01]$ collapses to $0.06$ (over $350\times$ narrower), cutting low-bit quantization reconstruction error from ~6.8%–7.0% down to ~3.6%, ~2.5%, ~2.0%.
Quantizing full-range $K^{(r)}$ directly down to 2-bit destroys recall, whereas storing pass 1 at full precision and quantizing narrow inter-pass residuals $\Delta K, \Delta V$ per group of $G$ elements (adding one FP16 scale and zero-point per group, $32\text{ bits}/G$ overhead) preserves signal fidelity:
$$\begin{aligned}
\hat{q} &= \mathrm{round}\!\left(\frac{\Delta K - z}{s}\right), & z &= \min(\Delta K), \\
s &= \frac{\max(\Delta K) - \min(\Delta K)}{2^b - 1}, & b_{\text{eff}} &= b + \frac{32}{G}
\end{aligned}$$
With 2-bit residuals and group size $G = 64$, effective bit-width is $b_{\text{eff}} = 2.5\text{ bits}$, compressing a 4-loop cache from $64\text{ bits}$ down to $16 + 3 \times 2.5 = 23.5\text{ bits}$ ($2.72\times$ compression). Pairing residual quantization with Lazy Updates—skipping KV projections on late passes when $|\Delta|$ falls beneath a tolerance threshold—cuts Ouro-2.6B R4 memory in FlashLoop's original Fig. 1 below by $5.8\times$ in KV Cache (dropping total memory from 16.9 GiB—which initially exceeds Llama3.1-8B's 15.9 GiB due to 4× KV replication—down to 6.9 GiB) and cuts 8K prefill FLOPs by $1.8\times$ (214.4 -> 121.8 TFLOPs), while reaching up to $6\times$ KV reduction and $1.64\times$ inference speedup in peak HBM-bound batch-1 decode benchmarks.
Yet this empirical behavior also prompts a skeptical takeaway in linear-attention circles: if late passes alter keys and values so weakly that skipping them preserves accuracy, current looped checkpoints may be under-trained in deep passes and behave close to identity mappings—and aggressive 2-bit residual compression still degrades multi-key recall such as RULER-16K (making 4-bit residuals the safer baseline).
Three complementary directions round out the 2026 loop-cache landscape:
Linear Attention inside the Loop core: placing GDN or KDA inside a weight-tied core creates a "horizontal and vertical RNN"—recurrent across both sequence time $t$ and loop depth $r$—though exact-retrieval benchmarks still enforce a hybrid core requirement (retaining periodic Full Attention layers);
BeNice! (arXiv:2610.31633): combines stochastic-depth pretraining with (1<-T) final-loop KV broadcast fine-tuning, mitigating cross-pass sharing loss without changing inference kernels; in SGLang replays of Mooncake traces, BeNice! cuts global KV HBM by $66.2\%$, raises prefix cache hit rate by $+31.4\%$, and lowers p90 TTFT by $83.6\%$ (caveat: these serving metrics come from looped checkpoints up to ~2.6B scale using a specialized training recipe; scaling to 30B–100B+ checkpoints and strict multi-needle recall remains to be verified);
KV-Mirror & GLM-5.4 dual KV: in large untied or continued-trained flagships—such as reported ~750BGLM-5.4 (28 layers × 2 loops)—engineering deployments report mirroring trailing ~1/3 layers' K/V from earlier layers (KV-Mirror, ~20% decode step speedup at the expense of upper-layer attention independence), or pairing Per-Token gated incremental updates with cross-loop hybrid KV and sparse attention index reuse to scale to 1M context.
Comparing four equal-32-layer-equivalent architectures side by side clarifies when each layout wins:
32L-Equivalent Setup
Physical Weights
KV Cache Copies
Prefill Cost
Batch-1 Decode I/O
Primary Target Workload
Standard 32L
$1\times$
$32$ full tables
$32\text{L}$ quadratic
$1\times$ weight stream
High-concurrency general serving & exact recall
Naive Loop (8L×4)
$0.25\times$
$32$ full tables
$32\text{L}$ quadratic
$1\times$ weight stream · 4 passes
Storage-bound checkpoints only
YOCO (16L+16L)
$1\times$
$1$ full (+local)
Lower $16\text{L}$ linear
$1\times$ weight stream
Long-prompt Prefill-heavy (ultra-low TTFT)
Loop Global+SWA (8L×4)
$0.25\times$
$8$ global + $24$ $W$-SWA
$32\text{L}$ hybrid
$0.25\times$ with PLT
Tight VRAM edge / moderate-context deep reasoning
4. Production Takeaways for Untied and 100B+ Serving Stacks#
Outside specialized weight-tied loops, production long-context serving organizes general KV management into three practical tiers: