Manuscript Offprint

arXiv:2610.09372

Expert Coupling in MoE Pretraining: Reducing All-to-All Overhead with Correlated Placement and Token Shuffling

Radha Gulhane, Quentin Anthony, Beren Millidge

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Radha Gulhane ∗^{*} Quentin Anthony Beren Millidge

Zyphra

Abstract—Mixture-of-Experts (MoE) layers replace the feedforward block of a Transformer with E expert networks, and each token is routed to k of these experts. Under expert parallelism (EP) the experts are distributed across GPUs, and every MoE layer runs all-to-all collectives in the forward and backward passes to dispatch tokens to their experts and then combine the results. On a cluster with 8 AMD Instinct MI300X GPUs per node, these collectives can take 45 % of the training step at EP32 with top-2 routing and 60 % with top-6 routing. We find that early in pretraining routers have already learned to assign tokens to experts in correlated patterns, both within a layer and across layers. At top-2, 0.8 % of the expert pairs in a layer are selected together by 42 % of tokens, and the experts a token selects at one layer predict the experts it selects at the next layer. We use these correlations to keep more token-expert assignments on the token's own GPU, which reduces communication across GPUs and across nodes. Correlated expert placement puts experts that are often selected together on the same GPU. Combined with a dispatcher that sends each token to each GPU once, it removes up to 58 % of dispatched rows. Token shuffling applies when sequence parallelism shards tokens across the EP group. It moves each token to the GPU predicted to hold its next-layer experts during the reduce-scatter that follows attention. On one node this raises the share of token-expert assignments served on the token's GPU from 12.5 % to 59 %. In Megatron-LM, across EP degrees from 8 to 64 with top-2 and top-6 routing, the two methods reduce all-to-all time by 1.16–2.63× and end-to-end step time by up to 1.41×. Neither method changes the models' underlying routing decisions or expert parameters.

I. INTRODUCTION

Mixture-of-Experts (MoE) layers have become a central building block of large language models [Jiang et al., 2024, Liu et al., 2024, Yang et al., 2025, Kimi Team, 2026]. In an MoE layer, the single feed-forward network (FFN) of a dense Transformer block is replaced by a set of E parallel FFNs, called experts, together with a lightweight router [Shazeer et al., 2017, Lepikhin et al., 2021, Fedus et al., 2022]. After the attention sub-layer, the router scores each token's hidden state against all experts and selects its top-k experts. The token is processed only by those experts, and their outputs are combined using the router weights. Model capacity therefore grows with E, while the FLOPs per token grow only with k. Because each expert is updated only by the tokens routed to it, experts become specialized over the course of pretraining [Dai et al., 2024, Xue et al., 2024].

This capacity comes at a communication cost. Under expert parallelism (EP) [Lepikhin et al., 2021], experts are sharded across GPUs, and every MoE layer requires two all-to-all (A2A) collectives. The dispatch sends each token from the GPU that owns it to the GPUs holding its selected experts, and the combine returns the expert outputs to the owning GPU. Both collectives run in the forward pass and again in the backward pass. The communication volume grows with the EP degree and with top-k, and once the EP group spans multiple nodes, the slower inter-node links dominate step time. In our measurements on a cluster with 8 AMD Instinct MI300X GPUs per node (Section II-A), all-to-all communication accounts for 13.5 % and 44.8 % of step time at EP8 and EP32 under top-2 routing, and for 24.0 % and 60.4 % under top-6 routing.

Conventional MoE implementations place experts contiguously across the EP group, with expert e on GPU [e/(E/EP)][e/(E/EP)], irrespective of which experts are used together. Depending on the routing, the all-to-all can also become unbalanced, and the few GPUs that receive a disproportionate share of tokens become stragglers that delay the whole collective. Mechanisms that address this include expert replication [Liu et al., 2024], load-driven expert relocation [Zhai et al., 2023], and dynamically planned redundant experts with weight prefetching [Chen et al., 2026, Kimi Team, 2026]. SmartMoE also changes which GPU holds each expert, but it places experts to balance load, not to co-locate experts that are selected together. These techniques lower the peak per-link traffic by distributing the traffic across GPUs. The total traffic stays about the same, because the same fraction of token-expert assignments crosses a GPU boundary. Replication also costs memory for the expert copies. DeepSeek-V3 additionally reduces inter-node traffic with node-limited routing, which restricts the experts the router can select.

A second line of work exploits expert affinity for MoE inference. GRACE-MoE [Han et al., 2025] groups experts that are often selected together within a layer onto the same GPU, first across nodes and then across the GPUs of each node, and sends a token to each GPU only once. Its groups differ in size, and it replicates heavily loaded experts to rebalance the GPUs, which costs memory. We apply within-layer grouping to pretraining with equal-size groups and no replicas. ExFlow [Yao et al., 2024] uses inter-layer expert affinity to co-locate experts across layers. This approach does not transfer directly to pretraining. During autoregressive decoding, a token can be placed on any convenient GPU. During pretraining, a token stays on the GPU that holds its part of the sequence for the attention sub-layer, and moving it requires additional communication. Exploiting cross-layer

∗^{*}Corresponding author: radha@zyphra.com affinity during training therefore requires a mechanism that ExFlow does not provide.

