Modern large language model (LLM) inference increasingly adopts disaggregated architectures that separate Prefill (P) and Decode (D) phases. Meanwhile, Expert Parallelism (EP) has been widely adopted in large Mixture-of-Experts (MoE) model serving. However, load imbalance still slows down MoE inference because each layer must wait for the busiest EP rank. The main source of latency differs between prefill and decode. Prefill is compute-bound, and its MoE layers' latency is determined by the maximum token count of the busiest rank. At the same time, under moderate batch sizes, Decode is memory-bound, so the latency is dominated by the maximum active-expert count across ranks. To solve both problems under a unified framework, we present RankCast, a system that reduces rank-level maximum token counts during prefill and active-expert counts during decode. For every token, RankCast preserves the predicted Top-p experts and chooses the remaining k-p from its Top-L candidates (L > k). In prefill, RankCast yields a price per rank that steers flexible assignments to less loaded ranks. In decode, RankCast closes experts on the busiest ranks while preserving the constraints for each token. Both paths are implemented and tested in the state-of-the-art inference frameworks SGLang and DeepEP. We overlap RankCast's kernels with model execution and reuse the existing DeepEP communication channel for metadata transmission. On Qwen3-235B-A22B with EP=8 and Qwen3.5-397B-A17B with EP=16, RankCast removes over 75% of the busiest rank's excess prefill load, improves prefill input throughput by up to 19%, and reduces decode time per output token by up to 10%. The quality cost is below one percentage point.
Figures & tables
Figure 1: RankCast overview. (a) Predicted next-layer routing defines protected Top- p experts and Top- L candidates. (b) Prefill uses rank prices to redistribute flexible assignments and reduce peak token load. (c) Decode closes low-cost experts to reduce the peak active-expert count while preserving protected experts and at least k candidates per token.
Figure 2: Cross-layer execution of RankCast on one EP rank. Prediction and balancing overlap with model execution, using metadata carried by existing DeepEP communication to compute (a) prefill rank prices or (b) a decode expert mask for the next layer. Dashed dependencies indicate CUDA events; slack denotes the interval between solver completion and next-layer selection. LL: low-latency. Timelines are schematic.
Tokens
Throughput gain
Imbalance (max/mean)
Workload
per rank
EPLB
EPLB-R
RankCast
Baseline
EPLB
EPLB-R
RankCast
Qwen3-235B
ShareGPT
2K
+13.3%
+7.0%
+16.4%
1.76
1.15
1.41
1.09
4K
+14.7%
+8.0%
+18.5%
1.75
1.13
1.42
1.08
8K
+13.8%
+6.6%
+19.4%
1.75
1.11
1.46
1.08
CodeContests
2K
+12.7%
+6.4%
+16.4%
1.66
1.10
1.35
1.04
Table 1: Prefill results at three chunked-prefill sizes per model. Throughput gain is relative to SGLang’s native Top- k routing (Baseline). Imbalance is the max-to-mean token count across EP ranks. Bold marks the best value of each metric in each row. Online EPLB rebalances every 50 forward passes on ShareGPT and CodeContests; EPLB-R adds 8 redundant experts on Qwen3-235B and 16 on Qwen3.5-397B.
Workload
Arm
Throughput gain
Imbalance
ShareGPT, 4K
Top- k
—
1.75
η alone
+14.7%
1.20
η + per-batch prices
+18.1%
1.08
LongBench v2, 32K
Top- k
—
1.66
η alone
−0.8%
1.65
η + per-batch prices
+7.4%
1.16
Table 2: The slow offset η alone against full RankCast on Qwen3-235B prefill, one run per arm, with the clamp on η relaxed to the full price range. Imbalance is the max-to-mean token count within one forward pass.
Qwen3-235B
Qwen3.5-397B
Workload
Prompt
Baseline
RankCast
Δ
Baseline
RankCast
Δ
WildChat
29
27.68
26.10
+6.1%
41.74
37.67
+10.8%
ShareGPT
91
27.69
26.11
+6.1%
40.76
37.48
+8.8%
ShareGPT, tiled
1,024
27.59
25.58
+7.9%
37.53
34.16
+9.9%
CodeContests
3.5K
27.41
25.33
+8.2%
52.19
46.97
+11.1%
Table 3: Median decode TPOT (ms) with 1,024 output tokens per request. Qwen3-235B keeps up to 96 requests in flight, and Qwen3.5-397B up to 128. Prompt gives the median prompt length in tokens. Δ is the relative gain in 1/TPOT .
Qwen3-235B
Qwen3.5-397B
Benchmark
Baseline
Prefill
Decode
Both
Baseline
Prefill
Decode
MMLU-Redux 2.0
0.9105
−0.02
−0.13
−0.17
0.9254
+0.18
−0.01
MATH-500
0.9813
−0.07
−0.20
+0.00
0.9160
−0.07
−0.30
MMMLU
0.8198
−0.16
−0.22
−0.11
0.8673
−0.04
−0.25
RULER
0.8787
−0.40
−0.31
−0.73
0.9419
−0.20
+0.02
GPQA-Diamond
0.7621
−0.67
−0.10
−0.46
0.8576
+0.03
−0.39
Table 4: Quality change in percentage points, relative to native Top- k routing. Prefill enables prefill balancing, Decode enables decode shedding, and Both enables the two together. Baseline gives the accuracy of native routing. Appendix D.1 lists the repeat counts.
235B prefill
235B decode
397B decode
True top-1 = predicted top-1
77.8%
76–78%
66%
True top-1 ∈ predicted top-2
91.4%
92–93%
84%
True top-2 set = predicted top-2 set
63.1%
66%
48%
True top-2 ⊆ predicted Top- L
99.7%
99.8%
98.0–98.6%
Tokens keeping their true top-1 expert
exact
99.4–99.5%
96.7–98.5%
Tokens keeping both true top-2 experts
exact
97.6–97.8%
87.9–94.5%
Table 5: Accuracy of the protected prefix and the protection it achieves at p=2 , averaged over layers. The prefill column covers the 12 sampled MoE layers of Figure 3 (b) in Appendix D.1 ; the decode columns cover every layer after the first, on the chat and code captures of Table 7 . Protection is measured after decode shedding. In prefill the selector uses the target layer’s own scores, so the true Top- p is exact.
Appendix figures & tables8 assets
Supplementary material from the paper’s appendix.
Appendix
Workload
Tokens per rank
Baseline
EPLB
EPLB-R
RankCast
Qwen3-235B
ShareGPT
2K
44.6
50.3
47.5
51.9
4K
48.7
55.9
52.6
57.7
8K
50.0
57.0
53.4
59.7
CodeContests
2K
45.4
51.2
48.3
52.8
4K
50.1
57.5
53.6
59.5
Appendix
Table 6: Prefill input throughput (thousand tokens/s) behind the gains of Table 1 . † Run with a larger state cache for the linear-attention layers; the gain in Table 1 is relative to a baseline with the same cache.
Workload
M
RankCast
XShare
OEA
ShareGPT
14.56
0.065%
2.38×
1.94×
13.59
0.180%
6.02×
4.75×
12.01
0.600%
3.60×
3.83×
11.59
0.811%
2.83×
2.84×
LiveCodeBench
12.96
0.062%
4.21×
1.92×
12.05
0.133%
1.96×
2.25×
Appendix
Table 7: Offline comparison of decode shedding with XShare ( Vankov et al., 2026 ) and OEA ( Oncescu et al., 2026 ) on decode batches of Qwen3-235B. M is the mean active-expert count on the busiest rank. Each row compares the methods at the same M . Every method keeps the true top-1 expert of at least 99% of tokens and gives every token k experts. The RankCast column gives the routing probability displaced from each token’s Top- k . The XShare and OEA columns give their displaced probability as a multiple of RankCast’s.
Qwen3-235B
Qwen3.5-397B
Benchmark
Questions
Largest drop
Baseline spread
Largest drop
Baseline spread
GPQA-Diamond
198
0.85
1.35
0.47
1.20
AIME 2025
30
0.54
0.89
0.09
1.57
IFEval strict
541
0.65
0.65
0.00
0.67
LiveCodeBench v5
880
0.84
0.89
0.43
0.66
MMLU-Redux 2.0
5,700
0.21
—
0.01
—
Appendix
Table 8: Largest quality drop of each benchmark over all settings of Table 4 , against the baseline spread, the 95th percentile of the difference between two halves of the ten baseline repeats over all splits. The four benchmarks with three repeats have no such split. Percentage points.
Figure 3: (a) Median decode TPOT against the mean number of active experts on the busiest rank for 11 configurations of Qwen3-235B at ISL 1024 and global batch 96. The dashed line is a least-squares fit. (b) Cross-layer prediction accuracy on 12 sampled MoE layers of Qwen3-235B during prefill. The curves give the share of each token’s true Top-8 experts inside the predicted Top-8 and inside the predicted Top-16, and the share of their routing weight inside the predicted Top-16.
Figure 4: GEMM profiling. (a–c) Offline latency of the grouped expert GEMM for one MoE layer on one GPU, with the expert shapes and experts per rank of Qwen3-235B at EP =8 and Qwen3.5-397B at EP =16 . (a) Decode layout with every expert on the rank active. (b) Decode layout with 8 tokens per active expert. (c) Prefill layout with every expert on the rank active. The shaded bands mark the tokens per expert at the batch sizes of Table 3 and at the chunk sizes of Table 1 . (d) Expert GEMM time of each MoE layer and EP rank during Qwen3-235B prefill at 8K tokens per rank, against the token load of the rank divided by the layer mean. The dashed lines are least-squares fits.
D
Weights
maxrAr
Δ1/TPOT
LiveCodeBench v5
IFEval strict
MMLU-Redux 2.0
1
on
13.68
+0.6%
−1.00
−0.35
−0.23
2
on
12.61
+3.0%
−0.31
+0.04
−0.20
4
on
10.76
+7.7%
−0.45
−0.11
−0.21
8
on
10.03
+9.1%
−1.27
−0.13
−0.10
∞
on
9.74
+9.1%
−0.59
−0.65
−0.13
4
off
10.75
+7.7%
−1.49
−0.50
−0.26
Appendix
Table 9: Decode shedding on Qwen3-235B for each depth cap D with quality weights, and for D=4 without them, at ISL 1,024 and global batch 96. maxrAr is the mean number of active experts on the busiest rank. This count and the gain in 1/TPOT come from the throughput runs. Quality changes are in percentage points. LiveCodeBench and IFEval use ten repeats, or 13 for D=4 with quality weights. MMLU-Redux uses three.
L
8
12
16
20
24
32
Top- L recall
0.866
0.966
0.987
0.994
0.997
0.999
Weight recall
0.903
0.976
0.991
0.996
0.998
0.999
Missed weight (%)
9.7
2.4
0.92
0.45
0.25
0.095
Appendix
Table 10: Cross-layer prediction accuracy on Qwen3-235B against the candidate width L , pooled over the 12 sampled layers of Figure 3 (b). Top- L recall is the fraction of true Top-8 experts inside the predicted Top- L . Weight recall is the share of routing weight on these experts. Missed weight is the remainder. L=16 is the default on Qwen3-235B.
P
Qwen3-235B, prefill chunk
Qwen3.5-397B, code
8
1.60→1.19 (68%)
—
16
2.30→1.36 (70%)
2.48→1.39 (72%)
32
3.45→1.86 (64%)
3.62→1.87 (66%)
64
5.30→2.97 (53%)
5.53→2.92 (57%)
128
—
9.34→5.30 (51%)
Appendix
Table 11: Offline replay of the prefill prices at larger EP degrees. Imbalance is max-to-mean, native → RankCast, with the share of the excess over the mean removed in parentheses. Qwen3-235B uses 16,384-token prefill chunks; Qwen3.5-397B uses decode-shaped captures combined into 16,384-token batches.