arXiv:2610.41508cs.DCOct 2026

Manuscript Offprint

arXiv:2610.41508

HiState: Hierarchical Prefix Cache Management for Hybrid LLM Serving in Agentic Workloads

Zaifeng Pan, Lucas Wang, Xinwei Qiang, Yanbo Zhou, Chang Chen, Zhengding Hu, Yue Guan, Yufei Ding

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

ABSTRACT

Hybrid large language models combine full-attention and recurrent linear layers to reduce inference costs. Prefix caching can further reduce redundant computation across requests, but a recurrent checkpoint cannot recover an earlier state corresponding to a shorter prefix. Existing hybrid prefix caching systems retain checkpoints at selected boundaries to support common reuse patterns in conventional conversations. However, agent workloads modify and revisit earlier contexts, exposing reusable prefixes whose checkpoints were never saved or have already been evicted. A straightforward approach is to retain more checkpoints to reduce recomputation, but their cumulative footprint can displace reusable prefixes from other sessions and cause additional cache misses. To address these problems, we present HiState, a prefix cache management system for hybrid models serving agent workloads. Our key observation is that prefix reuse accesses all matching key-value (KV) entries but only one recurrent checkpoint, regardless of how many checkpoints are retained. This asymmetry allows HiState to retain historical checkpoints on SSD while prioritizing fast memory for KV entries: each hit retrieves only one checkpoint whose size is independent of context length. Within this hierarchy, we propose adaptive interval control to balance checkpoint storage against recomputation, and unified eviction to coordinate checkpoint sparsification with reclamation of stale trajectories. We implement HiState on top of vLLM and evaluate it on two public coding-agent trace datasets and controlled microbenchmarks. On real agent traces, HiState achieves up to 5.73×5.73\times and 5.44×5.44\times speedups in p99 TTFT over vLLM-Marconi and SGLang-HiCache, respectively.

1 INTRODUCTION

Hybrid large language models (LLMs) combine full-attention layers with recurrent layers such as linear attention and state space models (Lieber et al., 2024; Glorioso et al., 2024; Waleffe et al., 2024; Kimi Team et al., 2025; 2026; Qwen Team, 2026). In full-attention layers, the key-value (KV) cache grows with sequence length, and each decoding step accesses the KV tensors of preceding tokens. Recurrent layers instead update a fixed-size state that summarizes the preceding context, reducing the computation and memory required by these layers (Katharopoulos et al., 2020; Gu & Dao, 2023).

Prefix caching (Gao et al., 2024; Yu et al., 2025; Qin et al., 2025; Pan et al., 2025c; Liu et al., 2025) reuses previously computed model states across requests with shared prefixes, avoiding redundant prefill computation and reducing time-to-first-token (TTFT). For full-attention models, systems such as SGLang (Zheng et al., 2024) organize token-level KV entries in a radix tree, enabling reuse at intermediate prefix boundaries subject to cache block granularity. However, a recurrent state represents an entire prefix and cannot be truncated to recover the state of a shorter one (Pan et al., 2025a). Hybrid prefix reuse therefore requires both the attention KV cache and a recurrent-state checkpoint at or before the matching boundary. The system must recompute any intervening tokens from the checkpoint, or the entire prefix if no earlier checkpoint is available.

Existing hybrid caching strategies exploit recurring prefix boundaries to limit checkpoint storage. For example, Marconi (Pan et al., 2025a) saves states at observed branching points and the last decoded token. These choices capture common reuse patterns in question answering and conversations, where requests share a fixed system prompt or append to the preceding context.

