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

📅 2026-08-31
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
Tail-Replay通过仅重放匹配前缀的短近期后缀来解决混合大语言模型中线性注意力层与全注意力层在前缀缓存中的不匹配问题,提高了缓存效率和服务速度。
📝 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\times$ over full prefill at 32K.
Problem

Research questions and friction points this paper is trying to address.

Hybrid Large Language Models
Prefix Caching
Linear Attention
Recurrent States
Token-Addressable
Innovation

Methods, ideas, or system contributions that make the work stand out.

Tail-Replay
Hybrid Large Language Models
Prefix Caching
Linear Attention
Gated DeltaNet
🔎 Similar Papers
No similar papers found.
Y
Yirui Liu
Institute of Artificial Intelligence, China Telecom (TeleAI)
R
Ruoling Qi
Institute of Artificial Intelligence, China Telecom (TeleAI); Shanghai Jiao Tong University
X
Xuaner Wu
Institute of Artificial Intelligence, China Telecom (TeleAI)
Penghang Liu
Penghang Liu
J.P.Morgan AI Research
Reinforcement LearningHuman BehaviorTemporal Graph Generation
J
Jian Chen
Institute of Artificial Intelligence, China Telecom (TeleAI)