Aggregation Alignment for Federated Learning with Mixture-of-Experts under Data Heterogeneity

Zihan Fang, Qianru Wang, Haonan An, Zheng Lin, Yiqin Deng, Xianhao Chen, Yuguang FangarXiv 2026

TL;DR

FedAlign-MoE is a novel federated learning framework designed to fine-tune Mixture-of-Experts (MoE) large language models under heavy data heterogeneity. By aligning routing distributions in function space and selectively aggregating experts based on semantic consistency, it prevents the "one-size-fits-none" problem of standard parameter averaging. This approach preserves expert specialization, leading to significantly faster convergence and higher accuracy across diverse client datasets.

What Problem Does This Paper Address?

Mixture-of-Experts (MoE) architectures are highly popular for scaling up Large Language Models (LLMs) efficiently because they only activate a sparse subset of specialized "experts" for any given input token. However, fine-tuning these models via Federated Learning (FL) across private, heterogeneous client datasets introduces two major roadblocks:

  1. Gating Preference Misalignment: Different clients develop unique routing preferences based on their local data. Directly averaging the parameters of these gating networks creates a distorted, "one-size-fits-none" global router that misdirects tokens after aggregation.
  2. Expert Semantic Divergence: Because data across clients is non-IID (not identically distributed), experts with the exact same index (e.g., "Expert 3") end up learning completely different semantic roles on different devices. Blindly averaging their weights blurs their specialized knowledge, degrading overall performance.
Fig. 1: Federated MoE-based LLM fine-tuning workflow.

Methods

The authors introduce FedAlign-MoE, which tackles these issues through two main mechanisms:

  • Consistency-Based Gating Distribution Alignment: Instead of averaging raw gating parameters, the server aggregates the empirical routing distributions (the actual behavior/outputs of the gates). It uses a routing consistency weighting scheme based on two metrics: expert overlap (how well a local preference aligns with global consensus) and routing decision margin (the internal confidence of a client's router). Locally, clients use Kullback-Leibler (KL) divergence regularization to smoothly guide their local routers toward this global consensus without erasing local nuances.
  • Semantic-Aware Expert Aggregation: To prevent semantic blurring, the server projects experts into a functional space to evaluate what they actually do. It measures input-space assignment (averaging the hidden states routed to an expert) and local weight updates (the direction of gradient updates). Using an adaptive thresholding mechanism, the server selectively aggregates updates only from clients where the same-indexed expert shares a similar semantic role, suppressing conflicting updates.

Datasets

The framework was evaluated on four standard NLP and reasoning benchmarks under both IID and non-IID (Dirichlet-partitioned, $\alpha = 0.1$) settings:

  • AGNews: Multi-class topic classification.
  • PIQA: Commonsense reasoning benchmark.
  • HellaSwag: Adversarial context-completion reasoning dataset.
  • MMLU: Massive Multitask Language Understanding benchmark spanning 57 subjects.

The backbone models tested were Switch Transformer (Switch-base-16) and DeepSeek-MoE-16B (fine-tuned using QLoRA).

Key Insights and Ideas

  • Function over Parameters: Standard FL assumes parameter averaging preserves behavior. For MoE gating networks, parameter averaging destroys the crisp decision boundaries learned by individual clients. Aligning the probability distributions (function space) instead of the raw weights is the key to maintaining a functional global router.
  • The Index Trap: Just because two clients update "Expert #1" doesn't mean they are training it to do the same job. Under non-IID data, identical indices diverge semantically. Tracking the average hidden states (input space) acts as a reliable semantic fingerprint to detect when an expert is being pulled in completely incompatible directions.
Fig. 3: The t-SNE visualization of gating parameters and the performance of expert selection from direct parameter aggregation across clients on AGNews dataset.
  • Adaptive Filtering: A static threshold for filtering out bad expert updates fails because some experts naturally generalize quickly while others remain highly specialized. Dynamically adjusting the threshold based on the statistical dispersion of expert semantics ensures robust collaboration.

Key Results

  • Accuracy Boost: In highly heterogeneous (non-IID) environments, FedAlign-MoE consistently outperformed classical baselines (FedAvg, FedProx) and specialized MoE FL methods (FedMoE, PFL-MoE). It achieved an accuracy improvement of up to 4% over FedMoE and 7% over FedAvg.
  • Faster Convergence: FedAlign-MoE achieved the fastest convergence across tasks, delivering 1.3x to 1.7x speedups on Switch-base-16 and DeepSeek-MoE-16B models respectively.
  • Scalability: While performance typically degrades in FL as the client pool grows (due to increased data variance), FedAlign-MoE maintained high accuracy and robust scalability even when scaling from 10 to 50 clients.

Limitations and Future Work

The authors note that while FedAlign-MoE significantly improves performance under data heterogeneity, it introduces a slight communication and computation overhead by requiring clients to calculate and upload empirical routing statistics and hidden state averages alongside model updates. Future work could explore optimizing these lightweight statistics to further reduce communication costs or extending the framework to handle system heterogeneity (e.g., clients with varying computational capacities).

Summary updated

BibTeX
@misc{fang2026aggregation,
  author = {Zihan Fang and Qianru Wang and Haonan An and Zheng Lin and Yiqin Deng and Xianhao Chen and Yuguang Fang},
  title = {{Aggregation Alignment for Federated Learning with Mixture-of-Experts under Data Heterogeneity}},
  year = {2026},
  eprint = {2603.21276},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2603.21276},
}
Figure