Throughput-Optimal Scheduling Algorithms for LLM Inference and AI Agents
Yueying Li, Jim Dai, Tianyi Peng
TL;DR
This work develops a queueing-theoretic framework for LLM inference that captures the dual-phase processing (prefill and decode) and batch formation to quantify throughput. It proves that a broad class of work-conserving scheduling algorithms can achieve the maximal throughput bound $b/t_b$ for a single LLM engine, with stability characterized by $\lambda(m_p+m_d) < b/t_b$, and demonstrates that multi-engine AI-agent networks require more sophisticated scheduling to maintain throughput, as illustrated by fork-join and RS networks. The paper shows that Orca and Sarathi-Serve are throughput-optimal in practice, while FasterTransformer and vanilla vLLM can be unstable under moderate load, providing practical guidance for system design. It also extends the analysis to AI-agent workloads, revealing scenarios where even work-conserving policies fail and highlighting the need for throughput-aware scheduling in distributed, collaborative inference systems. Overall, the results offer a formal foundation linking queueing theory to LLM-serving systems and advocate for interdisciplinary collaboration to optimize both throughput and latency in large-scale AI deployments.
Abstract
As demand for Large Language Models (LLMs) and AI agents rapidly grows, optimizing systems for efficient LLM inference becomes critical. While significant efforts have focused on system-level engineering, little is explored from a mathematical modeling and queuing perspective. In this paper, we aim to develop the queuing fundamentals for large language model (LLM) inference, bridging the gap between the queueing theory and LLM system communities. In particular, we study the throughput aspect in LLM inference systems. We prove that a large class of 'work-conserving' scheduling algorithms can achieve maximum throughput for individual inference LLM engine, highlighting 'work-conserving' as a key design principle in practice. In a network of LLM agents, work-conserving scheduling alone is insufficient, particularly when facing specific workload structures and multi-class workflows that require more sophisticated scheduling strategies. Evaluations of real-world systems show that Orca and Sarathi-serve are throughput-optimal, reassuring practitioners, while FasterTransformer and vanilla vLLM are not maximally stable and should be used with caution. Our results highlight the substantial benefits that the queueing community can offer in improving LLM inference systems and call for more interdisciplinary development.
