TL;DR
PBKV (Prediction-Based KV-Cache Management) optimizes LLM serving for dynamic multi-agent workflows by forecasting future agent invocations instead of relying on static assumptions or simple temporal heuristics. By combining a multi-step graph-based predictor with hierarchical eviction and conservative prefetching, PBKV achieves up to a 1.85× end-to-end speedup and a 2.55× cache hit rate improvement over standard LRU policies.
What Problem Does This Paper Address?
LLM-based multi-agent frameworks (like LangChain, AutoGen, and MetaGPT) break complex tasks down into specialized agents (e.g., a Planner, Coder, and Tester) that collaborate sequentially. Because these agents share substantial context—such as system prompts, tool descriptions, and conversational history—reusing Key/Value tensors (KV-Cache) across requests can dramatically reduce expensive prefill computation.
However, existing inference engines fall short in multi-agent settings:
- LRU (Least Recently Used) assumes temporal locality. In workflows, a cache entry might sit idle during a long tool call or a loop transition and get prematurely evicted, despite being critically needed a few steps later.
- SOTA Workflow-Aware Caching (e.g., KVFlow) assumes a static sequence of agents.
In reality, practical agent workflows are dynamic. They feature runtime-dependent loops and conditional branches (e.g., a Tester sending code back to a Coder for rewriting). To manage cache efficiently under tight GPU memory constraints, systems must shift from assuming a fixed future to accurately predicting a dynamic one.
Methods
The authors introduce PBKV, a system built on top of SGLang and HiCache that manages a two-tier KV-Cache storage hierarchy (GPU memory and host memory) using three core components:
1. Multi-Signal, Multi-Step Predictor
Instead of predicting just the immediate next step, PBKV forecasts $K$ steps into the future to avoid myopic evictions. The predictor fuses three distinct signals:
- Topology-aware agent embeddings generated via GraphSAGE over the global call graph.
- Attention-based history aggregation to capture the current workflow's path prefix.
- Semantic signals extracted directly from the LLM's last prefill token embedding to differentiate user intent.
2. Hierarchical Eviction
To remain robust against prediction errors, PBKV implements a deterministic safety net. It categorizes cache into "retired" (from terminated workflows) and "active" (from ongoing workflows). Retired cache has zero future value and is always evicted first. Active cache is only evicted when retired cache is exhausted, ranked by a lookahead reuse score that discounts predictions further out in the future using a confidence decay factor ($\gamma$).
3. Conservative Prefetching
Prefetching cache from host memory to GPU memory carries an asymmetric risk: a correct guess saves time, but an incorrect guess evicts valuable active cache and wastes PCIe bandwidth. PBKV mitigates this by restricting prefetching strictly to otherwise-idle GPU space and pure-decode batches, ensuring it never hurts baseline performance.
Datasets
PBKV was evaluated across three distinct multi-agent workloads designed to simulate real-world deployments:
- HoVer (Fact Verification) + LangChain: A highly dynamic workflow characterized by iterative refinement loops.
- SWE-bench (Code Generation) + AutoGen: A dynamic workflow featuring unpredictable code-generation retry loops.
- FinanceBench (Document Analysis) + CrewAI: A static workflow used specifically to compare PBKV fairly against static baselines like KVFlow.
Key Insights and Ideas
- Structural over Temporal Locality: In agentic workflows, cache reuse is governed by the application's graph structure rather than how recently an agent was called.
- Deterministic Guardrails for Probabilistic Predictors: Rather than blindly trusting a machine learning model to manage memory, PBKV uses hierarchical rules (like prioritizing retired cache) to ensure that even a poor predictor cannot tank system performance. The authors mathematically prove that PBKV’s eviction cost regret degrades gracefully (Lipschitz-continuous) with prediction error.
- Multi-Step Horizon is Mandatory: Single-step lookaheads fail to recognize that a cache entry will be reused immediately after a multi-step loop or tool invocation, leading to catastrophic thrashing.
Key Results
The system was tested using Qwen3-14B and Qwen3-32B models under heavy concurrency to induce memory pressure.
- Dynamic Workflows: On the HoVer and SWE-bench datasets, PBKV reduced average workflow latency by up to 1.85× and boosted the token-level KV-Cache hit rate by up to 2.55× compared to standard LRU.
- Static Workflows: Even on static graphs where the baseline KVFlow has perfect structural knowledge, PBKV outperformed it by up to 1.26× in speedup and 1.39× in cache hit rate, thanks to its ability to aggregate reuse metrics across multiple concurrent workflows.
- Low Overhead: The predictor contains only ~350K parameters. Processing a batch of 1,024 requests takes just 1.56 ms, rendering its runtime overhead negligible.
Limitations and Future Work
- Workload-Specific Training: The predictor must be trained offline on traces from the specific multi-agent application it intends to serve. It cannot generalize zero-shot to entirely new agent graph topologies.
- Framework Conventions: The current cache-tracking mechanism assumes a standard message-passing convention. Complex frameworks where downstream agents inherit upstream cache through non-standard methods may require manual customization of the system's access indicator vectors.
Summary updated