Boyang Yue

Software Engineering, Big Data, and the miscellaneous

05 Nov 2026

Memory, Not FLOPs: An Exploration of LLM Inference Optimization

Serving a large language model is mostly a matter of moving bytes. To generate one token, a GPU reads the model’s weights and the cached keys and values of earlier tokens, performing very little arithmetic per byte fetched from high-bandwidth memory (HBM). Most inference optimizations follow from that imbalance: they shrink the bytes, read them across more tokens at once, reuse cached state instead of recomputing it, remove duplicate copies across GPUs, or cap concurrency before eviction turns cached history back into prefill work.

Two long-horizon agents built for the ARC Prize 2026 provide the measurements below: a Python program-synthesis solver for ARC-AGI-2 and an interactive game-playing agent for ARC-AGI-3. Both serve Qwen3.8-Flash-Next on vLLM (versions 0.31 and 0.32) on fixed hardware: four PCIe-connected 24 GB NVIDIA L4 GPUs (TP=4) for the puzzle solver, and one 96 GB NVIDIA RTX PRO 6000 Blackwell GPU (TP=1) for the game agent.

Flash-Next holds 125 billion parameters on device (about 6 billion active per token, hidden dimension 2,560) plus a 51.2-billion-parameter n-gram embedding table (20M by 2,560) kept in host RAM. Its 48 layers repeat three Gated DeltaNet recurrent layers (56.2 MB of fixed-size state per sequence across 36 layers) followed by one sparse-attention layer (12 attention layers total, 24 query heads, 2 KV heads of dimension 256, attending to at most 2,048 selected tokens per query). Every layer’s mixture-of-experts (MoE) block routes each token to 10 of 512 routed experts (intermediate dimension 640) plus 1 shared expert. Sessions run for dozens to hundreds of turns and routinely cross 100,000 tokens.

Prefill, decode, and the memory wall

Inference runs in two phases. Prefill processes all tokens of an incoming prompt in parallel, so the GPU multiplies matrices by matrices and keeps its tensor cores busy. Autoregressive decode then produces one token per step for each active sequence. Every decode step streams all active weights plus each sequence’s cached keys and values while performing roughly two floating-point operations per weight read.1 Because modern GPUs supply hundreds of FLOPs per byte of HBM bandwidth, small- and medium-batch decode sits far down the memory-bound slope of a roofline plot.2

Batching is the main remedy. One read of the weights serves every active sequence in the step, so decode throughput grows with concurrency until arithmetic catches up at the hardware ridge point:

def ridge_batch(peak_tflops, bandwidth_gbs, bytes_per_weight):
    """Decode batch size where a dense model reaches the compute roof.
    A token costs 2 FLOPs per weight, and each step reads every weight once.
    KV-cache traffic is omitted; including it pushes the ridge higher."""
    flops_per_byte = peak_tflops * 1e12 / (bandwidth_gbs * 1e9)
    return flops_per_byte * bytes_per_weight / 2

# NVIDIA L4: 121 dense BF16 TFLOPS and 300 GB/s of HBM bandwidth
print(round(ridge_batch(121, 300, 2.0)))  # 403 sequences with 16-bit weights
print(round(ridge_batch(121, 300, 0.5)))  # 101 sequences with 4-bit weights

Roofline of one L4: BF16 tensor cores, 300 GB/s of memory bandwidth1101001,00010,0000.1110100arithmetic intensity: FLOPs per byte read from memoryattainable TFLOPSridge: about 400 FLOPs per bytememory-bound:time is set by bytes readcompute-bounddecode, 1 sequence, 16-bit weightsdecode, 16 sequences, 4-bit weightsprefill, 4,096-token prompt
Below about 400 FLOPs per byte, an L4 is limited by memory bandwidth. Decode sits far down the slope even with 16 sequences and 4-bit weights; only the prefill of a long prompt reaches the compute roof.

Long before a batch reaches a hundred sequences, memory runs out in capacity. Every active or paused session needs its key-value (KV) state resident beside the weights and runtime buffers, so remaining VRAM sets the sustainable batch size. Bandwidth sets the time per step; capacity sets how many sequences share it.

The puzzle solver hit both limits right away. Under stock TP=4 settings on four L4s, model weights took 18.2 GiB per GPU and left 1.6 GiB for the KV pool: 248,000 tokens total, enough for 5 concurrent sessions decoding at 155 tokens per second combined. Because the MoE kernels already ran near 90% of measured HBM bandwidth, faster arithmetic had little to offer; freeing memory to admit more concurrent sessions did.

Accounting for the KV cache

In a standard transformer using grouped-query attention (GQA),3 each token appends one key vector and one value vector per KV head in every attention layer. Across LL attention layers, HKVH_{\text{KV}} KV heads of dimension DheadD_{\text{head}}, and element width bb bytes, the per-GPU attention cache per token under tensor parallelism tp is:

