Throughput-Optimal Scheduling Algorithms for LLM Inference and AI Agents

Yueying Li, Tianyi Peng, J. G. Dai

TL;DR

This paper introduces a queueing-theoretic framework to analyze LLM inference scheduling, proving that "work-conserving" algorithms are throughput-optimal for single LLM servers. This work provides crucial theoretical backing for practical system design and identifies specific algorithms that should be favored for efficiency.

What Problem Does This Paper Address?

The rapid growth of Large Language Models (LLMs) and AI agents has created a critical need for efficient inference systems. While significant engineering efforts have been made, a rigorous mathematical understanding of how to optimize LLM inference scheduling for maximum throughput has been lacking. This paper aims to bridge this gap by applying queueing theory to LLM inference, specifically focusing on the throughput performance of different scheduling algorithms. The authors highlight that existing systems often lack a cohesive theoretical foundation, forcing practitioners to rely on costly, workload-specific benchmarking.

Methods

The core of the paper lies in developing a novel queueing model for LLM inference. This model captures the unique two-phase nature of LLM inference (prefill and decode) with distinct resource utilization patterns. The authors then leverage a fluid-limit framework to analyze the stability and throughput-optimality of various scheduling algorithms. They introduce the concept of "work-conserving" scheduling as a key design principle and prove its throughput-optimality under certain conditions. The analysis extends to more complex scenarios, including multi-server networks with DAG and fork-join topologies, and also considers the impact of batch size constraints.

Datasets

Not discussed in the paper. The authors mention using "real-world systems" and "production coding traces" for evaluations, but specific datasets are not detailed.

Key Insights and Ideas

  • Work-conserving is Key: The paper rigorously proves that "work-conserving" scheduling algorithms are throughput-optimal for single LLM servers. This is a fundamental insight that practitioners can use to guide their system design.
  • Not All Work-Conserving is Equal in Networks: While work-conserving is great for single servers, it's not a silver bullet for complex AI agent workflows. The paper shows that routing cycles in multi-server networks can break even work-conserving policies, highlighting the need for careful network topology design.
  • Batch Size Matters (and Can Be Tricky): The introduction of a maximum batch size constraint ($k_{max}$) significantly complicates the stability region. This constraint can lead to counterintuitive scenarios where operating at a smaller token load ($b_0$) is more optimal than using the full token budget ($b_{max}$), and can even cause work-conserving algorithms to fail.
  • Theoretical Foundation for Practical Choices: The paper provides a theoretical basis for why certain algorithms (like Sarathi-Serve and Orca) perform well, while others (like FasterTransformer and vanilla vLLM) may struggle under moderate load.

Key Results

  • Throughput Optimality for Single Servers: A broad class of work-conserving scheduling algorithms are proven to achieve maximum throughput for single LLM inference servers.
  • Stability Conditions: The paper establishes precise conditions for system stability based on arrival rates, token budgets, and processing times. For example, for a single server, stability is achieved when $\lambda(m_p + m_d) < b_{max}/t_{b_{max}}$.
  • Network Topologies: Work-conserving scheduling remains throughput-optimal for multi-server DAG networks and fork-join networks, but can fail in networks with cyclic routing.
  • Batch Size Constraint Impact: The stability region becomes a 2D convex hull when a batch size constraint is introduced, and work-conserving algorithms may not always succeed at all points within this region.
  • Empirical Validation: Evaluations of real-world systems confirm that Orca and Sarathi-Serve are throughput-optimal, while FasterTransformer and vanilla vLLM are less stable.

Limitations and Future Work

  • Batch Size Constraint Complexity: The paper acknowledges that the analysis of the batch size constraint is only a necessary condition for stability, and an open question remains whether every point in the derived convex hull is achievable by some scheduling algorithm. Designing adaptive algorithms for this scenario is a future direction.
  • Richer Batch Processing Time Models: The current analysis relies on a piecewise constant model for batch processing time. Future work could incorporate more expressive models that account for attention-layer effects and KV cache token counts.
  • Tail-Latency Objectives: The paper primarily focuses on throughput and stability. Future research could explore optimal scheduling under tail-latency objectives (e.g., TBT, TTFT).
  • System-Level Optimization: Joint optimization of model autoscaling, resource allocation, KV cache policies, and load balancing across multiple models and servers is identified as an important area for future work.
  • Multi-Tenancy: Scheduling under multi-tenancy, where latency-critical and best-effort requests share resources, presents additional challenges.

Summary updated

BibTeX
@misc{li2025throughput,
  author = {Yueying Li and Tianyi Peng and J. G. Dai},
  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