Routing and Cache Retention for Multi-Turn LLM Inference: Theory and Implementation
Abstract
Multi-turn AI agents execute iterative loops of large language model (LLM) inference and external tool calls, transforming cluster serving into a dynamic resource-allocation problem where routing and key-value (KV) cache retention jointly govern prefix reuse across inter-turn delays. We formulate a fluid approximation of this system and show that optimal admission, routing, and eviction are governed by endpoint-specific shadow prices for computation and memory together with session continuation values. Building on this structure, we propose an asymptotically optimal buffer-reserve policy that absorbs stochastic fluctuations using a vanishing share of capacity. To handle asynchronous arrivals, delayed load reports, and engine-local memory management in production clusters, we translate these principles into a practical controller named PARK, which pairs online projected subgradient price updates and one-turn migration lookahead with a local KV retention index ranked by expected reuse value per byte-epoch. In real GPU cluster experiments serving a 197-billion-parameter mixture-of-experts model on multi-turn software-engineering agent benchmarks (SWE and Terminal-Bench), PARK outperforms all five load-balancing and prefix-aware baselines across contrasting traffic regimes. On 16 H200 GPUs, PARK raises output throughput by 24.2% over the strongest baseline (336.9% over round robin) on turn-intensive SWE trajectories and by 40.0% over the strongest baseline (63.3% over round robin) on generation-intensive Terminal-Bench trajectories. Controlled single-replica ablations show that our retention index alone cuts prior-prefix token loss from 13.26% to 2.17% and increases throughput by 36.7% over least-recently-used (LRU) eviction, while 128-GPU scale-up experiments sustain 50,789 to 67,363 output tokens/s across 16~replicas with prefix cache hit rates of 91.3% to 97.4%.
Related
- SemKV: Semantic Mixed-Precision KV Cache Quantization Guided by the Quality Cliff for Long-Context LLM Inference
- CreateScore: Domain-Theory-Informed Bayesian Routing for LLM-Based CV Screening
- Can We Ignore Data Dependence in Inference Implementation? A Positive Answer for Regression Discontinuity Designs
- Randomization Inference: Theory and Applications
- Quantum Computing Algebra (QCA), the theory and implementation
BibTeX
@misc{miao2026routing,
title = {{Routing and Cache Retention for Multi-Turn LLM Inference: Theory and Implementation}},
author = {Sentao Miao and Tianjiao Nie and Yuan Zhou and Song Yuan and Yuanwei Lu and Yibo Zhu},
howpublished = {arXiv},
year = {2026},
month = nov,
doi = {10.48550/arxiv.2611.34584},
eprint = {2611.34584},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2611.34584},
}
RIS
TY - UNPB
TI - Routing and Cache Retention for Multi-Turn LLM Inference: Theory and Implementation
AU - Sentao Miao
AU - Tianjiao Nie
AU - Yuan Zhou
AU - Song Yuan
AU - Yuanwei Lu
AU - Yibo Zhu
PY - 2026
DA - 2026/11/25
PB - arXiv
DO - 10.48550/arxiv.2611.34584
UR - https://arxiv.org/abs/2611.34584
AB - Multi-turn AI agents execute iterative loops of large language model (LLM) inference and external tool calls, transforming cluster serving into a dynamic resource-allocation problem where routing and key-value (KV) cache retention jointly govern prefix reuse across inter-turn delays. We formulate a fluid approximation of this system and show that optimal admission, routing, and eviction are governed by endpoint-specific shadow prices for computation and memory together with session continuation values. Building on this structure, we propose an asymptotically optimal buffer-reserve policy that absorbs stochastic fluctuations using a vanishing share of capacity. To handle asynchronous arrivals, delayed load reports, and engine-local memory management in production clusters, we translate these principles into a practical controller named PARK, which pairs online projected subgradient price updates and one-turn migration lookahead with a local KV retention index ranked by expected reuse value per byte-epoch. In real GPU cluster experiments serving a 197-billion-parameter mixture-of-experts model on multi-turn software-engineering agent benchmarks (SWE and Terminal-Bench), PARK outperforms all five load-balancing and prefix-aware baselines across contrasting traffic regimes. On 16 H200 GPUs, PARK raises output throughput by 24.2% over the strongest baseline (336.9% over round robin) on turn-intensive SWE trajectories and by 40.0% over the strongest baseline (63.3% over round robin) on generation-intensive Terminal-Bench trajectories. Controlled single-replica ablations show that our retention index alone cuts prior-prefix token loss from 13.26% to 2.17% and increases throughput by 36.7% over least-recently-used (LRU) eviction, while 128-GPU scale-up experiments sustain 50,789 to 67,363 output tokens/s across 16~replicas with prefix cache hit rates of 91.3% to 97.4%.
ER -