However, agent workloads (Yao et al., 2023; Yang et al., 2024; Steinberger & OpenClaw Community, 2026; LangChain, 2026) introduce more diverse prefix reuse patterns through dynamic context construction. During task execution, agent harnesses may edit earlier tool outputs, compact selected context segments, or rewind to a previous context before exploring a different execution branch (Ji, 2025; LangChain, 2025; Curme & Daugherty, 2026; An-

∗^{*}Equal contribution 1^{1}University of California, San Diego, CA, USA. Correspondence to: Zaifeng Pan zapan@ucsd.edu.

Preprint.

Figure

(a) Traditional LLM

(b) Hybrid LLM

(c) KV cache and state checkpoint reuse

Figure 1. Model architectures and prefix cache reuse. (a) A full-attention model. (b) A hybrid model with linear-attention layers. (c) KV entries support reuse through t5, but the checkpoint S7 at t7 cannot be converted back into S5. Without S5 or an earlier checkpoint, the system must recompute t0–t5.

thropic, 2025; Pan et al., 2026c). These operations can move the prefix-reuse boundary to an internal position without a saved checkpoint, requiring recomputation even when the matching KV cache remains available. Moreover, reuse at a previously checkpointed boundary may occur only after intervening requests have caused that checkpoint's eviction. Supporting agent workloads therefore requires deciding both where to save checkpoints and which checkpoints to retain for later reuse.

A straightforward approach is fine-grained checkpointing, which retains recurrent states at small, fixed token intervals (Pan et al., 2025a). With an interval of II tokens, fewer than II tokens need to be recomputed before the matching boundary, as long as the required checkpoints and KV entries remain available. However, a context of length LL requires approximately L/IL/I checkpoints, each containing the states of all recurrent layers. For example, checkpointing Qwen3.5-9B (Qwen Team, 2026) every 1,024 tokens over a 32K-token context requires approximately 1.6 GB for FP32 recurrent matrices alone, compared with 1.1 GB for its BF16 KV cache. As concurrent sessions accumulate checkpoints, they compete with reusable KV entries for GPU and host memory. Reducing recomputation at individual reuse positions can therefore introduce cache misses elsewhere.

To address these limitations, we propose HiState, a prefix cache management system for hybrid models serving agent workloads. Our design exploits the different access requirements of KV entries and recurrent checkpoints: resuming from a cached position requires the KV entries of all preceding tokens but only one recurrent checkpoint at that position. Retaining more checkpoints increases the available resume positions without increasing the recurrent-state data accessed by each resumption.

Based on this observation, HiState introduces asymmetric cache tiering across GPU HBM, CPU DRAM, and SSD. The policy prioritizes fast-memory capacity for KV entries and retains historical checkpoints on SSD. Unlike KV restoration, checkpoint restoration transfers a fixed amount of data independent of context length and checkpoint den-

sity. This placement uses SSD capacity to preserve historical resume positions while reducing competition with reusable KV prefixes in fast memory.

While tiering expands cache capacity, checkpoint density still determines the tradeoff between storage consumption and recomputation. HiState employs adaptive interval control to select a checkpoint interval for each newly added context segment according to its length and runtime resource pressure. The controller balances the expected recomputation at internal prefix hits against the storage required to retain checkpoints.

Finally, finite cache capacity requires balancing historical checkpoint retention within a session against the capacity needed by other sessions. Preferentially retaining KV entries should not leave stale prefixes occupying space needed by active sessions. HiState introduces a unified eviction policy that ranks KV entries and checkpoints using last-access time, reclaimable storage, and expected additional recomputation. The policy sparsifies low-value intermediate checkpoints while allowing stale KV segments and their terminal checkpoints to be reclaimed for active sessions.

We implement HiState on top of vLLM (Kwon et al., 2023) and evaluate it on Weka (SemiAnalysis, 2026), TraceLab (Zhu et al., 2026), and synthetic microbenchmarks with varying mutation frequencies. On the real traces, HiState achieves up to 5.73×5.73\times and 5.44×5.44\times speedups in p99 TTFT over vLLM-Marconi (Kwon et al., 2023; Pan et al., 2025a) and SGLang-HiCache (Zheng et al., 2024; Xie et al., 2026), respectively.

In summary, this paper makes the following contributions:

  • We identify the checkpoint placement and retention challenges introduced by context mutation and delayed reuse in agent workloads.

  • We design and implement HiState, combining asymmetric cache tiering, adaptive interval control, and unified eviction to jointly manage KV caches and recurrent checkpoints across sessions and the memory hierarchy.

  • We evaluate HiState with real agent traces and controlled prefix reuse patterns, showing how checkpoint reuse affects request latency and workload tails.

References (40)