Our starting point is that once experts specialize during pretraining, routing follows stable patterns. We study expert routing across pretraining stages and load-balancing methods, and find two such patterns. The first is within-layer correlation. Some pairs of experts are selected together much more often than independent routing would predict. After approximately 2.1 B training tokens with top-2 routing, 42 % of tokens select one of only 0.8 % of the possible expert pairs, and this pattern is already present after about one billion tokens. The second is cross-layer correlation. The experts a token selects at layer ℓ\ell predict the experts it selects at layer ℓ+1\ell+1. Both correlations appear with all three load-balancing methods we test, but with differing strengths.

We exploit these correlations to raise token-expert locality, the fraction of (token, selected expert) pairs whose expert is on the token's GPU. These pairs never enter the network, so higher locality reduces the total A2A volume. Our methods require no architectural changes or expert replicas, and they do not change routing decisions or the training loss. Correlated placement and deduplication apply to any layout that uses expert parallelism. Token shuffling applies only to layouts that use tensor parallelism with sequence parallelism and in which the TP group and the EP group are the same set of GPUs (TP = EP), such as TP8 EP8 and TP16 EP16 in our evaluation. It does not apply to layouts without tensor parallelism (TP1). Correlated expert placement and deduplication also apply to inference, where affinity-based grouping has already been evaluated [Han et al., 2025]; we do not evaluate inference.

We make the following contributions:

• Correlated Expert Placement and a Deduplicating Dispatcher (Section V-A). We place correlated experts on the same GPU, so that the experts a token selects are more likely to share a GPU. The deduplicating dispatcher sends each token to a destination GPU at most once, regardless of how many of its selected experts are there. Deduplication is an existing technique [Zhao et al., 2025]. The all-to-all dispatcher in Megatron-LM [Shoeybi et al., 2019] sends one copy of a token per selected expert, so we implement deduplication there as the basis for placement. Together, placement and deduplication reduce both intra-node and inter-node communication volume.

• Token Shuffling (Section V-B). For sequence-parallel layouts in which the TP group equals the EP group, we (i) predict a token’s experts at layer ℓ+1\ell+1 from the experts the token selected at the previous layers, and (ii) move the token ahead of time to the GPU that is predicted to hold those experts. The move is folded into the reduce-scatter that sequence parallelism [Korthikanti et al., 2023] already performs after attention. This brings to pretraining the locality benefit that prior affinity-based work obtained for inference.

• Characterization of Expert Routing (Sections II-B and VI, and the appendix). We quantify within-layer co-selection and cross-layer predictability across pretraining stages, top-k settings and load-balancing methods, and relate these statistics to communication volume.

• Evaluation in Megatron-LM (Section VI). We report communication volume, A2A time and end-to-end step time. With expert parallelism alone, correlated placement and deduplication reduce A2A time by 1.16×−1.38×1.16 \times -1.38 \times under top-2 routing and by 1.35×−1.95×1.35 \times -1.95 \times under top-6 routing. With token shuffling added, A2A time is reduced by 1.40×−1.74×1.40 \times -1.74 \times under top-2 and by 1.46×−2.63×1.46 \times -2.63 \times under top-6.

References (28)

  • MoonEP: A perfectly balanced expert parallelism library via dynamic redundant experts
  • Towards ultimate expert specialization in mixture-of-experts language models
  • Switch transformers: Scaling to trillion parameter models with simple and efficient sparsity
  • GRACE-MoE: Grouping and replication with locality-aware routing for efficient distributed MoE inference (opens arXiv in a new tab)
  • Mixtral of Experts
  • An efficient heuristic procedure for partitioning graphs
  • Kimi K3: Open Frontier Intelligence
  • Reducing activation recomputation in large transformer models
  • GShard: Scaling giant models with conditional computation and automatic sharding
  • DeepSeek-V3 Technical Report
  • Heterogeneous parallelism mappings for efficient large-scale MoE model training with Megatron Core (opens arXiv in a new tab)
  • Occult: Optimizing collaborative communications across experts for accelerated parallel MoE training and inference
  • The FineWeb datasets: Decanting the web for the finest text data at scale
  • Outrageously large neural networks: The sparsely-gated mixture-of-experts layer
  • Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelism
  • A hybrid tensor-expert-data parallelism approach to optimize mixture-of-experts training
  • OpenMoE: An early effort on open mixture-of-experts language models
  • Qwen3 Technical Report
  • Exploiting inter-layer expert affinity for accelerating mixture-of-experts model inference
  • SmartMoE: Efficiently training sparsely-activated models through combining offline and online parallelization
  • DeepEP: an efficient expert-parallel communication library
  • Unless stated otherwise, every result uses this configuration, including its router (pre-softmax top-k with $k=2$ or $k=6$ and a sequence-level auxiliary loss of $10^{-2}$)
  • Specifically, our implementation modifies three components
  • Canonical token order is restored around attention, the output layer, and the loss
  • All variants train the same model and produce the same loss, differing only in how tokens are placed and moved across ranks
  • 10× stronger aux loss (seq-aux 1e-1), max/mean load 1.20 F: aux-loss-free (DeepSeek-V3), max/mean load 1.37
  • // The shuffle planner runs on a side stream, overlapped with the expert computation at $m-1$ and the attention that follows; see V-Bc
  • Led initial ideation and exploration