TL;DR
FedPruner is a new federated learning framework that enables resource-constrained edge devices to fine-tune Large Language Models (LLMs) by intelligently pruning the model to fit their specific memory budgets. By combining macro-level functional grouping with micro-level importance sampling, FedPruner achieves up to 11.11% higher accuracy than existing methods while slashing peak memory usage by 75%.
What Problem Does This Paper Address?
Fine-tuning LLMs typically requires massive amounts of data, which is often siloed on user devices due to privacy concerns. Federated Learning (FL) offers a solution by training models locally on-device, but it hits a "Memory Wall."
Even with parameter-efficient techniques like LoRA (Low-Rank Adaptation), the sheer size of the base model parameters dominates the memory footprint—accounting for over 90% of the total usage. While a LLaMA2-7B model requires roughly 26.9 GB of RAM to fine-tune, typical edge devices (like smartphones) only possess 4–12 GB. This resource gap prevents the majority of edge devices from participating in federated training, leading to significant performance degradation and biased models.
Methods
The authors introduce FedPruner, a "macro-micro synergistic pruning framework" designed to create personalized submodels for each device based on its available RAM.
-
Macro-Level: Functionality-Driven Layer Orchestration (FDLO): Neural networks process information hierarchically. To avoid breaking this hierarchy, FedPruner uses Centered Kernel Alignment (CKA) to calculate similarity between layers. It then groups functionally similar layers into $K$ clusters (where $K$ is the maximum number of layers the device can afford).
-
Micro-Level: Importance-Aware Layer Selection (IALS): Within each functional group, the system must choose which layer to keep. Instead of random selection, it calculates an "importance score" based on the magnitude of feature transformation a layer performs. Layers that significantly change the data are more likely to be retained, preserving critical computational pathways.
-
FedPruner+ (Fine-Grained Pruning): The authors also propose a variant that prunes at the component level. Instead of treating a Transformer block as a single unit, it treats the Multi-Head Attention (MHA) and Feed-Forward Network (FFN) as independent prunable units, allowing for even more flexible and efficient submodel architectures.
Datasets
The researchers evaluated FedPruner using a variety of LLaMA-based models (TinyLLaMA, LLaMA2-7B/13B, and LLaMA3 series) and Qwen2.5-7B.
- Training: Instruction tuning was performed on the Alpaca-GPT4 dataset.
- Evaluation: A comprehensive suite of benchmarks was used, including:
- MMLU: General knowledge.
- BBH (BIG-Bench Hard): Complex reasoning.
- TruthfulQA: Model truthfulness.
- IFEval: Instruction following.
- Vicuna-Bench & MT-Bench: Multi-turn conversational ability (scored via GPT-4).
Key Insights and Ideas
- Middle Layer Redundancy: The authors found that LLMs exhibit significant redundancy in their middle layers. Pruning the very first or very last layers causes catastrophic performance drops, but middle layers can be aggressively pruned with minimal impact.
- Hierarchy is Key: Randomly removing layers breaks the model's ability to extract features hierarchically. By grouping layers by function (FDLO), FedPruner ensures the resulting submodel still "makes sense" architecturally.
- Breaking the MHA-FFN Sandwich: FedPruner+ revealed that the standard alternating pattern of Attention and Feed-Forward blocks isn't always optimal for pruned models. In some cases, the best submodel might connect two Attention blocks directly, bypassing an FFN entirely.
- Dynamic Adaptation: Because layer functionality evolves during training, FedPruner adaptively recalculates similarity matrices and importance scores, ensuring the submodels remain optimized as the global model matures.
Key Results
- Accuracy Gains: FedPruner outperformed state-of-the-art memory-aware methods (like FedRA) by up to 11.11% on LLaMA2-13B.
- Memory Efficiency: It successfully fine-tuned models while reducing peak memory usage by 75%, allowing devices with only 3 GB of available RAM to participate in training a 7B parameter model.
- Faster Convergence: The framework achieved 2.33x faster convergence and 2.20x lower communication costs compared to standard baselines.
- Superior to Theoretical Baselines: Surprisingly, in some high-compression scenarios (25% memory budget), FedPruner actually outperformed the theoretical LoRA baseline (which uses the full model), suggesting that the pruning process may act as a form of beneficial regularization.
Limitations and Future Work
While FedPruner is highly effective for Transformer-based LLMs, the authors note several areas for future exploration:
- Multimodal Expansion: The current work focuses on text. The authors plan to investigate how these pruning strategies translate to multimodal models (like Qwen-VL) where visual and textual encoders have distinct gradient dynamics.
- Generative Diffusion: Testing the framework on diffusion backbones to see if block-wise utility observations hold true for iterative denoising processes.
- Cross-Modal Alignment: Examining how layer-wise pruning affects the alignment between different data modalities (e.g., image-text pairs).
Summary updated