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.
The Resource Wall in Mobile FedLLM
Federated Learning (FL) allows AI models to learn from user data without that data ever leaving the device, which is a major win for privacy. However, bringing this to Large Language Models—an approach called FedLLM—faces a massive "resource wall" on mobile hardware. The authors identify three primary obstacles:
- The Memory Wall: Standard training relies on backpropagation (BP), which requires storing "activations" for every layer. For a model like RoBERTa-large, this requires nearly 4GB of RAM—often more than a mobile OS will allow a single app to use.
- Hardware Incompatibility: Mobile devices have powerful Neural Processing Units (NPUs) that are 30x faster than CPUs, but they are designed strictly for inference. They lack the specialized operators needed for the gradient calculations used in BP.
- Poor Scalability: In traditional FL, adding more devices doesn't necessarily make the model converge faster; performance often saturates after just a few dozen participants.
Methodology: BP-Free Training with FwdLLM
FwdLLM’s core innovation is moving to a BP-free training method. Instead of calculating an exact gradient via a backward pass, it uses Forward Gradients (directional derivatives). The process works through several key designs:
- Perturbed Inferences: Devices receive the model and a random "seed." They apply a small, random perturbation to the model weights and run a standard inference. By comparing the output of the "perturbed" model to the original, the device can estimate the gradient direction.
- PEFT Integration: Forward gradients are notoriously noisy for large models. FwdLLM solves this by only applying perturbations to Parameter-Efficient Fine-Tuning (PEFT) modules (like LoRA or Adapters). Since there are fewer parameters to "guess," the gradient estimation becomes much more accurate.
- Variance-Controlled Pacing: The system dynamically adjusts how many perturbations are needed. In early training, a few guesses are enough; as the model nears convergence, the server asks for more perturbations to refine the direction.
- Discriminative Sampling: To save energy, the server pre-screens random perturbations and only sends the "seeds" for those likely to align with the model's current trajectory, filtering out useless, orthogonal noise.
Experimental Results
The authors evaluated FwdLLM across four diverse NLP datasets (AGNEWS, YAHOO, YELP-Polarity, and SQuAD-v1.1) using five different LLMs.
Key Findings
- Massive Speedups: Compared to full-model fine-tuning, FwdLLM reduced training time from ~100 hours to under an hour in some scenarios (up to 217x reduction).
- Memory Savings: It achieved a 14.6x reduction in memory footprint compared to conventional methods. Because it doesn't need to store activations for a backward pass, the memory footprint is essentially just the size of the model plus the small PEFT parameters.
- Billion-Parameter Feasibility: The researchers successfully fine-tuned LLaMA-7B (quantized to INT4) on a Google Pixel 7 Pro. It reached target accuracy in just 10 minutes by scaling across 1,000 simulated devices—a feat previously considered impossible for commodity mobile hardware.
- NPU Acceleration: On a Pixel 7 Pro, FwdLLM ran 19.5x–27.5x faster than CPU-based backpropagation.
Conclusion and Future Work
FwdLLM bridges the gap between hardware capability and training requirements by turning training into a series of inferences. While it represents a giant leap forward, some hurdles remain. Current mobile NPU libraries (like TFLite) don't yet fully support the specific operators needed for the largest generative models like LLaMA. Additionally, while memory and computation are optimized, the protocol still requires frequent communication with a server. Future work could explore ways to reduce the number of rounds required and conduct a deeper privacy analysis of sharing directional derivatives in a federated context.
Summary updated