arXiv Science⌕ Search

arXiv · 2611.34584

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\%$.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Sentao Miao, Tianjiao Nie, Yuan Zhou, Song Yuan, Yuanwei Lu, Yibo Zhu. 2026-11-25. Routing and Cache Retention for Multi-Turn LLM Inference: Theory and Implementation. https://arxiv.science/abs/2611.34584

Citations retain the original authors and DOI and include this site’s record URL. If this discovery service contributed to your research, you can also cite arXiv Science by Indiciae: BibTeX · RIS.

KEEP EXPLORING

Related papers

Uncertainty Quantification for Gradient and Accelerated Gradient Descent Methods on Strongly Convex Functions

We consider minimising a strongly convex function that depends on an uncertain parameter $θ$, so that the optimum $x^*(θ)$ is itself a function of $θ$. We propose an efficient method to compute $x^*(θ)$ and its statistics, using a chaos expansion of $x^*(θ)$ in a truncated basis and first-order methods that compute the optimal coefficients. We give non-asymptotic convergence rates for gradient descent and accelerated gradient descent when the truncation level, and hence the dimension of the optimisation problem, grows within a single run, and the objective is observed only through noisy gradients. Our analysis exploits convexity and does not rely on diminishing step sizes: with a constant step size, the iterates converge linearly to a neighbourhood of the solution whose radius is set by the truncation error and the Monte Carlo variance. When the gradient is exact at each $θ$, the error then decays at the optimal rate of the truncation error, and we bound the number of gradient evaluations needed to reach a given accuracy in terms of the smoothness of the solution. The accelerated method improves the iteration complexity from order $κ$ to order $\sqrtκ$, and in our experiments needs fewer gradient evaluations than the state of the art, with a speedup that grows with the condition number. Growing the basis also reduces the variance of early gradient estimates compared with a large fixed basis, which permits larger step sizes.

math.OC↗

Support profiles of full-capacity Pareto spectra of order three

For a given real matrix $A\in\R^{n\times n}$ of order $n\geq 1$, a Pareto eigenvalue is a scalar $λ\in\R$ for which there exists a nonzero vector $x\in\R^n_+$ such that $Ax-λx\in\R^n_+$ and $\langle x,Ax-λx\rangle=0$. It is known that a real matrix of order $n=3$ has at most nine distinct Pareto eigenvalues. The main contribution of this paper is to classify all possible distributions of these nine values among their producing supports when this maximum is attained. In general, a Pareto eigenvalue may be produced by several supports. We show that, in order three, there are at most nine pairs $(J,λ)$ such that the support $J$ produces $λ$. Thus, at full capacity, each of the nine values has a unique producing support. The numbers of values produced on supports of sizes $1$, $2$, and $3$, respectively, form necessarily one of the following triples $$ (1,5,3),\qquad (2,4,3),\qquad \text{or}\qquad (2,5,2). $$ Each triple determines the counts on the individual supports up to a simultaneous permutation of the indices. In the proof, we show that the pairs producing two distinct values form a triangle-free graph. Together with the restrictions on singleton and full supports, this also gives an independent proof that the Pareto capacity in order $n=3$ is nine. For each of the three profiles, we give an explicit matrix with nine distinct regular Pareto eigenvalues. We prove that the profile is locally constant at every such matrix, so each profile occurs on a nonempty Euclidean-open set. We also exhibit a path of full-capacity matrices along which the profile changes.

math.OC↗

Connected Lie Groups with a Left-Invariant Intrinsic Chronometer

In this paper, we investigate left-invariant intrinsic chronometers (time functions) on connected finite-dimensional Lie groups. We formulate and prove sub-Lorentzian analogs of Berestovskii's classical direct and inverse theorems. A one-to-one correspondence is established between chronometers satisfying a proposed system of axioms (which includes upper semicontinuity and the condition that the interiors of chronological diamonds form a base for the topology) and left-invariant sub-Lorentzian structures satisfying a chronological condition. It is shown that an axiomatic chronometer uniquely determines a closed pointed convex cone in the Lie algebra, whose linear span satisfies the Chow--Rashevskii condition, and an upper semicontinuous, concave, positively homogeneous anti-norm on it. Conversely, we prove that any such algebraic structure satisfying a local chronological condition induces an intrinsic chronometer with the required properties. The proofs rely on local estimates in exponential coordinates, the Hahn--Banach separation theorem, and properties of weak limits in optimal control problems.

math.OC↗