Multi-Bin Batching for Increasing LLM Inference Throughput
Ozgur Guldogan, Jackson Kunde, Kangwook Lee, Ramtin Pedarsani
TL;DR
This work tackles inefficiencies in batched LLM inference caused by variable output lengths by introducing Multi-Bin Batching, which partitions requests into $k$ bins based on predicted execution times and batches within each bin. Through a queueing-theoretic analysis, it proves asymptotic throughput optimality as $k$ grows, deriving a closed-form expression for throughput and establishing how many bins are needed to achieve near-maximum capacity; experiments with real models show throughput gains up to about 70% under oracle-length information. The approach robustly improves CPU/GPU utilization by reducing the impact of long-tail generation times, while latency trade-offs are analyzed under an infinite-server approximation. The results suggest a practical, deployable scheduling policy that can be integrated into LLM serving stacks to substantially boost inference throughput, with potential extensions to adaptive binning and improved length prediction.
Abstract
As large language models (LLMs) grow in popularity for their diverse capabilities, improving the efficiency of their inference systems has become increasingly critical. Batching LLM requests is a critical step in scheduling the inference jobs on servers (e.g. GPUs), enabling the system to maximize throughput by allowing multiple requests to be processed in parallel. However, requests often have varying generation lengths, causing resource underutilization, as hardware must wait for the longest-running request in the batch to complete before moving to the next batch. We formalize this problem from a queueing-theoretic perspective, and aim to design a control policy which is throughput-optimal. We propose Multi-Bin Batching, a simple yet effective method that can provably improve LLM inference throughput by grouping requests with similar (predicted) execution times into predetermined bins. Through a combination of theoretical analysis and experiments, including real-world LLM inference scenarios, we demonstrate significant throughput gains compared to standard batching approaches.
