FLEx: Personalized Federated Learning for Mixture-of-Experts LLMs via Expert Grafting

Fan Liu, Bikang Pan, Zhongyi Wang, Xi Yao, Zhichao Sheng, Jingya Wang, Xiaoying Tang, Ye Shi · Submission to ICLR 2026 · Withdrawn

TL;DR

Federated fine-tuning of Mixture-of-Experts (MoE) LLMs usually leads to catastrophic forgetting and massive communication costs when all expert parameters are averaged across heterogeneous clients. FLEx solves this by freezing the pretrained experts, globally synchronizing only the shared non-expert parameters (like self-attention), and creating a lightweight "grafted" local expert per layer via data-driven pruning. A trainable adaptive gate dynamically blends global model capabilities with local client specialization, drastically cutting communication costs while improving downstream performance.

What Problem Does This Paper Address?

When fine-tuning Large Language Models (LLMs) over decentralized user data using Federated Learning (FL), statistical data heterogeneity (non-IID data) often causes conflicting gradient updates across clients. Standard FL algorithms (such as FedAvg) suffer from destructive interference, often resulting in global models that perform worse than isolated local training.

While MoE architectures seem like a natural fit because different "experts" can specialize in different tasks or domains, naive federated MoE approaches require aggregating all expert parameters across all clients. This brings two major issues:

  1. Massive communication overhead, as communicating every expert layer negates the efficiency of sparse activation.
  2. Knowledge corruption and catastrophic forgetting, since naively averaging sparsely activated, specialized expert weights ruins pretrained world knowledge.

Methods

FLEx (Federated LLMs with Personalized Experts) introduces a decoupled architecture separating shared knowledge from local personalization:

  • Selective Parameter Aggregation: Pretrained MoE expert weights remain frozen on the client side throughout federated training. Only the shared, dense non-expert parameters (e.g., self-attention, layer normalization) are uploaded to the central server and aggregated via standard FedAvg.
  • Personalized Expert Grafting via Pruning: Rather than training new experts from scratch, each client creates a personalized side-expert for each MoE layer. It evaluates local data and selects the single pretrained expert that best reconstructs the output of the full MoE ensemble (minimizing the squared Frobenius reconstruction error).
  • Adaptive Gating and Local Fine-Tuning: The grafted expert is added alongside the frozen experts. Each client trains an independent scalar gating router parameterized by a sigmoid function ($g_{e,j}^l = \text{sigmoid}(\text{router}_{e,l}(u_j^l))$) that acts as a soft switch. During local training, clients only update the non-expert parameters, the grafted expert, and its gating network (typically via LoRA).
   [Input Token]
      │
   ┌──┴────────────────────────┐
   │                           ▼
   ▼                     [Adaptive Gate] (Sigmoid)
[Frozen Pretrained MoE]        │
   │                           ▼
   │                    [Grafted Expert] (Locally Tuned)
   └───► (+) ◄─────────────────┘
          │
          ▼
       [Output]

Datasets

The authors evaluated FLEx across several instruction-tuning and general knowledge benchmarks:

  • Databricks-dolly-15k: Partitioned across four subtasks (Classification, Closed QA, Information Extraction, Summarization) under both pathological non-IID (one task per client) and Dirichlet non-IID ($\alpha \in \{0.1, 1.0\}$) partitions.
  • Domain-Specific Datasets: Alpaca-gpt4 (general), Finance-Alpaca (finance), and MedAlpaca (clinical/medical) to evaluate domain heterogeneity.
  • MMLU Benchmark: Used to evaluate general knowledge retention.
  • Vicuna Benchmark: Used with an "LLM-as-a-judge" framework to measure open-ended helpfulness and harmlessness.
  • C4 Dataset: Used to examine expert activation balance across MoE layers.

