arXiv(opens in a new tab)cs.LGAug 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2608.30310

Tail-Replay: Escaping the Curse of Linear Attention in Prefix Caching for Hybrid LLMs

Yirui Liu, Ruoling Qi, Xuaner Wu, Penghang Liu, Jian Chen

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Hybrid large language models interleave full-attention layers with linear-attention layers to reduce the cost of long-context inference. This structure complicates prefix caching: full-attention key-value caches are token-addressable, whereas linear-attention layers maintain recurrent states that cannot be rolled back to arbitrary prefix boundaries. Existing hybrid prefix caching methods address this mismatch by storing recurrent-state checkpoints. As a result, token-level matches are directly usable only at positions aligned with stored checkpoints, constraining prefix reuse to a discrete set of boundaries. We present Tail-Replay, a prefix caching mechanism that enables unconstrained token-level prefix reuse in hybrid large language models. The key insight is that linear-attention mechanisms such as Gated DeltaNet can be viewed as a structured, lossy compression of the input prefix: gated recurrent updates progressively attenuate the contributions of earlier inputs. Consequently, the recurrent state of a matched prefix can be well approximated by replaying only a short, recent suffix of that prefix. Tail-Replay exploits this property by caching the exact full-attention key-value cache while omitting recurrent-state checkpoints. On a cache hit, it reconstructs the linear-attention states by replaying a short, recent suffix of the matched prefix. As a result, the reuse boundary is determined by the shared tokens rather than by recurrent-state checkpoints. We evaluate Tail-Replay on three Gated DeltaNet-based hybrid models using the LongBench and RULER benchmarks. With only a 5–10% replay budget, it retains 92.8–99.9% of full-prefill quality on LongBench and RULER. For serving efficiency, we evaluate time-to-first-token speedups across multiple matched-prefix lengths—8K, 16K, and 32K. The speedup grows with prefix length, reaching 9.1–14.3× over full prefill at 32K.

1 Introduction

LLM applications have evolved from single-turn instruction-following assistants [14] to richer workloads such as multi-turn dialogue [27], retrieval-augmented generation [7], tool-using agents [25], and multi-agent workflows [22, 4]. These workloads bring longer contexts, repeated invocations, and higher concurrency, making serving efficiency an increasingly important practical concern [16]. In response, model designers and system designers have pursued complementary solutions at different layers of the stack. At the model level, hybrid architectures [8, 19, 13, 12, 17, 18, 26, 11] combine full-attention (FA) layers with linear-attention layers to reduce long-context cost. At the serving level, prefix caching [28, 3, 2, 24] reuses shared prefixes across requests to avoid redundant prefill.

Hybrid models and prefix caching are two complementary techniques. A natural question is whether they can be deployed together to achieve greater overall efficiency gains. However, existing prefix caching mechanisms are largely designed for FA models and are not naturally compatible with hybrid

Preprint.

models. In FA models, the reusable state consists of token-indexed key-value (KV) caches, so the prefix KV of a processed request can be retrieved and reused at any token boundary. In contrast, linear-attention layers summarize the processed prefix into recurrent states through in-place updates. Once the state has advanced, it cannot be rolled back to represent an arbitrary earlier prefix. We refer to this mismatch as the curse of linear attention for prefix caching: a token-level prefix match no longer directly implies a reusable model state. Recent hybrid prefix caching systems address this constraint by explicitly managing recurrent-state checkpoints. Marconi [15] focuses on which recurrent states to retain across cached prefixes, while Sparse Prefix Caching [20] focuses on where to place checkpoints within each cached prefix. These designs mitigate the problem but do not remove its root limitation: prefix reuse remains constrained by recurrent-state checkpoint locations rather than by the boundaries of shared-token prefixes.

We present Tail-Replay, a prefix caching mechanism that enables unconstrained token-level prefix reuse in hybrid LLMs. The key insight is that state-of-the-art linear-attention mechanisms such as Gated DeltaNet (GDN) can be viewed as a structured, lossy compression of the input prefix: gated recurrent updates progressively attenuate the contributions of earlier inputs. Consequently, the recurrent state of a matched prefix can be well approximated by replaying only a short, recent suffix of that prefix. Tail-Replay exploits this property by caching the exact FA KV while omitting recurrent-state checkpoints. On a cache hit, it reconstructs the linear-attention states by replaying a short, recent suffix of the matched prefix. As a result, the reuse boundary is determined by the shared tokens rather than by recurrent-state checkpoints, escaping the curse of linear attention in prefix caching.

We evaluate Tail-Replay on three Gated DeltaNet-based hybrid LLMs across LongBench and RULER. With a 5–10% replay budget, it retains 92.8–99.9% of full-prefill quality across the evaluated workloads, while achieving up to 14.3×14.3\times TTFT speedup at 32K. In summary, our contributions are as follows:

  1. We present Tail-Replay, to our knowledge the first hybrid prefix caching mechanism that enables unconstrained token-level prefix reuse without being constrained by recurrent-state checkpoints.

  2. We introduce a replay-based state reconstruction mechanism that caches exact FA KV and rebuilds the linear-attention state from a short, recent tail of the matched prefix.

  3. We implement and evaluate Tail-Replay on three Gated DeltaNet-based hybrid LLMs, demonstrating high quality retention and substantial TTFT reduction.

  4. We develop two quality-preserving optimizations—a tail-FFN skip and transfer/replay overlap—that further reduce replay overhead.

References (24)