Queueing, Predictions, and LLMs: Challenges and Open Problems

Michael Mitzenmacher, Rana ShahoutarXiv 2025 · DOI

Abstract

This paper bridges the gap between classical queueing theory and modern AI infrastructure. It explores how machine-learning predictions of job sizes can optimize scheduling in standard queues and addresses the unique, memory-constrained challenges of scheduling Large Language Model (LLM) inference and compound AI systems.

Introduction

In traditional queueing theory, scheduling is often a binary choice: we either assume perfect knowledge of task durations (enabling optimal "Shortest Remaining Processing Time" scheduling) or we assume no knowledge at all (defaulting to First-Come, First-Served). However, the rise of LLM serving introduces a middle ground characterized by noisy predictions. While we can estimate the length of a prompt's response, these guesses are inherently uncertain. Furthermore, LLMs introduce hardware-specific constraints—such as KV cache memory footprints and two-phase processing—that standard theory fails to capture.

Scheduling with Noisy Predictions

The authors explore several algorithmic frameworks designed to leverage ML-generated estimates. Key among these are SPRPT (Shortest Predicted Remaining Processing Time) and SPJF (Shortest Predicted Job First). To analyze these, the paper utilizes the SOAP Analysis framework, which evaluates "age-based" scheduling policies where a job's priority (or rank) evolves as it receives service.

Rank functions for age-based scheduling policies, illustrating how priority changes based on true size (left), estimated size (middle), and robust estimations (right).

A critical insight is that predicting "long" jobs is mathematically more valuable than perfectly predicting "short" ones. In a queue, a single mispredicted long job can cause Head-of-Line blocking, stalling many shorter tasks. Consequently, schedulers must be robust to prediction errors, particularly for tasks that exceed their estimated duration.

The LLM Serving Frontier

LLM inference presents unique challenges that distinguish it from general computing tasks:

  1. The KV Cache: Storing intermediate states requires massive GPU memory that grows with generation length.
  2. Two-Phase Processing: Requests alternate between a compute-heavy "prefill" phase and a memory-bandwidth-bound "decode" phase.
  3. The Prediction Cost Paradox: If the compute cost of predicting a job's size is too high, the system may be more efficient simply running the job without a prediction.

To address these, the paper highlights the Trail algorithm. Trail uses internal model probes to predict output length and strategically disables preemption once a job reaches a certain "age" to protect the system from the high cost of re-allocating large KV caches.

Key Results and Insights

Empirical evaluations demonstrate that incorporating predictions, even noisy ones, leads to substantial performance gains. Using predicted service times (SPRPT) significantly outperforms FIFO across various system loads (λ).

Comparison of mean response times for various scheduling policies across different arrival rates (λ), showing the efficiency of SPRPT.

Specific LLM optimizations also show dramatic improvements:

  • The Trail algorithm reduced mean latency by up to 2.01x and mean time-to-first-token by up to 24x compared to standard vLLM serving.
  • The LAMPS system, which manages memory for LLMs making external API calls, improved end-to-end latency by 27% to 85%.

Open Problems and Future Work

The paper concludes by identifying several gaps in current research. Most mathematical proofs are currently limited to single-server systems; extending these to multi-server "supermarket" models is essential. Additionally, the emergence of "reasoning" models (like DeepSeek-R1) introduces new layers of unpredictability, as task size is determined by the depth of a reasoning tree rather than simple token counts. Developing formal queueing theory for these self-correcting, path-exploring systems remains a major open challenge.

Summary updated

BibTeX
@misc{mitzenmacher2025queueing,
  author = {Michael Mitzenmacher and Rana Shahout},
  title = {{Queueing, Predictions, and LLMs: Challenges and Open Problems}},
  year = {2025},
  eprint = {2503.07545},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2503.07545},
}
Figure