TL;DR
Libra is a new load-balancing system for Mixture-of-Experts (MoE) inference that achieves near-optimal hardware utilization with virtually zero overhead. By combining a high-accuracy "lookahead" predictor with a novel two-stage execution flow, it hides the complex logic of expert replication and token sharding behind actual GPU computation, boosting throughput by up to 19.2% on state-of-the-art models like Qwen3MoE and GLM-4.5.
The Challenge: Expert Load Imbalance
Large Language Models (LLMs) are increasingly moving toward Mixture-of-Experts (MoE) architectures, which use sparse activation to scale parameters without a proportional increase in compute cost. However, this sparsity creates a massive headache for distributed inference: expert load imbalance.
When experts are distributed across multiple GPUs (Expert Parallelism), certain "hot experts" often receive a disproportionate number of tokens. This creates a "straggler effect" where most GPUs sit idle while waiting for the overloaded ones to finish. As shown in the figure below, this problem is actually getting worse as models become more specialized and move away from strict load-balancing losses during training.
Existing solutions either rely on stale historical data (EPLB), use inaccurate predictors (Lina), or introduce heavy decision-making overhead that ends up being as slow as the imbalance itself (HarMoEny).
Libra's Approach: Effectiveness Meets Efficiency
Libra introduces two synergistic components to solve the "effectiveness vs. efficiency" trade-off:
- Lookahead Predictor: Instead of guessing based on past iterations, Libra speculatively executes the gating function for the next layer using the hidden states of the current layer. This works because hidden states in LLMs evolve slowly across consecutive blocks. This runtime approach achieves 70-80% prediction accuracy, far outperforming previous history-based methods.
- Two-Stage Locality-Aware Execution: This is the structural "secret sauce." Libra splits MoE computation into two phases:
- $MoE_{local}$: Processes tokens routed to experts already residing on the local GPU.
- $MoE_{remote}$: Processes tokens that must be dispatched to other GPUs.
Because $MoE_{local}$ has no dependency on token sharding, it can start immediately after the gating function. While the GPU is busy with $MoE_{local}$, the system offloads the complex load-balancing and sharding logic to the CPU. By the time the GPU finishes the local work, the plan for the remote work is ready, effectively hiding the overhead.
Additionally, Libra uses Locality-Aware Expert Replication Planning. It doesn't just replicate hot experts to balance load; it prioritizes replicating experts that are frequently requested by local tokens to maximize the $MoE_{local}$ window, providing more time to hide overhead.
Datasets
The authors evaluated Libra using two massive MoE models: Qwen3MoE (235B) and GLM-4.5 (355B). They tested these models across eight diverse benchmarks to ensure broad coverage:
- General/Text: BookCorpus, FineWeb, LMSYS-Chat-1M.
- Reasoning/Math: GSM8K, DeepSeek-Prover.
- Coding: Codeforces, HumanEvalPlus.
- Knowledge: HellaSwag.
Key Insights and Ideas
- The "Slow Evolution" Heuristic: The most critical insight is leveraging the fact that hidden states don't change drastically between layers. This allows for speculative gating that is accurate enough to drive proactive load balancing.
- Locality as an Efficiency Lever: Traditional load balancing treats all GPUs as a pool. Libra realizes that keeping tokens "home" isn't just about reducing communication—it's about creating a temporal window to perform background system tasks.
- CPU-GPU Parallelism: While we often try to move everything to the GPU, Libra shows that for complex combinatorial logic (like sharding algorithms), the CPU is a perfect partner if you can overlap its work with the GPU's matrix multiplications.
Key Results
- Throughput Boost: Libra improved prefill throughput by up to 19.2% compared to state-of-the-art baselines.
- Near-Perfect Balance: The system maintained an imbalance ratio (max load / average load) of nearly 1.0 even under highly dynamic workloads where other systems' performance plummeted.
- Prediction Accuracy: Libra's lookahead predictor achieved 70-90% accuracy, whereas the previous best (Lina) fell as low as 11-44% on the same models.
- Latency Reduction: For long-context scenarios, Libra reduced Time-To-First-Token (TTFT) by up to 27% for Qwen3MoE.
Limitations and Future Work
- Short Sequence Constraints: The paper notes that for very short sequences (e.g., 1K tokens), the $MoE_{local}$ computation window might be too small to fully mask the CPU overhead, leading to performance comparable to (or slightly lower than) basic implementations.
- Memory Overhead: While Libra manages a memory budget ($N$ extra experts), replicating experts still consumes VRAM. In extremely memory-constrained environments, the degree of balancing might be limited.
- Multi-node Scaling: The current evaluation focused on a single node with 8 GPUs. Future work could explore how these locality-aware strategies scale across multi-node clusters where communication latencies are much higher.
Summary updated