Throughput-Optimal Scheduling Algorithms for LLM Inference and AI Agents

Yueying Li, Jian Gang Dai, Tianyi Peng · DOI

Introduction

Large Language Model (LLM) inference presents a unique scheduling challenge due to its two-phase execution: prefill (compute-bound prompt processing) and decode (memory-bandwidth bound token generation). While high-performance engines like vLLM and Orca have emerged, they often rely on empirical heuristics rather than formal mathematical foundations. This paper bridges the gap between queueing theory and LLM system engineering to define and prove "throughput-optimality" in inference schedulers.

The Stability Gap in LLM Serving

A critical finding of this research is that many popular systems can become unstable under moderate loads. In queueing theory, stability implies that the number of requests in the system remains bounded over time. As shown in Figure 1, systems like FasterTransformer and vanilla vLLM exhibit linear growth in the request queue, indicating instability, whereas work-conserving schedulers like Sarathi-Serve maintain a stable state.

System stability comparison: FasterTransformer and vLLM show linear growth in requests (instability) compared to the stable Sarathi-Serve.

Methodology: Work-Conserving Schedulers

The authors introduce a stochastic processing model based on two key pillars:

  1. Piecewise Linear Profiling: Profiling models like Llama-70B reveals that batch processing time is a piecewise linear function of the "token load." This allows the complex GPU dynamics to be modeled as a manageable mathematical variable.
  2. Work-Conserving Framework: A scheduler is defined as work-conserving if it always fills the GPU's "token budget" whenever sufficient tokens are queued. This necessitates mixing prefill and decode tokens within the same batch to maximize utilization.
Illustration of a work-conserving scheduler mixing prefill and decode tokens across iterations to maximize GPU utilization.

Key Results and Insights

The research proves that Orca and Sarathi-Serve are throughput-optimal because they adhere to work-conserving principles. In contrast, systems that isolate prefill and decode phases are inherently suboptimal and prone to system failure under specific workloads.

A formal stability condition is provided: $\lambda(m_p + m_d) < b/t_b$, where $\lambda$ is the arrival rate, $m$ represents mean tokens, $b$ is the budget, and $t_b$ is the processing time. Experiments with Sarathi-Serve suggest a token budget of 512 is often the "sweet spot," balancing overhead and latency.

Conclusion and Future Directions

While this work establishes a rigorous foundation for throughput, it primarily focuses on compute/bandwidth bottlenecks. Future research is needed to address KV cache memory constraints and optimize for tail latency (99th percentile response times), which remains critical for user-facing applications. Additionally, the authors identify the "AI Agent Trap"—where inter-dependent agent tasks cause instability even at sub-maximal loads—presenting a new frontier for multi-tenant scheduling.

Summary updated

BibTeX
@misc{li2025throughput,
  author = {Yueying Li and Jian Gang Dai and Tianyi Peng},
  title = {{Throughput-Optimal Scheduling Algorithms for LLM Inference and AI Agents}},
  year = {2025},
  eprint = {2504.07347},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2504.07347},
}
Figure