破解大模型推理负载瓶颈 BalanceRoute提升解码吞吐15%

Large models moving to large-scale online services face a counterintuitive challenge: as more computing cards are added, throughput grows far slower than expected. The root of this bottleneck lies in the parallel deployment of MoE models, where multiple compute groups handle requests independently but must synchronize during each decoding step. This synchronization creates a "chain is only as strong as its weakest link" effect: no matter how fast other groups work, they have to wait for the slowest one to finish. Even when the number of requests assigned to each group is equal, the actual load varies—for example, longer context requests require larger KV caches, leading to uneven computation loads. This imbalance means lighter groups often sit idle while waiting, and these small waits accumulate across every decoding step, eroding the benefits of scaling up the deployment.
To solve this problem, a joint team from Hong Kong University of Science and Technology and Huawei’s 2012 Theory Lab has developed a method called BalanceRoute. The team’s core idea is straightforward: first clarify the problem through mathematical modeling, then convert short-term load predictions into online routing decisions. This approach transforms the synchronization wait, which was previously seen as an unavoidable overhead, into a measurable target for optimization.
Experimental results confirm the effectiveness of this method. In a test with 96 computing cards, the BR-H variant of BalanceRoute, which uses practical load prediction, improved decoding throughput by around 15% compared to the strongest baseline method. This work has been accepted by NeurIPS 2026 and deployed in the MathBot-Pie MaaS inference system built by both institutions.
To understand how BalanceRoute works, we need to look at the structure of large model inference. The process is split into two main stages: prefill, which processes the entire input and saves intermediate results as KV caches, and decoding, which generates output tokens one by one. In the prefill-decode separation system, these stages are handled by different resources. After a request finishes prefill, a router assigns it to a decoding unit, and the corresponding KV cache is transferred along with it. Traditional methods like round-robin distribute requests evenly but don’t account for the varying KV cache sizes of different requests—two requests with the same count can have very different loads due to context length differences, leading to the same idle waiting problem.
BalanceRoute addresses this by building a mathematical model to quantify load imbalance. For each decoding step, it calculates an imbalance index by summing the load differences between each unit and the busiest one. This index directly reflects the idle time caused by synchronization. The key tradeoff here is: assigning a new request to a lighter unit can fill its idle slots, but if that request makes the unit the new busiest, it will increase the wait for all other units. To navigate this, BalanceRoute uses a sliding window to predict load changes over the next few steps. The window length is carefully chosen—not too short to miss upcoming request completions, and not too long to avoid uncertainty from new incoming requests. The prediction also estimates how long each running request will stay active, allowing the router to make optimal assignment decisions.
To implement this in real systems, the team built a stateful proxy on top of existing inference frameworks, which maintains real-time information about each decoding unit’s load, idle slots, and progress. This design integrates with existing systems without modifying core inference engines, and controls scheduling overhead by limiting the number of candidate units considered. In the 96-card test with a large-scale model, the median scheduling time was only 1.2 milliseconds, with 99% of cases taking less than 2.77 milliseconds—well under the 60-millisecond time budget for each decoding step. In high-load conditions, BalanceRoute outperformed four other routing strategies, including round-robin and shortest queue, improving throughput by over 14% in tested datasets while reducing tail latency.
As part of its deployment in MathBot-Pie, BalanceRoute plays a key role in reducing cross-group synchronization waits and boosting online decoding throughput. This work represents a growing trend of applying operations research to large model services: by modeling complex system dynamics, researchers can turn previously invisible bottlenecks into actionable optimization targets, guiding decisions that improve both efficiency and performance.
The associated research paper is titled "Tackling the Data-Parallel Load Balancing Bottleneck in LLM Serving: Practical Online Routing at Scale", available at https://arxiv.org/pdf/2605.06113, and the code is open-sourced at https://github.com/b010001y/BalanceRoute.

