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:
- Massive communication overhead, as communicating every expert layer negates the efficiency of sparse activation.
- 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.7Bunder 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 onDeepSeek-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