FlashStates

FlashStates: Unlocking Flexible Hybrid State Management for Agentic LLM Inference

FlashStates decouples recurrent checkpoint positions from KV-cache block boundaries, achieving fine-grained state reuse without dense checkpoint storage.

Demo replay

FlashStates vs. vLLM

2.8×
output tokens per minute
22.0k → 61.7k
3.7×
lower P50 end-to-end request latency
46.1 → 12.4 s
16.3×
lower P50 time to first token
3.30 → 0.20 s

Challenge

In a hybrid model, attention keeps KV for every token, but each recurrent layer keeps one state that it overwrites as it reads. Resuming at a position needs the KV and a checkpoint taken exactly there; we call the pair a hybrid state.

Where uncached tokens come from

Each agent turn re-sends its whole context. Ideally, the engine computes only the tokens added since the previous turn ended. Any earlier token it computes again is redundant prefill, caused by one of three misses.

How much each miss costs

Below 40 sessions, placement and dependency misses cause most of the redundant prefill in vLLM and SGLang. Capacity misses grow only from about 40 sessions.

vLLM SGLang

Concurrent sessions

Token hit rate (a) and redundant prefill tokens per request from each kind of miss (b–d) as concurrency grows. vLLM and SGLang serve the same coding-agent traces with GLM-5.3-Flash NVFP4 and equal cache memory.

SGLang checkpoints every 256 tokens, so it has few placement misses (b). At 32 sessions, however, it keeps 4.2× as many checkpoints per request as vLLM. They compete for a fixed-size state pool, which causes its dependency misses (c).

Method & Design

FlashStates saves recurrent checkpoints exactly where turns resume, and keeps or evicts each checkpoint together with the KV it depends on.

Arbitrary State Checkpointing (ASC)

The next turn resumes where the previous request ended, usually inside a KV block. ASC saves the recurrent checkpoint exactly there: at request end it captures the hybrid state before cleanup, and if the position lies inside a prefill chunk, the kernel exports the checkpoint as a side output while the chunk continues. The KV block size and the chunk size do not change, and outputs stay bit-identical.

The checkpoint at p falls inside a KV block and inside a prefill chunk. Neither is split.

Dependency-aware hybrid state

A recurrent checkpoint is useless without the KV before it, and that KV cannot resume a request without the checkpoint. FlashStates therefore keeps or evicts each hybrid state as one unit: its checkpoint and the KV only it needs. KV pages shared with other hybrid states are freed only when the last state that needs them leaves.

Hybrid states A and B extend a shared prefix. Evicting A frees only its checkpoint and the KV pages A alone uses, including its partial last page at full size.

Cost-aware eviction

Each hybrid state is priced by the prefill time it saves, measured once per model, per block of memory its eviction would free. Nothing is tuned per workload. Admission uses the same price: when memory is short, a new checkpoint is cached only if it is worth more than the cheapest one already cached. States that no request has resumed from for a while fall behind, so the newest checkpoint of each session, where its next turn resumes, is typically kept longest.

Evaluation & Results

Up to 3× throughput, across 3 hybrid models

We serve GLM-5.3-Flash, Qwen3.8-Flash-Next and Nemotron 3 Super using two B200 GPUs per engine. Evaluation on the AgentX coding-agent workload shows that FlashStates achieves up to 3.02× vLLM's decode throughput and 3.14× its prefill throughput, while cutting p90 time to first token (TTFT) by up to 88%.

vLLM FlashStates

GLM-5.3-Flash NVFP4, 1M context

Concurrent sessions

FlashStates also helps with Mooncake

With 512 GiB of host memory for cache and MTP enabled on GLM-5.3-Flash, FlashStates expands the Pareto frontier of the throughput–latency tradeoff, improves peak input throughput by 26%, and cuts p90 TTFT by up to 73% at the same concurrency.

FlashStates vLLM SGLang best vLLM or SGLang
All readings

BibTeX

@article{flashstates2026,
  title   = {FlashStates: Unlocking Flexible Hybrid State Management
             for Agentic LLM Inference},
  author  = {Li, Chenxi and Xu, Weili and Zhang, Tianyi and Wang, Jue and
             Zhou, Zhongzhu and Xu, Chenfeng},
  journal = {alphaXiv preprint},
  year    = {2026},
  url     = {https://www.alphaxiv.org/abs/2611.flashstate}
}