Efficient LLM Scheduling by Learning to Rank

Yichao Fu, Siqi Zhu, Runlong Su, Aurick Qiao, Ion Stoica, Hao Zhang

Introduction

In Large Language Model (LLM) serving, requests are typically processed in a First-Come-First-Serve (FCFS) order. However, this approach often leads to Head-Of-Line (HOL) blocking, where a single long request (e.g., generating a long essay) stalls multiple short requests (e.g., simple Q&A). While Shortest-Job-First (SJF) scheduling is theoretically optimal for minimizing average latency, it is difficult to implement in LLMs because the final output length of a prompt is unknown until generation is complete.

Comparison of FCFS and SRTF scheduling. FCFS leads to high latency for short requests (R1, R2) when blocked by a long request (R0).

The Learning to Rank (LTR) Approach

This paper proposes a novel scheduler that approximates SJF by predicting the relative order of request lengths rather than their exact token counts. The authors argue that exact length prediction (regression) is notoriously difficult and unnecessary for effective scheduling. Instead, they employ a "Learning to Rank" (LTR) strategy.

Key Methodology

  • Ranking Model: A small auxiliary model (such as OPT-125M) is trained using a listwise ranking loss (ListMLE). This model analyzes the input prompt to generate a ranking score.
  • Kendall’s Tau: The system uses Kendall’s Tau as a metric to measure the correlation between the predicted ranking and the actual "oracle" ranking. The researchers found that higher ranking accuracy (Tau) directly correlates with lower system latency.
  • Starvation Prevention: To ensure that long requests are not indefinitely postponed, the scheduler includes a priority-based mechanism. Requests that wait beyond a certain threshold are temporarily promoted to receive execution time.

Performance and Results

The proposed ranking-based scheduler was evaluated using real-world datasets, including ShareGPT and LMSYS-Chat-1M, simulating workloads for models like Llama-3-8B and 70B. The results demonstrate significant improvements over standard FCFS and Multi-Level Feedback Queue (MLFQ) baselines.

Normalized waiting time comparison showing that the proposed ranking scheduler ("OURS") significantly reduces latency compared to FCFS, approaching the performance of the theoretical SRTF optimum.

Key Findings

  • Latency Reduction: The system achieved up to 2.8x lower p90 latency in chatbot serving scenarios.
  • Throughput Gains: In synthetic data generation (SDG) tasks, throughput increased by up to 6.5x.
  • Minimal Overhead: The auxiliary ranking model is highly efficient, with inference costs representing less than 2% of the total serving time.

Conclusion

By shifting the focus from absolute length prediction to relative ranking, this research provides a practical and efficient way to implement SJF-like scheduling in LLM serving. The approach effectively mitigates HOL blocking, significantly improving the user experience for short-form interactions without substantial computational overhead.

Summary updated

BibTeX
@inproceedings{fu2024efficient,
  author = {Yichao Fu and Siqi Zhu and Runlong Su and Aurick Qiao and Ion Stoica and Hao Zhang},
  title = {{Efficient LLM Scheduling by Learning to Rank}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=wlLjYl0Gi6},
}
Figure