Key Insights and Ideas

  • Dense layers hold the common ground; experts hold the nuance: Attention layers process every token and capture general sequence dynamics, making them ideal for collaborative federated averaging. Sparse experts specialize, making them susceptible to interference if averaged.
  • Naively adding side experts causes model collapse: Adding a grafted expert directly without gating caused ROUGE-L scores to plummet (collapsing from ~41.17 to 5.16–7.06). An adaptive, soft sigmoid gate is mandatory so the network learns when to call upon client-specific knowledge without drowning out the frozen backbone.
  • Sigmoid beats unbounded switches: Sigmoid activation ([0, 1]) consistently outperformed unbounded activations like ReLU ([0, $\infty$)) or zero-crossing activations like Tanh ([-1, 1]), which introduce numerical instability and uninterpretable negative contributions.

Key Results

  • Higher Downstream Performance: On Qwen1.5-MoE-A2.7B under pathological non-IID Dolly-15k, FLEx achieved an average ROUGE-L of 43.13, beating isolated local training (41.88) and all federated baselines (the closest baseline, FedAvgM, scored 42.37). Similar gains were observed on DeepSeek-MoE-16B-Base (32.66 vs. 30.85 for FedYogi).
  • Knowledge Retention: FLEx scored 49.74 on MMLU compared to 43.91 for standard MoE+FedAvg and 47.06 for FedAdagrad, confirming that freezing original experts prevents catastrophic forgetting.
  • Massive Bandwidth Savings: FLEx reduced communication parameter overhead to 0.0659% (or 0.0672% of total parameters), compared to 3.4172% for standard FL baselines that communicate all expert parameters—over a 50× reduction in network transmission.
  • Safety & Alignment: On the Vicuna benchmark, FLEx attained the highest scores in both Helpfulness (6.360 vs. base 5.145) and Harmlessness (7.993 vs. base 6.319).

Limitations and Future Work

  • Single Grafted Expert Constraint: FLEx restricts each client to grafting a single personalized expert per layer. Extending this to multiple experts yields diminishing returns while causing an exponential increase in greedy search/pruning time (58s for 1 expert vs. 87,091s for 3 experts).
  • Future Algorithmic Directions: The authors note that developing combinatorial pruning algorithms capable of efficiently identifying globally optimal subsets of multiple personalized experts remains an open research challenge.

Summary updated

Abstract

Federated instruction tuning of large language models (LLMs) is challenged by significant data heterogeneity across clients, demanding robust personalization. The Mixture of Experts (MoE) architecture, where experts can specialize in distinct data patterns, presents a natural architectural solution to this challenge. The inherent sparsity of the MoE architecture, achieved by selectively activating experts, poses a significant challenge to its integration with federated learning (FL). Conventional FL frameworks, designed for dense models, naively aggregate all expert parameters irrespective of their local activation patterns. This naive approach not only undermines MoE's dynamic sparsity but also risks corrupting the world knowledge within pretrained experts. To address this, we propose FLEx (Federated LLMs with Personalized Experts), a novel framework that leverages pretrained MoE-based LLMs for efficient personalization. By aggregating only the shared non-expert parameters, FLEx significantly reduces communication overhead and preserves the world knowledge stored within the frozen pretrained experts. For personalization, we introduce a novel expert grafting mechanism that leverages dynamic sparsity to construct a client-specific expert from selected components of pretrained experts, tailored to local data. This grafted expert is then fine-tuned locally alongside the gating mechanism. This joint training enables the model to learn when to leverage the shared knowledge from frozen experts and when to employ the personalized one. Evaluations on diverse, non-IID instruction tuning datasets show that FLEx consistently outperforms federated baselines on average, while demonstrating strong knowledge preservation on the knowledge-driven benchmark MMLU. Our code is available at \href{https://anonymous.4open.science/r/FLEx-8F12}{\texttt{https://anonymous.4open.science/r/FLEx-8F12}}.
BibTeX
@misc{liu2025flex,
  author = {Fan Liu and Bikang Pan and Zhongyi Wang and Xi Yao and Zhichao Sheng and Jingya Wang and Xiaoying Tang and Ye Shi},
  title = {{FLEx: Personalized Federated Learning for Mixture-of-Experts LLMs via Expert Grafting}},
  year = {2025},
  eprint = {2506.00965},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2506.00965},
}
Figure