Introduction
Fine-tuning Large Language Models (LLMs) on domain-specific data is critical for achieving high performance in specialized fields like medicine or law. However, this data is frequently siloed across different entities, protected by strict privacy regulations. Federated Learning (FL) provides a framework for collaborative training without data sharing, but applying FL to LLMs introduces significant challenges. Standard LLMs require immense computational resources (e.g., LLaMA-2-7B needs ~28GB VRAM), and model owners often wish to keep their architectures private.
Problem Statement
Existing federated fine-tuning methods often struggle with two main issues: resource constraints on edge devices and performance degradation due to data distribution shifts. While methods like FedOT attempt to use compressed models, they often fail to bridge the gap between the server's public alignment data and the clients' private, specialized datasets. This "data discrepancy" leads to significant accuracy drops when models are aggressively compressed.
The FedBiOT Framework
To address these challenges, the authors propose FedBiOT (Federated Bi-level Offsite Tuning). This framework enables resource-constrained clients to collaboratively fine-tune LLMs without ever loading the full model.
FedBiOT splits the LLM into two distinct components:
- The Emulator: A compressed version of the "top" layers of the LLM, responsible for general feature learning. It is generated via uniform layer dropout.
- The Adapter: The "bottom" layers responsible for task-specific encoding.
Key Innovations
- Bi-level Optimization: This core strategy formulates a two-stage objective where clients optimize the Adapter on local data while the server aligns the Emulator with the full model using a public dataset. This helps the model reach an equilibrium that accounts for distribution shifts.
- LoRA Integration: By utilizing Low-Rank Adaptation (LoRA), FedBiOT minimizes the number of trainable parameters (e.g., 0.13M vs 202M per layer), significantly reducing communication overhead.
- Knowledge Distillation: The server employs KL-divergence and $\ell_2$-norm losses to ensure the lightweight emulator's representations match the original model.
Experimental Evaluation
The framework was evaluated using LLaMA-2-7B across three diverse NLP tasks:
- Math Problem Solving (GSM-8K): Partitioned i.i.d. across 3 clients.
- Code Generation (Rosetta): Partitioned by programming language across 9 clients.
- Question Answering (Dolly-15K): Partitioned by category across 8 clients. The Alpaca dataset served as the public alignment data for the server-side distillation process.
Results and Discussion
FedBiOT demonstrates significant improvements in both efficiency and accuracy over existing federated fine-tuning benchmarks.
Efficiency and Communication
By applying LoRA to a subset of layers, FedBiOT achieves a 99.94% reduction in communication costs compared to full-layer transmission. This makes federated LLM tuning feasible for devices with limited bandwidth and VRAM.
Accuracy and Stability
As shown in the results for the GSM-8K task, FedBiOT maintains high performance even under aggressive compression. At a 0.5 dropout rate, FedBiOT (Adapter 4) achieved 14.03% accuracy, nearly doubling the performance of the FedOT baseline (7.51%). This stability is attributed to the "Anchor Effect," where the server-side alignment stabilizes the training process against distribution shifts.
Task-Specific Performance
In code generation tasks, FedBiOT outperformed the nearest baseline by approximately 6% in Java (Pass@10), demonstrating its robustness in handling non-i.i.d. data distributions across different programming languages.
Conclusion
FedBiOT presents a scalable and privacy-preserving solution for federated LLM fine-tuning. By combining bi-level optimization with parameter-efficient adapters, it overcomes the resource and privacy barriers that have previously hindered the deployment of LLMs in federated settings. Future work will explore more complex emulator architectures and the application of this framework to models exceeding 70 billion parameters.
Summary updated