TL;DR
FedSpaLLM is the first federated learning framework specifically designed to prune Large Language Models (LLMs) using private, decentralized data. By combining a novel $\ell_0$-norm aggregation method with adaptive mask expansion and resource-aware layer sampling, it achieves high sparsity and better performance than local pruning while keeping sensitive data on-device.
What Problem Does This Paper Address?
Large Language Models (LLMs) are notoriously resource-heavy, making model compression techniques like pruning—removing redundant weights—essential for deployment on edge devices. However, state-of-the-art pruning methods typically require a "calibration dataset" to determine which weights are least important. In sensitive sectors like healthcare or finance, this data is private and cannot be uploaded to a central server.
While Federated Learning (FL) allows multiple parties to train models collaboratively without sharing raw data, existing FL research has focused almost entirely on fine-tuning LLMs. Pruning presents a unique challenge: unlike continuous weight updates, pruning involves discrete binary masks (keep vs. drop). Standard aggregation methods like FedAvg fail here because they tend to "wash out" important weights or fail to meet global sparsity targets when different clients make different pruning decisions based on their local data.
Methods
The authors introduce FedSpaLLM, which tackles these challenges through three core innovations:
- $\ell_0$-norm Aggregation: In standard FL, weights are averaged across all clients. If one client prunes a weight (sets it to zero) and another keeps it, a simple average dilutes the value toward zero. The $\ell_0$-norm aggregator instead averages only the non-zero weights, preserving the magnitude of important parameters.
- Adaptive Mask Expansion: Because clients have different data, they will inevitably choose to prune different weights. If the server only prunes weights that every client agreed to drop, the final model won't be sparse enough. FedSpaLLM uses a "voting" mechanism: it counts how many clients pruned each weight and then expands the global mask to include the most commonly pruned weights until the target sparsity is reached.
- Layer Sampling Strategy: To handle clients with varying hardware (resource heterogeneity), the server sends only a subset of model layers to each client in every round. Clients prune these layers and use cached versions for the rest. This significantly cuts communication costs and allows even low-power devices to participate.
Datasets
The framework was evaluated using the following benchmarks:
- WikiText-2 (WT-2): A collection of high-quality articles from Wikipedia.
- Penn Treebank (PTB): A classic corpus for language modeling.
- C4 (Colossal Clean Crawled Corpus): A massive dataset of web text; the authors used a subset of the validation data.
Pruning was performed using SparseGPT as the local pruning engine, with 32 calibration samples per client to maintain a zero-shot setting.
Key Insights and Ideas
- The "Vanishing Weight" Problem: The paper identifies that standard averaging in a sparse setting is destructive. By treating zeros as "missing data" rather than "values of zero" during aggregation ($\ell_0$-norm), they prevent the global model's weights from artificially shrinking.
- Consensus-Based Pruning: The adaptive mask expansion (shown in Figure 2 below) effectively treats pruning as a democratic process. It prioritizes the "wisdom of the crowd" to decide which weights are truly redundant across the entire federated network.
- Independence of Layers: A key "aha" moment is the observation that LLM pruning can be done layer-by-layer independently. This is what makes the layer sampling strategy viable, unlike holistic fine-tuning where layers are deeply interdependent during backpropagation.
Key Results
The researchers tested FedSpaLLM on the OPT (125m, 1.3b) and LLaMA-2 (7b) model families with 4, 8, and 16 clients, targeting 50% to 80% sparsity.
- Superior Performance: FedSpaLLM consistently achieved lower perplexity (better language modeling accuracy) than "standalone" pruning (where a client prunes only on its own data).
- Scaling with Sparsity: The benefits of the federated approach became even more pronounced at higher sparsity levels (e.g., 80%), where local data is often insufficient to identify a good pruning mask.
- LLaMA-2 Breakthrough: For the LLaMA-2 7b model on the PTB dataset, the global federated model achieved up to 5 times better perplexity than individual client models at 60% sparsity and beyond.
Limitations and Future Work
While FedSpaLLM is a major step forward, the authors note a few hurdles:
- Resource Estimation: The layer sampling strategy relies on accurately knowing a client's computational capacity, which can fluctuate in real-world mobile environments.
- Extreme Data Skew: While it handles heterogeneity well, extreme "non-IID" (Independent and Identically Distributed) data across clients might still require further refinements to the mask expansion logic.
- Model Scale: The current study goes up to 7 billion parameters. Testing on "massive" LLMs (70B+) remains a goal for future work to ensure the communication efficiency gains scale linearly.
Summary updated