def kv_bytes_per_token(attn_layers, kv_heads, head_dim, dtype_bytes, tp=1):
    """Logical attention KV bytes per token on each GPU."""
    heads_per_gpu = max(1, kv_heads // tp)   # a GPU cannot hold a fractional head
    return 2 * attn_layers * heads_per_gpu * head_dim * dtype_bytes

print(kv_bytes_per_token(80, 8, 128, 2))        # Llama 3 70B, BF16: 327,680
print(kv_bytes_per_token(12, 2, 256, 1))        # Qwen3.8-Flash-Next, FP8: 12,288
print(kv_bytes_per_token(12, 2, 256, 1, tp=4))  # Flash-Next over 4 GPUs: 6,144 each

A 100,000-token session of Llama 3 70B (model report) requires about 33 GB of BF16 KV state, more than a single 24 GB card holds before weights are loaded. Flash-Next combines three architectural choices to shrink that cost by an order of magnitude. It shares 2 KV heads across 24 query heads instead of 8 across 64; it stores cached keys and values in FP8 (1 byte per element); and it replaces three of every four layers with Gated DeltaNet recurrent layers,4 whose 56.2 MB state per sequence stays the same size regardless of history length (see the architecture report and vLLM’s notes on hybrid models). Cache precision alone can move end-to-end results: another team running Flash-Next on an RTX PRO 6000 switched from BF16 to FP8 KV, spent the freed memory on longer histories, and raised its game score from 14.5 to 22.5.

Sparse attention, by contrast, saves bandwidth rather than capacity. Because Flash-Next’s attention layers read at most 2,048 selected keys per query, decode speed stays flat as history grows (59.4, 60.3, and 58.9 tokens per second per stream at 64K, 128K, and 192K contexts on the L4s), whereas cold prefill still pays for length (82 seconds for 183,651 uncached tokens). Every past token must stay cached in case a later query selects it, alongside a compressed key index for the selector itself. On the four L4s with one speculative draft layer enabled (12 target sparse-attention layers plus 1 draft layer, or 13 layers total), TP=4 cannot split 2 KV heads across 4 GPUs, so ranks 0 and 1 both cache Head A and ranks 2 and 3 both cache Head B. Each layer stores 512 B of FP8 K/V (2 * 256 * 1) plus 32 B for the sparse indexer’s 4x-compressed 128-dimensional shared key, totaling 544 B per token per layer, or 13 * 544 = 7,072 bytes per token on every GPU.

Physical allocation adds another constraint. Under PagedAttention,5 vLLM divides KV memory into fixed-size page blocks so sequences grow without external fragmentation. In a hybrid recurrent-attention model, resuming from a cached prefix requires both the attention keys and values and a snapshot of all 36 recurrent layers at the exact token position where the prefix ends. To share a single paged pool between attention KV and 56.2 MB recurrent snapshots, vLLM’s hybrid KV cache manager inflates physical block sizes to 816 tokens on the TP=4 L4s and 1,664 tokens (21.8 MiB per block) on the TP=1 RTX PRO 6000, against 16 tokens for a standard attention-only model.

Attention-only model: 16-token blocksprefix still reusabletail evicted:re-prefill only the tailHybrid model: 816-token blocks, a recurrent-state checkpoint at each block end816 tokenseven if every block's attention keys and values are still cachedsuperseded checkpoints: never reusednewest checkpoint evicted:no usable checkpoint remains,re-prefill the whole historyLRU evicts the superseded checkpoints first, so the newest is usually the last one left
An attention-only cache that loses its tail still serves the rest of the prefix. A hybrid cache can resume only where a recurrent-state checkpoint survives; superseded checkpoints are never reused and go first, so losing the newest checkpoint means re-prefilling the whole history.

Large blocks and exact-position snapshots change how eviction behaves under memory pressure. When an attention-only cache evicts the tail of an idle session, the surviving prefix still works. In a hybrid cache, mid-session recurrent checkpoints are superseded as the trajectory grows and age toward eviction first; once the newest tail checkpoint is evicted too, the remaining attention blocks have no valid recurrent state to resume from, and the session has to re-prefill its entire history.

Shrinking weights and reservations

Weights claim the rest of GPU memory and account for most of the bytes read per decode step. Weight-only formats such as W4A16 store parameters in 4 bits and dequantize to 16 bits in registers, cutting both static memory and decode bandwidth. Calibration methods including GPTQ, AWQ, and AutoRound choose per-group rounding to preserve output quality,6 paired with fused dequantization kernels such as Marlin.7 Formats that quantize activations as well, such as FP8,8 also speed up matrix arithmetic during compute-bound prefill and large-batch verification.

Nominal 4-bit formats still differ in size because every group of weights carries a scale factor:

def bits_per_weight(value_bits, scale_bits, group_size):
    return value_bits + scale_bits / group_size

print(bits_per_weight(4, 16, 128))  # INT4, FP16 scale per 128 weights: 4.125
print(bits_per_weight(4, 8, 32))    # MXFP4, E8M0 scale per 32 weights: 4.25
print(bits_per_weight(4, 8, 16))    # NVFP4, FP8 scale per 16 weights:  4.5

Microscaling formats like MXFP4 and NVFP4 spend extra bits on finer group scales for accuracy and native tensor-core support. When capacity is the bottleneck, those scale bits displace KV cache directly. About 120 billion of Flash-Next’s 125 billion on-device parameters live in MoE experts, taking 62 GB in Intel’s W4A16 AutoRound group-128 checkpoint. Storing those same experts in NVFP4 adds roughly 6 GB, enough to crowd out 450,000 cached tokens on the RTX PRO 6000.

On top of the 4-bit experts, quantizing all 284 remaining BF16 linear projections (across the attention, recurrent, and residual-gating blocks) to FP8 at load time freed about 1.5 GiB per L4 GPU (2.44 GiB per GPU combined with FP8 KV), adding room for over 200,000 cached tokens with no measurable loss on a 64-task synthesis screen (47.0 versus 47.33 tasks solved, +3.15% held-out negative log-likelihood). Reclaiming unused runtime reservations helped as well. During startup profiling, vLLM estimates memory needed for CUDA graphs (#30515, enabled by default since #38284). On a four-GPU test node, that estimator set aside 0.55 GiB for graphs that actually used 0.22 GiB; turning the estimate off (VLLM_MEMORY_PROFILER_ESTIMATE_CUDAGRAPHS=0) grew the KV pool by 8.6%.

Bytes that are only indexed rather than multiplied do not need to live in GPU HBM at all. Flash-Next’s 51.2B-parameter n-gram embedding table stays in pinned host RAM and transfers only kilobytes per token over PCIe. Storing that table in FP8 rather than BF16 halved its host footprint from 95.4 GiB (102.4 GB) to 47.7 GiB (51.2 GB), and setting PYTORCH_CUDA_ALLOC_CONF=pinned_max_cached_size_mb:1024 prevented PyTorch’s caching host allocator from rounding a ~96 GB pinned buffer up to a 128 GB power-of-two block, cutting peak host RSS from 140.1 GB to 106.4 GB.

Validating lossy changes against numerical noise floors

Quantization and pruning discard information, while concurrent GPU serving is itself slightly nondeterministic unless kernels enforce batch invariance. Checking a lossy change cleanly means working from fast numerical screens up to full task evaluations, calibrated against measured noise floors.

Start by measuring the noise floor in the exact metric you plan to compare. Scoring the identical text twice under the same FP8 setup on the RTX PRO 6000 shifted average negative log-likelihood (NLL) by 0.002 nats per token and changed the greedy next token at 11% of positions, while swapping MoE kernel backends on identical weights produced a Kullback-Leibler (KL) divergence of 0.0146 nats per token (inside which engine upgrades at 0.0127 to 0.0147 sat comfortably). Against that floor, an online MXFP8 conversion of the dense projections raised NLL by 0.047 nats per token (+3.8%), failed a pre-set 1% gate, and was dropped in minutes.

Parity gates that compare decoded token log-probabilities against a fresh prefill of those same tokens have to budget for a larger architectural gap. Even with speculation disabled, Flash-Next showed a persistent 0.057 to 0.064 nats-per-token KL gap between decode and prefill: FP8 KV reads during decode differ by ~1 unit in the last place (ulp) from BF16 activations inside a prefill chunk, and 48 layers of discontinuous top-10-of-512 MoE routing and top-512 sparse-key selection amplify single-ulp flips into noticeable logit shifts. Modest NLL increases of 3% to 4% (like the load-time FP8 dense pass) work better as triggers for matched-token and matched-time task screens than as automatic rejections, with the caveat that a 64-task screen catches large regressions rather than 1-to-2-point shifts (a 4-bit checkpoint of dense Qwen3.8-27B matched its FP8 baseline on 63 tasks without ruling out a small drop). Changes expected to be mathematically exact still warrant a 0.0 ulp synthetic check.

Mixture-of-experts byte scaling and pruning

A mixture-of-experts layer separates parameter capacity from per-token arithmetic by routing each token to kk of EE feed-forward experts (k = 10 of E = 512 in Flash-Next). Its memory bandwidth scales differently from a dense model’s. A dense model reads 100% of its weights at batch size 1, so the next few concurrent sequences ride almost for free. In a sparse MoE, a decode step must stream the union of experts touched by any token in the active batch. Under independent uniform routing across nn tokens evaluated in the pass, the expected number of distinct routed experts read per layer is:

Etouched(n)=E(1−(1−kE)n) E_{\text{touched}}(n) = E\left(1 - \left(1 - \frac{k}{E}\right)^{n}\right)

When speculative decoding verifies dd draft tokens alongside the current token for each of BB running sequences, all n=(d+1)Bn = (d + 1)B tokens route through the MoE blocks in one pass. Each Flash-Next expert holds three 2,560-by-640 projections (4.92M parameters, or 2.53 MB in 4-bit group-128 quantization). On the single-GPU RTX PRO 6000 (d = 3, so n = 4B), streaming ~280 experts per layer (routed plus shared) across 48 layers plus the drafter at B=10B = 10 reads 35 to 37 GB of weights per step, dwarfing ~1 GB of sparse-attention KV reads and ~1.1 GB of recurrent-state traffic:

Running sequences (BB)Expected routed experts / layerAggregate tok/sPer-sequence tok/sStep time (ms)
13917217216.4
27533216616.4
413950112521.3
619360210026.9
82407319129.5
102797517535.4

Fitting tstep=a+b⋅Etouched(4B)+c⋅Bt_{\text{step}} = a + b \cdot E_{\text{touched}}(4B) + c \cdot B put fixed launch overhead at 10.9 ms, per-sequence overhead at 0.18 ms, and expert streaming at 83.8 microseconds per touched expert across all 48 layers (48 * 2.53 MB = 121.4 MB), which works out to 1.45 TB/s of sustained HBM bandwidth, or 91% of the card’s 1.597 TB/s hardware peak. Tuning the MoE matrix-multiplication kernels moved throughput by only -0.44% to +0.36%; compute kernels have almost no slack left once HBM is saturated. Calibrated against a published gpt-oss-120b benchmark on the same GPU (32.5 ms predicted versus 32.2 ms reported inter-token latency), the same byte model projected 400 to 500 tokens per second at 10 to 14 long-context streams versus 751 for Flash-Next, alongside a 1.5x larger KV footprint and linear-in-context full-attention reads. That back-of-the-envelope check ruled out the candidate before any serving code was written. Cluster-scale expert parallelism faces the same batch-union arithmetic across nodes.

Because an MoE needs high concurrency to share expert reads and concurrency is bounded by KV capacity, pruning rarely used experts turns cold weight bytes into active sessions. Trained MoE routers are heavily skewed,9 and whenever top-kk routing renormalizes selected weights, masking router logits reproduces a pruned checkpoint up to floating-point rounding:

import torch

def keep_mask(route_weight, n_keep):
    """Select the n_keep highest-mass experts per layer on representative traffic."""
    top = route_weight.topk(n_keep, dim=-1).indices
    return torch.zeros_like(route_weight, dtype=torch.bool).scatter_(-1, top, True)

def route(logits, keep, top_k=10):
    """Top-k routing restricted to kept experts."""
    probs = logits.masked_fill(~keep, float("-inf")).softmax(-1)
    weights, experts = probs.topk(top_k, dim=-1)
    return weights / weights.sum(-1, keepdim=True), experts

Three habits keep expert pruning reliable. Rank experts on representative traffic (an agent writing Python leans on different experts than a general chatbot) and weight them by router probability times expert output norm, as in REAP,10 rather than raw selection counts. Check the physical pruned weight loader against the router mask; doing so on the solver caught a tensor-batching bug in how pruned expert weights were packed at load time. And judge candidate sizes on multi-turn task scores rather than held-out loss.

Across 3.4 million logged tokens of solver traffic on the L4s, the top 384 of 512 experts per layer (three quarters of them) carried 98.35% of routing weight (96.68% in the flattest layer; 1.68% mass dropped out-of-sample versus 1.65% in-sample). Held-out NLL rose 0.90% at 448 experts, 2.75% at 384, and 6.21% at 320. On the 64-task synthesis screen, 384 experts matched the unpruned solve rate (47.33 tasks, versus 41.0 at 320), running 11% longer per episode (39.3K versus 35.3K tokens) while combining with load-time FP8 projections to quadruple the KV pool from 248K to 981K tokens (903K at a 131K context cap). On the RTX PRO 6000, keeping 448 experts via REAP saliency grew the KV pool 34% and replay throughput 9.3% (14 to 18 sessions). Pruning to 256 experts on game traces, by contrast, raised held-out NLL by only 16% (3% at 384) yet lost a third of the live game score at equal tokens, with 20% to 60% more actions per stage. An agent compounds small errors over hundreds of decisions, and an average over tokens hides them.

Parallelism and rank-pair KV ownership

When weights do not fit on one GPU, tensor parallelism splits each layer’s matrices across GPUs and inserts an all-reduce after every attention and MoE block.11 Interconnect bandwidth sets the price. On the solver’s four L4s, which have no NVLink, forcing GPU peer-to-peer transfers via NCCL_P2P_LEVEL ran all-reduces 7.6 times slower than NCCL’s default path through host shared memory. Small decode batches also expose CPU kernel-launch overhead, where capturing CUDA graphs instead of running eagerly (alongside configuration tuning on gpt-oss-120b at batch 4) raised decode from 55 to 206 tokens per second.

Tensor parallelism adds a second, quieter memory cost whenever HKV<TPH_{\text{KV}} < \text{TP}. Splitting 24 query heads across 4 GPUs (6 per rank) while holding only 2 KV heads forces ranks (0, 1) to duplicate Head A and ranks (2, 3) to duplicate Head B. Sequence-sharded decode context parallelism and Helix12 avoid that duplication by sharding KV along the sequence dimension and merging partial attention results across ranks, but Flash-Next’s sparse-attention backend in vLLM 0.32 did not support sequence sharding.

Instead, the four-L4 deployment removed duplication across the 12 target sparse-attention layers without a custom kernel (KV-owner). Within each rank pair (0, 1) and (2, 3), ownership of a target layer alternates between even and odd layers while the single MTP draft layer remains replicated. On layers a rank owns, it caches the pair’s single KV head and sparse-indexer keys, computes all 12 query heads that read that KV head, sums both 6-head output projections, and passes the result to the existing TP4 row-parallel all-reduce; its partner caches nothing for that layer and contributes zeros to the same collective:

def owns(layer, rank):
    # Alternate ownership within each rank pair (0-1, 2-3) across 12 target layers.
    return layer % 2 == rank % 2

def sparse_attention_forward(layer, rank, x):
    if not owns(layer, rank):
        return all_reduce_sum(zeros_like(x))
    pair = rank // 2
    k, v = kv_proj(x, pair)          # single KV head cached on owner rank only
    selected = indexer(x)            # sparse key indices cached on owner rank only
    heads = HEADS[2 * pair] + HEADS[2 * pair + 1]
    a = sparse_attn(q_proj(x, heads), k, v, selected)
    y = a[HEADS[2 * pair]] @ W_O[2 * pair] + a[HEADS[2 * pair + 1]] @ W_O[2 * pair + 1]
    return all_reduce_sum(y)

Stock tensor parallelism: 2 KV heads on 4 GPUsa GPU cannot hold part of a head, so each KV head is stored on two GPUsGPU 0KV head 0, all layers6 query headson every layerGPU 1copy of KV head 06 query headson every layerGPU 2KV head 1, all layers6 query headson every layerGPU 3copy of KV head 16 query headson every layerevery key and value is stored twice · 12 sessions fitOwner layout: one copy per pair, ownership alternates by layerthe owner computes all 12 query heads of its KV head; its partner adds zeros to the same all-reduceGPU 0KV head 0, even layerseven layers: 12 query headsodd layers: adds zerosGPU 1KV head 0, odd layersodd layers: 12 query headseven layers: adds zerosGPU 2KV head 1, even layerseven layers: 12 query headsodd layers: adds zerosGPU 3KV head 1, odd layersodd layers: 12 query headseven layers: adds zerosone copy of each key and value, no new communication · 20 sessions fit
With two KV heads on four GPUs, stock tensor parallelism stores every key and value on two GPUs. In the owner layout, one GPU of each pair holds a layer's cache and computes all of its query heads while the partner adds zeros to the existing all-reduce; ownership alternates by layer.

Alternating ownership by layer keeps projection weight bytes balanced across all four GPUs while cutting per-GPU attention state from 13 * 544 = 7,072 bytes per token to (6 + 1) * 544 = 3,808 bytes per token (a 1.86x reduction on attention KV, expanding the net pool including fixed recurrent slots by 1.78x from 903,191 to 1,607,959 tokens and raising concurrency from 12 to 20 sessions). Running each layer’s attention on two of four GPUs cost less than 1% decode speed at matched 12-stream concurrency (371.1 versus 374.7 tokens per second) and ~15% on 200K-token cold prefills, while raising full-load decode from 406 to 530 tokens per second. Startup checks across synthetic cache sizes matched stock two-rank attention to 0.0 ulp up to output-projection reduction order. Similar duplication hides wherever a model has fewer of something than the GPUs it is split across: KV heads, embedding shards, or draft layers.

Reusing computation: prefix caching and sawtooth trimming

Multi-turn workloads send nearly the same prompt over and over. In the game agent’s logs, an average request carried 72,000 prompt tokens and generated 1,900, a ratio of 38 to 1. Automatic prefix caching in vLLM and RadixAttention in SGLang hash fixed-size token blocks with their prefix lineage so a turn that extends an earlier request computes only the new suffix.513

Each turn re-sends the whole historyserved from the prefix cachenew input: prompt, tool outputgenerated by the modelturn 1promptreplyturn 2cachedtoolreplyturn 3cachedtoolreplyonly the tool output is new,if the cache still holds the restThe cache has to hold paused sessions tooweightsworkspacerunningpausedrunningpausedpausedrunningcache: the history of every admitted sessiondecoding nowpaused: tool running or request queued
Each turn re-sends the previous request plus the model's reply and the tool's output; with a warm prefix cache, only the tool output is new. The cache, whatever the weights and workspace leave, must hold the history of every admitted session, including those paused while a tool runs.

Two details of agent traffic decide whether the cache holds up. Requests are append-only only when every earlier token ID stays bit-identical. And sessions pause while tools run or requests wait in the queue: a paused session leaves the active decode batch, yet its cached blocks have to survive until its next turn arrives.

Preserving exact token prefixes and draining in sawtooth blocks

Harnesses break prefix identity in subtle ways without changing visible text. Storing a conversation as strings and re-rendering it through a chat template each turn can alter whitespace or special-token boundaries (4 of 24 turns diverged in a template round-trip check). Many reasoning models’ chat templates strip earlier turns’ thinking blocks by default, rewriting every prior turn on every request. And editing anything near token zero invalidates everything after it: Flash-Next’s chat template writes the reasoning-effort setting into line one of the system prompt, so changing effort mid-session or updating system instructions at a new game stage forced full re-prefills of up to 116,000 tokens.

Sending token IDs directly to /v1/completions after turn one removes client-side drift. Each follow-up request concatenates the previous prompt IDs, the exact generated IDs, and the tokenized tool-turn wrapper, while logging first_mismatch on every turn to catch accidental edits:

import requests

VLLM, MODEL = "http://localhost:8000", "flash-next"

def tokenize(text):
    body = {"model": MODEL, "prompt": text, "add_special_tokens": False}
    return requests.post(f"{VLLM}/tokenize", json=body).json()["tokens"]

def generate(prompt_ids, stop_id, **sampling):
    """Submit token IDs directly and return generated text plus exact token IDs."""
    body = {"model": MODEL, "prompt": prompt_ids, "return_token_ids": True,
            "stop_token_ids": [stop_id], **sampling}
    choice = requests.post(f"{VLLM}/v1/completions", json=body).json()["choices"][0]
    ids = choice["token_ids"]
    if stop_id in ids:            # speculative verification can accept past stop_id
        ids = ids[: ids.index(stop_id) + 1]
    return choice["text"], ids

def first_mismatch(prev_ids, next_ids):
    """First index where next_ids diverges from prev_ids, or None if it extends it."""
    for i, (a, b) in enumerate(zip(prev_ids, next_ids)):
        if a != b:
            return i
    return None if len(next_ids) >= len(prev_ids) else len(next_ids)

Even with token-exact continuation, long sessions eventually reach the model’s 131,072-token context limit. Dropping the single oldest turn on every request (a sliding window) shifts token zero every time and forces a ~118K-token re-prefill on every call. Sawtooth (hysteresis) trimming avoids that churn: the harness lets history grow to ~118K tokens (leaving headroom for a full 12,288-token completion plus wrapper overhead) and then drops the oldest atomic (user, assistant, tool) turn blocks down to ~56K tokens in one step. Draining half the window at once pays a single ~56K re-prefill (4 to 6 seconds) every ~40 turns, followed by ~40 turns of append-only cache hits (93.6% overall prefix reuse across 152 trims). Because the prefix is already invalidated on a drain turn, that step is also the one free moment to replace old visual renders and middle-truncate verbose tool outputs without extra cache misses.

Hybrid checkpoint retention and drafter block policies

Engine policies can cut cache hits short even when client token IDs match. Because recurrent layers resume only from a saved state snapshot, vLLM applies a checkpoint-retention interval (#45845) that since version 0.29 defaults to 0 (#52216), retaining only the latest prompt-end boundary rather than the end of the generated reply. Multi-turn requests continue from the reply, so the default forced every turn to re-prefill its entire prior generation, dropping TP=1 prefix reuse from 94.1% to 69.4% and raising TP=4 recomputed prompt tokens per generated token from 0.35 to 2.75. Passing --prefix-cache-retention-interval None restores dense retention (now automatic when an EAGLE or MTP drafter is enabled, #55760); Marconi studies hybrid checkpoint retention policies more generally.14

Speculative drafters added a second truncation rule. For EAGLE and MTP heads, vLLM treats the last cached block of every matched prefix as volatile and recomputes it to guard lookahead state at block boundaries. Recomputing a 16-token block costs almost nothing; recomputing an 816-token or 1,664-token hybrid block left about 3,000 tokens uncached per turn against 600 with disable_eagle_block_drop (#53388), and hashing the lookahead token directly into each block’s prefix key avoids the drop altogether.

Auditing cache efficiency in live metrics

vLLM’s Prometheus counters show how many uncached prompt tokens the server processes per generated token:

import re, time, urllib.request

COUNTERS = ("prompt_tokens", "prompt_tokens_cached", "generation_tokens", "num_preemptions")

def read_counters(url="http://localhost:8000/metrics"):
    text = urllib.request.urlopen(url).read().decode()
    return {name: sum(float(v) for v in re.findall(
                rf"^vllm:{name}_total(?:{{[^}}]*}})? (\S+)$", text, re.M))
            for name in COUNTERS}

before = read_counters(); time.sleep(300); after = read_counters()
d = {name: after[name] - before[name] for name in COUNTERS}
print("uncached prompt / generated:",
      round((d["prompt_tokens"] - d["prompt_tokens_cached"]) / d["generation_tokens"], 2))
print("preemptions:", int(d["num_preemptions"]))

On append-only agent traffic, that ratio should sit near the ratio of new tool-output tokens to generated tokens; higher numbers mean the server is re-reading history. Per request, --enable-prompt-tokens-details reports cached_tokens in the response usage block, and where the hit stops points to the cause:

  • Within one block of the previous turn’s end: healthy append-only reuse.
  • At the end of the previous prompt, short of the assistant reply: missing end-of-decode checkpoint retention.
  • One or two hybrid blocks early with speculation active: drafter block drop.
  • At first_mismatch(prev_ids, next_ids): harness or chat-template rewrite.
  • At shifting earlier positions, or zero when token IDs match: server-side eviction.

Speculative decoding on sparse MoE models

Speculative decoding pairs a cheap drafter with parallel target verification via lossless rejection sampling,15 using small separate models, EAGLE heads, or built-in multi-token-prediction (MTP) layers.16 Sparse MoEs alter the trade-off in two ways. Whereas verifying dd draft tokens in a dense model reuses the same weight reads, every draft token in an MoE routes to experts (n = (d + 1)B), adding HBM traffic to each verification step. And the drafter competes for KV memory: its weights, its own attention cache, extra recurrent-state slots per draft position, and larger CUDA graphs shrank a four-GPU Flash-Next test pool by ~20% at d = 1 and by ~32% at d = 3.

Optimal draft depth therefore saturated early and tracked available memory bandwidth. On the TP=4 L4s at 16 concurrent sessions, d = 1 accepted 1.81 tokens per step and raised decode throughput 23.7% for an 11.4% net pool cut (half offset by reclaiming unused CUDA-graph reservations); d = 2 accepted 33% more tokens per step while slowing verification 32%, netting ~1% for a steeper memory loss. On the 1.6 TB/s RTX PRO 6000, d = 3 was the sweet spot (735 to 767 tokens per second versus 652 at d = 4).

Two refinements raised speculative throughput without sacrificing exactness. On TP=4, projecting draft hidden states across all 248,320 vocabulary entries and all-gathering logits added ~1 ms per step. Restricting the draft head to the 24,576 most frequent token IDs (FR-Spec17) cut over 90% of that projection (+3.8% decode throughput, acceptance steady at 1.80 to 1.81); setting draft probability q′(x)=0q'(x) = 0 outside the shortlist keeps target sampling exact because rejected drafts resample from the normalized residual max⁡(0,p−q′)\max(0, p - q') over the full 248,320 vocabulary. At temperature = 1.0 on the game agent, replacing greedy argmax drafts (2.58 accepted tokens at 14 streams) with temperature-matched sampled drafts plus joint block verification (rejection_sample_method: block) lifted acceptance to 2.81 and decode throughput by +8.2% in replay (+9% to +10% live), whereas block verification on greedy drafts lost 2.0%.

Host CPUs and hybrid block alignment each caused sharp regressions when overlooked. Enabling d = 1 MTP gained 31% on one rented host, 24% on the deployment L4s, and under 6% on a host whose CPUs were capped at 2.35 GHz, where Python scheduling and launch overhead ate the GPU speedup. On the RTX PRO 6000, an external DFlash2 drafter initially ran at just 285 tokens per second with under 3% prefix cache hits: its FlashInfer backend requested 64-token pages, each of which claimed an entire 1,664-token (21.8 MiB) hybrid-aligned block, stranding 25/26 (96%) of every slot and halving pool capacity (1.62M down to 835K tokens). Moving that drafter to Triton restored block alignment and the 1.62M pool (688 tokens per second), though built-in MTP still won (871 tokens per second, 2.77 versus 2.42 accepted tokens).

Scheduling, admission, and re-prefill storms

Continuous batching admits new requests into the active batch on every step,18 and chunked prefill splits long prompts into max_num_batched_tokens slices so active decodes keep moving while a prompt is processed. In a least-recently-used (LRU) block pool of size CC, a paused session’s blocks survive only if peers touch fewer than CC distinct blocks before its next turn arrives (its reuse distance19). For multi-turn traffic, the cache’s working set is the combined history of every admitted session, running or paused.

Spending freed memory on full context windows beat packing more short-window sessions. On the RTX PRO 6000, 16 sessions capped at 64K tokens ran 52% faster in trace replay than 10 full-window (116K) sessions and generated 32% more live tokens, yet game score fell (44.4 down to 41.1, stages cleared 105 down to 99) because twice-as-frequent trims forced the agent to spend 27% more tokens per action re-deriving cut context. Pushing the same GPU to 24 sessions crossed the working-set cliff outright: aggregate decode dropped from 920 to 598 tokens per second, prefix reuse fell from 94% to 69%, preemptions rose from 0 to 16, and mean queue wait jumped from 0.13 seconds to 15.

Anatomy of a hybrid re-prefill storm

On the four-L4 solver, exceeding the working set triggered multi-minute throughput collapses with zero errors and zero preemptions, while cumulative gauges barely moved:

Sample window (UTC)Running requestsPrompt tok/sGenerated tok/sKV pool usedCumulative hit rate
07:13:58170.063.182.8%97.0%
07:14:08187,429.563.284.5%96.5%
07:14:18180.064.585.5%96.5%

Decode rate had fallen from ~500 to 63 tokens per second (0 preemptions), yet KV pool used read 84.5% and cumulative prefix reuse stayed above 96% (drifting down to 91% only over longer windows even after the miss rate tripled). Two details of hybrid caching explain why the dashboard missed the stall and why the stall sustained itself.

First, vLLM’s KV usage gauge counts any unreferenced cached block as free because the allocator may evict it. Between turns, a session paused inside Python tool execution holds no active references, so its entire 70K-to-100K history, along with seven superseded mid-turn recurrent snapshots parked per 816-token block during earlier turns, shows up as free memory. The gauge tracks the running set rather than the working set.

Second, once memory pressure pushes a paused session’s newest recurrent checkpoint off the LRU tail, its next turn misses completely and has to re-prefill 70,000 to 100,000 tokens from token zero. Under max_num_batched_tokens = 1024, that single miss spans 70 to 100 consecutive mixed prefill-decode steps, stretching step time from 66 ms to 340 ms and writing a full history’s worth of new blocks into the pool. Peer sessions waiting in tool execution or the queue are delayed while those blocks churn through LRU, so their tail checkpoints age out before their next turn runs. That positive feedback loop is a classic metastable failure:20 a cluster of returning deep sessions pushes the server into self-sustaining re-prefill thrashing that persists after the trigger passes.

Pool nearly fullpaused histories count as freeEviction hits a paused sessionLRU drops its newest checkpointIts next turn misses the cacheit re-prefills 70K to 100K tokensRe-prefill slows every stepdecode steps 66 → 340 msnew blocks fill the pool,paused sessions wait longerthe sessioncomes backmeanwhile the dashboards showedno preemptionsprefix hit rate 97% → 91%Ruled out• dropping dead checkpoints: storms continued,because the pool was genuinely full• waiting for memory: about 5× more collapse,because waiting sessions still hold their historyAdmission control• admit sessions only below a cache-use bar• stricter bars for deeper extensions• refuse an extension rather than wait• plan for every admitted session at full length
Under memory pressure, eviction reaches a paused session's newest checkpoint; its return re-prefills the whole history, which slows every step and fills the pool with new blocks, so more paused sessions lose theirs. Dropping dead checkpoints and waiting for memory were ruled out as fixes; admission control kept the loop rare.

Two candidate fixes were tested on the same hardware and task set under pre-committed criteria (defining collapsed decode as throughput below half its full-load rate for 60 seconds or more) and ruled out. A 90-line engine patch purged superseded mid-turn recurrent snapshots as soon as a newer boundary existed, freeing 36,000 checkpoints across a stress run, yet 14 full-history misses and storms still fired at 84% to 96% occupancy when active histories genuinely exceeded the pool; dead checkpoints explained why the gauge read low, not why storms started. A second test let deep sessions wait up to 300 seconds for KV headroom instead of ending when a cap extension was refused, a policy that had looked slightly positive in occupancy-only cache simulations. On hardware, waiting blew up burst re-prefilled tokens from 0.52M to 2.77M, multiplied collapsed decode time from 5.8 to 28.7 minutes, and cut total generated tokens by 18%, because parked sessions still held their histories in the working set.

Bounding the working set directly via agent-level admission control broke the loop. New-session admission and context-cap extensions both gate on live KV occupancy below the 84% miss band, deeper extensions require wider headroom, and a refused extension ends the episode immediately rather than queueing for memory:

def may_admit(running, waiting, cache_use):
    """Start a new session only while KV occupancy leaves working-set headroom."""
    return running < 6 or (waiting == 0 and cache_use < 0.80)

def may_extend(new_cap, cache_use, waiting, sessions_at_new_cap):
    """Grant a deeper token cap immediately or refuse without waiting."""
    if new_cap == 80_000:
        return cache_use < (0.60 if waiting else 0.80)
    if waiting:
        return False
    if new_cap == 96_000:
        return cache_use < 0.70
    return cache_use < 0.65 and sessions_at_new_cap < 2     # 128,000 tokens

Under heavy load, the 128,000-token tier was granted on only one in nine requests, trading peak episode depth to keep the pool out of thrash. Offloading evicted prefixes to host RAM via connectors such as LMCache did not rescue hybrid misses in vLLM 0.31: at best 11% of a returning session’s tokens came back, and a connector hit could restore a Gated DeltaNet convolution state from the wrong block (#60861). Recent research prototypes address separate pieces of this problem through congestion-based agent admission in CONCUR,21 hierarchical hybrid state caching in HiState,22 and non-LRU eviction in RR-Evict.23

Measuring goodput, replaying steady state, and operating cleanly

Standard serving metrics answer narrow questions: time to first token (TTFT) and time per output token (TPOT) (tlast−tfirst)/(n−1)(t_{\text{last}} - t_{\text{first}})/(n - 1) describe what one caller waits for, raw token throughput describes hardware activity, and goodput counts how much of that output finishes within budget (the same overload divergence analyzed in an earlier post on throughput and latency). For long-running agents, what matters is completed tasks per hour, and tokens do not carry equal value. On the puzzle solver, tokens spent up to one full ~54K-token attempt per task bought over 10 times the score gain per token of retries past that point. Raising aggregate decode from 155 to 530 tokens per second and concurrency from 5 to 20 sessions carried the solver past that first-pass knee and, together with agent changes that needed the 131K window, lifted its solve rate from 35% to 75%.

Short benchmarks miss working-set cliffs because sessions have not reached steady-state length. On the RTX PRO 6000, admitting 16 to 17 sessions passed a 10-minute replay (+7% throughput) and a 2-hour soak (0 preemptions) only because games in the 2-hour window averaged 53,000 prompt tokens. Across a full 9-hour run where games settled near 100,000 tokens, 17 sessions exceeded the 1.59M-token pool: 10-minute throughput swung between 220 and 920 tokens per second, uncached prefill tripled from 6.8% to 23.4%, and total generated output fell 24% (5.64M down to 4.27M) against a 14-session cap. Serving all 512 unpruned experts at 16 to 18 sessions similarly shrank KV space enough to drop prefix reuse from 91.7% to 34.1% and cost ~12 game-score points.

Pre-production benchmarks catch these failures only when they reproduce steady-state occupancy:

  • Replay recorded multi-turn traces with ignore_eos pinned to historical output lengths, and skip the first 30 short turns of each session to remove warmup bias (639 tokens per second without the skip versus 487 at steady state). Closed-loop worker pools test throughput at matched concurrency, while replaying arrival timestamps measures open-loop queueing across TTFT, TPOT, and p95/p99 tails by cache-hit class (noting that frozen output lengths still cannot catch context cuts that force live agents to take extra turns).
  • Preserve between-turn pauses during replay; firing recorded turns back to back keeps every session active in the batch and hides idle-time LRU eviction.
  • Log mechanism metrics alongside task scores (uncached prompt tokens per generated token, burst re-prefilled tokens, collapsed-decode minutes, queue wait, preemptions), fix pass criteria in advance, and run multiple seeds on the same host because contention storms have wide variance (one solver configuration recorded 0 collapsed minutes on one stress pass and 22 on another).
  • Re-check flags and defaults on every engine upgrade: defaults like vLLM 0.29’s retention interval shift quietly, and half the cache pool seemingly lost during an upstream vLLM port traced to gpu_memory_utilization drifting from 0.98 to 0.97.

Three operational habits protect fixed-window runs in deployment. Count cold startup inside the clock budget: 10 minutes spent reading weights from throttled network storage (3 to 90 MB/s per stream on evaluation hosts) costs ~2% of a 9-hour run, whereas a 16-stream parallel prefetcher staying 10 GiB ahead of the loader cut the game agent’s 109 GiB load from 17 minutes to 3. Anchor any engine patch to the exact upstream source lines it modifies so version bumps fail loudly rather than running half-applied. And wrap the server in a watchdog fallback ladder that sheds optimizations one rung at a time (dropping speculation first, then online FP8 conversion, down to conservative stock settings) if startup or health checks trip.

Putting the levers together

Across the puzzle solver’s four 24 GB L4 GPUs, the memory and bandwidth changes compounded row by row:

Configuration (cumulative)Weights / GPUKV pool / GPUPool (tokens)Concurrent sessionsAggregate decode (tok/s)
Stock TP=4 settings18.2 GiB1.6 GiB248K5155
Load-time FP8 dense layers + 384/512 experts13.1 GiB6.4 GiB981K16379
d = 1 MTP drafter + reclaimed graph reservation13.7 GiB6.4 GiB869K16470
Deeper context limit (131K tokens)13.6 GiB6.5 GiB903K12406
Rank-pair KV-owner placement13.6 GiB6.5 GiB1.61M20530

Freeing 5.1 GiB of weights per GPU quadrupled the KV pool because cache capacity sat in whatever margin the weights left behind. Between the last two rows, physical cache bytes stayed at 6.5 GiB per GPU while KV-owner nearly doubled token capacity by removing pair-level head replication (minor pool shifts between rows 3 and 4 come from hybrid block alignment at the 131K cap).

Ordered by payoff per unit of risk, optimizing an inference stack comes down to seven steps:

  1. Measure prompt-to-output ratios, prefix overlap, steady-state context length, concurrency, and between-turn pause durations on real traffic.
  2. Write a byte-exact GPU memory ledger (weights, workspace, per-rank KV and index bytes, recurrent snapshots, profiler reservations) and reconcile it with the engine’s reported pool, flagging anything stored twice across ranks.
  3. Free lossless bytes first: unused graph reservations, narrower scale groups, host-pinned lookup tables, and deduplicated rank caches before lossy quantization or expert pruning, gating lossy changes on task-level screens.
  4. Spend freed VRAM on context depth before raw concurrency unless full-length runs show shorter windows still win on completed work.
  5. Keep prefixes token-exact, drain full windows in sawtooth blocks rather than sliding turns, retain end-of-decode hybrid checkpoints, and gate admission and extensions below the LRU miss band without waiting.
  6. Price speculative decoding at production concurrency, temperature, and host CPU speed, matching draft page sizes to hybrid block alignment and trimming draft vocabularies where logit projections hurt.
  7. Gate serving changes on steady-state multi-turn replays that preserve tool pauses and skip warmup turns, and re-verify engine defaults after every upgrade.

Tokens per second is what serving benchmarks report, and under tight memory budgets it is easy to inflate by cutting context or admitting sessions past the cache cliff. Useful throughput comes from the byte accounting underneath: sharing weight reads across as many sequences as memory allows, while keeping every admitted trajectory’s prefix intact until its next turn.

References


  1. Reiner Pope, Sholto Douglas, Aakanksha Chowdhery, Jacob Devlin, James Bradbury, Anselm Levskaya, Jonathan Heek, Kefan Xiao, Shivani Agrawal, and Jeff Dean. 2023. Efficiently scaling Transformer inference. In Proceedings of Machine Learning and Systems (MLSys), 2023. ↩︎

  2. Samuel Williams, Andrew Waterman, and David Patterson. 2009. Roofline: An insightful visual performance model for multicore architectures. Communications of the ACM 52, 4 (2009), 65–76. ↩︎

  3. Joshua Ainslie, James Lee-Thorp, Michiel de Jong, Yury Zemlyanskiy, Federico Lebrón, and Sumit Sanghai. 2023. GQA: Training generalized multi-query Transformer models from multi-head checkpoints. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing (EMNLP), 2023. 4895–4901. ↩︎

  4. Songlin Yang, Jan Kautz, and Ali Hatamizadeh. 2025. Gated delta networks: Improving Mamba2 with delta rule. In International Conference on Learning Representations (ICLR), 2025. ↩︎

  5. Woosuk Kwon, Zhuohan Li, Siyuan Zhuang, Ying Sheng, Lianmin Zheng, Cody Hao Yu, Joseph E. Gonzalez, Hao Zhang, and Ion Stoica. 2023. Efficient memory management for large language model serving with PagedAttention. In Proceedings of the 29th Symposium on Operating Systems Principles (SOSP ‘23), 2023. 611–626. ↩︎ ↩︎

  6. Wenhua Cheng, Weiwei Zhang, Haihao Shen, Yiyang Cai, Xin He, Kaokao Lv, and Yi Liu. 2024. Optimize weight rounding via signed gradient descent for the quantization of LLMs. In Findings of the Association for Computational Linguistics: EMNLP 2024, 2024. 11332–11350. ↩︎

  7. Elias Frantar, Roberto L. Castro, Jiale Chen, Torsten Hoefler, and Dan Alistarh. 2025. MARLIN: Mixed-precision auto-regressive parallel inference on large language models. In Proceedings of the 30th ACM SIGPLAN Annual Symposium on Principles and Practice of Parallel Programming (PPoPP ‘25), 2025. 239–251. ↩︎

  8. Paulius Micikevicius, Dusan Stosic, Neil Burgess, Marius Cornea, Pradeep Dubey, Richard Grisenthwaite, Sangwon Ha, Alexander Heinecke, Patrick Judd, John Kamalu, Naveen Mellempudi, Stuart Oberman, Mohammad Shoeybi, Michael Siu, and Hao Wu. 2022. FP8 formats for deep learning. arXiv preprint arXiv:2209.05433 (2022). ↩︎

  9. Xudong Lu, Qi Liu, Yuhui Xu, Aojun Zhou, Siyuan Huang, Bo Zhang, Junchi Yan, and Hongsheng Li. 2024. Not all experts are equal: Efficient expert pruning and skipping for mixture-of-experts large language models. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (ACL 2024), 2024. 6159–6172. ↩︎

  10. Mike Lasby, Ivan Lazarevich, Nish Sinnadurai, Sean Lie, Yani Ioannou, and Vithursan Thangarasa. 2026. REAP the experts: Why pruning prevails for one-shot MoE compression. In International Conference on Learning Representations (ICLR), 2026. ↩︎

  11. Mohammad Shoeybi, Mostofa Patwary, Raul Puri, Patrick LeGresley, Jared Casper, and Bryan Catanzaro. 2019. Megatron-LM: Training multi-billion parameter language models using model parallelism. arXiv preprint arXiv:1909.08053 (2019). ↩︎

  12. Nidhi Bhatia, Ankit More, Ritika Borkar, Tiyasa Mitra, Ramon Matas, Ritchie Zhao, Maximilian Golub, Dheevatsa Mudigere, Brian Pharris, and Bita Darvish Rouhani. 2025. Helix parallelism: Rethinking sharding strategies for interactive multi-million-token LLM decoding. arXiv preprint arXiv:2507.07120 (2025). ↩︎

  13. Lianmin Zheng, Liangsheng Yin, Zhiqiang Xie, Chuyue Sun, Jeff Huang, Cody Hao Yu, Shiyi Cao, Christos Kozyrakis, Ion Stoica, Joseph E. Gonzalez, Clark Barrett, and Ying Sheng. 2024. SGLang: Efficient execution of structured language model programs. In Advances in Neural Information Processing Systems 37 (NeurIPS 2024), 2024. 62557–62583. ↩︎

  14. Rui Pan, Zhuang Wang, Zhen Jia, Can Karakus, Luca Zancato, Tri Dao, Yida Wang, and Ravi Netravali. 2025. Marconi: Prefix caching for the era of hybrid LLMs. In Proceedings of Machine Learning and Systems (MLSys), 2025. ↩︎

  15. Yaniv Leviathan, Matan Kalman, and Yossi Matias. 2023. Fast inference from Transformers via speculative decoding. In Proceedings of the 40th International Conference on Machine Learning (ICML), 2023. 19274–19286. ↩︎

  16. Fabian Gloeckle, Badr Youbi Idrissi, Baptiste Rozière, David Lopez-Paz, and Gabriel Synnaeve. 2024. Better & faster large language models via multi-token prediction. In Proceedings of the 41st International Conference on Machine Learning (ICML), 2024. 15706–15734. ↩︎

  17. Weilin Zhao, Tengyu Pan, Xu Han, Yudi Zhang, Ao Sun, Yuxiang Huang, Kaihuo Zhang, Weilun Zhao, Yuxuan Li, Jie Zhou, Hao Zhou, Jianyong Wang, Zhiyuan Liu, and Maosong Sun. 2025. FR-Spec: Accelerating large-vocabulary language models via frequency-ranked speculative sampling. In Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), 2025. 3909–3921. ↩︎

  18. Gyeong-In Yu, Joo Seong Jeong, Geon-Woo Kim, Soojeong Kim, and Byung-Gon Chun. 2022. Orca: A distributed serving system for Transformer-based generative models. In 16th USENIX Symposium on Operating Systems Design and Implementation (OSDI 22), 2022. 521–538. ↩︎

  19. R. L. Mattson, J. Gecsei, D. R. Slutz, and I. L. Traiger. 1970. Evaluation techniques for storage hierarchies. IBM Systems Journal 9, 2 (1970), 78–117. ↩︎

  20. Nathan Bronson, Abutalib Aghayev, Aleksey Charapko, and Timothy Zhu. 2021. Metastable failures in distributed systems. In Proceedings of the Workshop on Hot Topics in Operating Systems (HotOS ‘21), 2021. 221–227. ↩︎

  21. Qiaoling Chen, Zhisheng Ye, Tian Tang, Peng Sun, Boyu Tian, Guoteng Wang, Shenggui Li, Yonggang Wen, Zhenhua Han, and Tianwei Zhang. 2026. CONCUR: High-throughput agentic batch inference of LLM via congestion-based concurrency control. arXiv preprint arXiv:2601.22705 (2026). ↩︎

  22. Zaifeng Pan, Lucas Wang, Xinwei Qiang, Yanbo Zhou, Chang Chen, Zhengding Hu, Yue Guan, and Yufei Ding. 2026. HiState: Hierarchical prefix cache management for hybrid LLM serving in agentic workloads. arXiv preprint arXiv:2610.41508 (2026). ↩︎

  23. Zaifeng Pan, Chris Wu, Zhengding Hu, Xinwei Qiang, Zhongkai Yu, and Yufei Ding. 2026. RR-Evict: Fine-grained prefix cache eviction beyond LRU for agentic LLM serving. arXiv preprint arXiv:2609.32278 (2026). ↩︎