Abstract
Serving Large Language Models (LLMs) involves a critical trade-off between output quality and operational cost. Standard static serving methods often struggle with "bursty" traffic, leading to either system instability or significant resource under-utilization. This paper introduces a "best-effort" serving framework that leverages deep reinforcement learning to dynamically route requests to models of varying sizes. By intelligently downgrading to smaller models during high-load periods while prioritizing larger models for sensitive tasks, the system maintains availability at 10x higher request rates and achieves nearly 4x better performance per hardware unit than static configurations.
The Challenge of Static LLM Serving
The primary hurdle in LLM deployment is the "bursty" nature of real-world traffic. To maintain low latency, providers typically over-provision expensive GPU resources, which is financially unsustainable for many. Conversely, static serving—where a single model size is fixed—presents a lose-lose scenario: a large model (e.g., OPT-6.7B) may crash or lag during traffic spikes, while a small model (e.g., OPT-125M) unnecessarily sacrifices quality during idle periods.
The authors propose a best-effort paradigm. In this model, the system aims to provide the highest quality response possible but gracefully "downgrades" to smaller, faster models to ensure every request meets its latency deadline.
System Architecture: The Learned Dynamic Router
The centerpiece of this framework is a Learned Dynamic Router, designed to make sub-millisecond routing decisions.
Methodology
- Architecture: The router is a lightweight 2-layer Multi-Layer Perceptron (MLP) with a negligible inference overhead of 0.1ms.
- Algorithm: It utilizes Double Q-Learning (DQN) to select the optimal model size for each incoming request.
- State & Action Space: The router monitors task type, current batch sizes across available models, and estimated request arrival rates. It then selects between three model sizes: OPT-125M, OPT-1.3B, and OPT-6.7B.
- Reward Function: Rewards are tied to model accuracy, provided a latency deadline is met. Deadlines can be "hard" (zero reward if missed) or "soft" (decaying reward), with the latter allowing the system to utilize larger models more aggressively without "panicking" at minor delays.
Experimental Evaluation
The system was tested against four NLP benchmarks: HellaSwag (reasoning), COPA (causal reasoning), PIQA (physical QA), and OpenBookQA. Workloads were simulated using traces from Microsoft Azure Functions to capture realistic, unpredictable traffic patterns.
Key Insights
- Task Sensitivity: The router learns that some tasks are more sensitive to model size than others. For instance, it prioritizes the large model for HellaSwag, where the performance gap between small and large models is significant, while offloading less sensitive tasks like COPA to smaller models during high traffic.
- Hardware Utility: A 4-GPU system using this learned router can outperform an 8-GPU system running only a large model by managing the request queue more intelligently.
Results and Performance
The learned router significantly outperforms static baselines across all key metrics.
- Availability and Throughput: The system maintains availability at request rates 10x higher than static large-model serving. On unpredictable workloads, it achieves >98% of peak performance 2.3x more often than static alternatives.
- Efficiency: The framework delivers 3.94x higher performance per hardware unit compared to a static 8-GPU setup.
- Robustness: The router demonstrated "zero-shot" robustness, maintaining superior performance even when the task distribution shifted drastically post-training.
Conclusion and Future Work
This "best-effort" approach proves that dynamic, learned routing is a viable path toward cost-effective and high-availability LLM serving. Future research could expand this to include a wider variety of model architectures (e.g., Llama, Mistral), more complex reward functions (e.g., prioritizing premium users), and deeper integration with techniques like speculative decoding.
Summary updated