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.
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.
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