TokenCake targets LLM multi-agent serving where tool calls create long KV-cache idle windows and graph-critical agents compete for scarce GPU blocks. It co-designs an event-driven Temporal Scheduler (opportunistic offload + predictive upload) and an agent-aware Spatial Scheduler (dynamic reserved/shared partitioning), cutting end-to-end latency by up to 47.06% and improving effective KV-cache utilization by up to 16.9% versus vLLM under load.
LLM -> function call -> LLM, stalled agents keep KV blocks on GPU but do no compute, wasting capacity.
Figure 2 visualizes the central temporal pathology: idle cache occupancy grows while agents wait on tool latency. The paper uses this to justify that "wait time" must become an explicit cache-scheduling signal rather than passive background time.
TokenCake introduces a KV-cache-centric but agent-aware serving stack with three cooperating pieces:
核心技术壁垒: the hardest-to-replicate part is not isolated offload or isolated priority scheduling, but a unified pressure-consistent coordination protocol that keeps temporal upload/offload and spatial admission decisions aligned on the same real-time capacity/debt view, avoiding destructive cross-scheduler interference.

Figure 4 gives the high-level architecture: frontend graph specification feeding two schedulers that co-manage KV lifecycle. The key structural decision is splitting temporal and spatial concerns while forcing a shared pressure view.

Figure 6 is the load-bearing control-flow figure. It shows the per-step ordering (snapshot -> reservation update -> temporal actions -> spatial batching), which is how TokenCake prevents upload and admission from racing over the same blocks.
The state machine captures the paper's agent-turn lifecycle and clarifies where policy gates apply. It complements the raster figures by making transition semantics explicit for implementation reasoning.
The paper does not provide a formal convergence/optimality proof for the two-scheduler policy. Its claims are justified by measurements, ablations, and sensitivity analyses.
| Symbol | Meaning | Role |
|---|---|---|
| $t_{estimate}$ | predicted tool-call duration | determines offload/upload timing window |
| $T_{transfer}$ | D2H + H2D migration round-trip cost | gate for whether offload is worth it |
| $B_{upload}$ | safe upload block budget | prevents upload from stealing critical waiting capacity |
| $B_{reserve}$ | per-step gradual reservation amount | avoids abrupt memory shock under high occupancy |
| $P_{req}$ | per-request priority | admission ordering for waiting requests |
| $S_a$ | per-agent-type score | decides who gets reserved capacity |

Figure 9 shows the headline throughput-latency behavior across workloads and models. TokenCake maintains lower latency under increasing QPS, indicating that KV-centric policies matter most when contention rises.

Figure 10 ties system speedup to memory-use quality rather than raw occupancy. The utilization lift supports the claim that reclaimed idle blocks are turned into useful active work.

Figure 11 is key for mechanism attribution: spatial-only and temporal-only each help partially, while the full design gives the best outcome. This supports the paper's "co-optimization, not substitution" argument.

Figure 17 validates the temporal policy's physical premise. The migration round trip remains much smaller than recomputation across tested context lengths, but still non-trivial enough to justify selective rather than unconditional offload.

Table 2 positions TokenCake against prior triggers/decision logic and helps explain why event-driven and agent-aware criteria are central to the observed gains.
| Step | Claim | Evidence in paper | Why it matters |
|---|---|---|---|
| 1 | Multi-agent tool-use workloads create two distinct KV-cache pathologies (idle waste + critical inversion). | Intro motivation figures and background taxonomy (Figures 2-3, Section 2 framing). | Establishes that classic single-request serving assumptions break. |
| 2 | Existing systems each miss one dimension (agent context or memory control). | Comparative analysis vs Teola/Parrot/Autellix and vLLM/Mooncake/CachedAttention. | Justifies a jointly agent-aware and cache-centric design target. |
| 3 | A dual scheduler with shared pressure protocol can simultaneously address both dimensions. | Architecture and scheduling-step protocol (Figures 4, 6, 8; Temporal/Spatial sections). | Provides concrete mechanism linking design to expected behavior. |
| 4 | Opportunistic offload + predictive upload and dynamic partitioning are each necessary but insufficient alone. | Component ablation and sensitivity (Figures 11, 15, 16). | Supports additive/cooperative design rather than single-knob tuning. |
| 5 | The combined design yields practical end-to-end benefits under load. | End-to-end latency/utilization results and migration-cost validation (Figures 9, 10, 17). | Closes the loop from pathology diagnosis to measurable system impact. |
fc_start / fc_end style lifecycle endpoints, asynchronous migration stream handling, and a CPU KV block pool design.B_{reserve} capped per step) prevents predictive upload from front-running active critical work.The central barrier is building a low-overhead runtime that keeps temporal and spatial decisions consistent at every scheduling tick. Missing this coordination usually causes one scheduler to optimize local metrics while harming global latency, which is exactly the failure mode TokenCake's pressure-snapshot contract is designed to avoid.