[Paper Review] OpenFedLLM: Training Large Language Models on Decentralized Private Data via Federated Learning
OpenFedLLM presents a framework for federated instruction tuning and federated value alignment of LLMs using seven FL algorithms, eight datasets, and 30+ metrics, demonstrating FL can outperform local training and, in some finance domains, even GPT-4.
Trained on massive publicly available data, large language models (LLMs) have demonstrated tremendous success across various fields. While more data contributes to better performance, a disconcerting reality is that high-quality public data will be exhausted in a few years. In this paper, we offer a potential next step for contemporary LLMs: collaborative and privacy-preserving LLM training on the underutilized distributed private data via federated learning (FL), where multiple data owners collaboratively train a shared model without transmitting raw data. To achieve this, we build a concise, integrated, and research-friendly framework/codebase, named OpenFedLLM. It covers federated instruction tuning for enhancing instruction-following capability, federated value alignment for aligning with human values, and 7 representative FL algorithms. Besides, OpenFedLLM supports training on diverse domains, where we cover 8 training datasets; and provides comprehensive evaluations, where we cover 30+ evaluation metrics. Through extensive experiments, we observe that all FL algorithms outperform local training on training LLMs, demonstrating a clear performance improvement across a variety of settings. Notably, in a financial benchmark, Llama2-7B fine-tuned by applying any FL algorithm can outperform GPT-4 by a significant margin while the model obtained through individual training cannot, demonstrating strong motivation for clients to participate in FL. The code is available at https://github.com/rui-ye/OpenFedLLM.
Motivation & Objective
- Motivate collaborative, privacy-preserving training of LLMs on distributed private data instead of relying solely on public data.
- Provide an integrated framework combining federated instruction tuning and federated value alignment within multiple FL baselines.
- Explore practical feasibility with parameter-efficient fine-tuning to run on modest hardware.
- Offer a comprehensive empirical study across diverse domains to reveal FL benefits and domain-specific insights.
Proposed method
- Integrates 7 representative federated learning algorithms (e.g., FedAvg, FedProx, SCAFFOLD, FedAvgM, FedAdagrad, FedYogi, FedAdam) into an LLM fine-tuning framework.
- Implements federated instruction tuning (FedIT) using supervised fine-tuning losses with LoRA for parameter efficiency.
- Implements federated value alignment (FedVA) using Direct Preference Optimization (DPO) losses to align with human preferences across clients.
- Provides a decoupled, framework-style implementation enabling easy collaboration between FL and LLM training.
- Employs PEFT techniques (LoRA) to keep trainable/communicated parameters under 1% of base model.
- Supports 8 datasets across domains and 30+ evaluation metrics to assess generalization and safety.
Experimental results
Research questions
- RQ1Can federated learning improve LLM instruction-following capability compared with local training across diverse domains?
- RQ2Does federated value alignment via DPO yield safer and more helpful LLM behavior in federated settings?
- RQ3Which FL algorithms and dataset conditions best preserve knowledge and performance for LLM fine-tuning?
- RQ4What are the practical resource requirements and efficiency gains when applying PEFT in federated LLM training?
- RQ5In which domains (finance, medical, code, etc.) can FL-trained LLMs surpass baselines such as GPT-4 under certain configurations?
Key findings
- All FL algorithms outperform local training on the evaluated tasks across multiple benchmarks.
- Training via FL can run on a single consumer GPU and take approximately 1–2 hours per client for 100 rounds.
- No single FL algorithm dominates in all scenarios; performance varies by domain and metric.
- In finance-related tasks, FL with domain-specific data can outperform GPT-4, while vanilla local training cannot.
- Federated instruction tuning and federated value alignment collectively enhance instruction-following and alignment with human values.
- The framework achieves strong efficiency, with only about 0.06% of parameters trainable/communicated per round when using LoRA.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.