Abstract
Large Language Models (LLMs) are transforming the landscape of mobile intelligence. Federated Learning (FL), a method to preserve user data privacy, is often employed in fine-tuning LLMs to downstream mobile tasks, an approach known as FedLLM. Though recent efforts have addressed the network issue induced by the vast model size, they have not practically mitigated vital challenges concerning integration with mobile devices, such as significant memory consumption and sluggish model convergence. In response to these challenges, this work introduces FwdLLM, an innovative FL protocol designed to enhance the FedLLM efficiency. The key idea of FwdLLM to employ backpropagation (BP)-free training methods, requiring devices only to execute "perturbed inferences". Consequently, FwdLLM delivers way better memory efficiency and time efficiency (expedited by mobile NPUs and an expanded array of participant devices). FwdLLM centers around three key designs: (1) it combines BP-free training with parameter-efficient training methods, an essential way to scale the approach to the LLM era; (2) it systematically and adaptively allocates computational loads across devices, striking a careful balance between convergence speed and accuracy; (3) it discriminatively samples perturbed predictions that are more valuable to model convergence. Comprehensive experiments with five LLMs and three NLP tasks illustrate FwdLLM's significant advantages over conventional methods, including up to three orders of magnitude faster convergence and a 14.6x reduction in memory footprint. Uniquely, FwdLLM paves the way for federated learning of billion-parameter LLMs such as LLaMA on COTS mobile devices -- a feat previously unattained.
What Problem Does This Paper Address?
Training Large Language Models (LLMs) is notoriously resource-intensive, typically requiring massive GPU clusters. Bringing this capability to mobile devices via Federated Learning (FedLLM) faces three "brick walls":
- The Memory Wall: Backpropagation (BP) requires storing intermediate activations to compute gradients. For a model like RoBERTa-large, this can demand nearly 4GB of RAM just for activations, often exceeding the available memory of mobile apps and triggering "low memory killers" in mobile OSs.
- The Accelerator Gap: Mobile NPUs (Neural Processing Units) are incredibly fast but are designed strictly for inference. They lack the specialized operators (like
ReluGrad) needed for training, forcing on-device training to run on much slower CPUs. - Scalability Limits: In traditional FedLLM, adding more devices often yields diminishing returns, as the learning performance saturates quickly.
Methods
The core innovation of FwdLLM is the shift from Backpropagation to Forward Gradients. Instead of calculating an exact gradient via a backward pass, the device performs "perturbed inferences." It applies small, random perturbations to the model weights and measures how the output changes. This allows the device to estimate the gradient using only forward passes, which are memory-efficient and NPU-compatible.
To make this mathematically viable for LLMs, the authors introduce three key designs:
- PEFT Integration: Forward gradients scale poorly with the number of parameters. FwdLLM combines this with Parameter-Efficient Fine-Tuning (PEFT) like LoRA or Adapters. By only tuning a tiny fraction of the weights, the forward gradient estimation becomes significantly more accurate.
- Variance-controlled Perturbation Pacing (VPP): The server monitors the variance of incoming gradients. As the model approaches convergence, it adaptively instructs clients to perform more perturbations to ensure a stable, accurate descent.
- Discriminative Perturbation Sampling (DPS): Most random perturbations are "junk" (orthogonal to the true gradient). FwdLLM uses the "smoothness" of the gradient path to filter out low-value perturbations on the server side before they are even sent to the devices, ensuring every computation counts.
Key Results
FwdLLM demonstrates remarkable efficiency gains across various model architectures. Most notably, it achieved a 14.6× reduction in memory footprint compared to full-model fine-tuning. On a Pixel 7 Pro, memory usage was reduced to approximately 169MB per round for specific models.
Furthermore, FwdLLM delivered an average 10.6× speedup over competitive PEFT baselines and up to 217× over full fine-tuning. Crucially, the authors demonstrated the first successful federated fine-tuning of a quantized LLaMA-7B model on commercial smartphones, reaching target accuracy within 10 minutes.
Key Insights and Ideas
- Inference is Training: The most profound insight is that by reframing training as a series of inferences, we can finally unlock the power of mobile NPUs for learning. This unifies the optimization path for both deployment and training.
- The Power of "Cherry-Picking": Randomly sampling perturbations is inefficient in high-dimensional space. By leveraging the fact that gradients change slowly between rounds, the server can "predict" which perturbations will be useful, drastically reducing wasted mobile compute.
- Scalability Reborn: Unlike BP-based federated learning, which often plateaus with more than a dozen devices, FwdLLM’s accuracy improves steadily as more devices are added. More devices mean more perturbations, which leads to a better estimate of the "gold" gradient.
Limitations and Future Work
- NPU Support for Generative Models: While BERT-like models ran on NPUs, the LLaMA experiments were emulated for speed because current mobile inference libraries (like
llama.cpp) do not yet fully support NPU offloading for all operators. - Hyperparameter Sensitivity: While VPP automates much of the process, the initial variance threshold still requires some empirical tuning depending on the specific task.
- Privacy Nuances: While the authors note that forward gradients are unbiased estimators of true gradients (similar to BP), the specific differential privacy implications of "perturbed inference" vs. "backprop" could be a fertile ground for future security research.
Summary updated