---
title: "Federated Tuning Explained: Fine-Tuning LLMs Without Pooling Data"
description: "Federated tuning fine-tunes an LLM across many data owners without moving their data. How FedAvg, FedIT and OpenFedLLM work, their numbers, and Flower code."
url: https://launchkudos.com/news/llm-fine-tuning-federated-tuning
section: AI
author: "Arnab Gupta"
published: 2026-12-05T02:20:24.113Z
updated: 2026-12-05T02:20:24.113Z
tags: [llm-fine-tuning, federated-learning, federated-tuning, data-strategy, fedavg]
---

# Federated Tuning Explained: Fine-Tuning LLMs Without Pooling Data

*Federated tuning fine-tunes an LLM across many data owners without moving their data. How FedAvg, FedIT and OpenFedLLM work, their numbers, and Flower code.*

*Part 10 of 15 in [LLM fine-tuning techniques](https://launchkudos.com/news/llm-fine-tuning-techniques)*

Federated tuning fine-tunes one language model across many data owners, such as phones, hospitals or banks, without collecting their data in one place: each owner trains locally and sends back only a model update. It applies federated learning, introduced by Google researchers in 2016 with the FedAvg algorithm, to LLMs, and is usually paired with [LoRA](https://launchkudos.com/news/llm-fine-tuning-lora) so that only small adapter weights travel.

- 10-100x · fewer communication rounds than synchronized SGD · McMahan et al., 2016
- 0.26% · of LLaMA-7B's parameters trained per client in FedIT · Zhang et al., 2023, Table 2
- 0.832 vs 0.731 · finance accuracy, FedAvg-tuned Llama2-7B vs GPT-4 · Ye et al., 2024, Table 5
## What is federated tuning?

Federated tuning is fine-tuning a shared model on data that stays on many separate clients. A central server coordinates; "each client has a local training dataset which is never uploaded to the server. Instead, each client computes an update to the current global model", and only that update is sent ([McMahan et al., 2016, Sec. 1](https://arxiv.org/abs/1602.05629)).

For LLMs, the term covers two jobs that the papers below test:

- **Federated instruction tuning (FedIT):** clients hold instruction-response pairs and jointly instruction-tune a model ([Zhang et al., 2023](https://arxiv.org/abs/2305.05644)). See [instruction tuning](https://launchkudos.com/news/llm-fine-tuning-instruction-tuning) for the non-federated version.
- **Federated value alignment:** clients hold preference data and jointly align the model; OpenFedLLM does this with DPO on each client, which it calls FedDPO ([Ye et al., 2024, Sec. 3](https://arxiv.org/abs/2402.06954)). See [DPO](https://launchkudos.com/news/llm-fine-tuning-dpo).

## How does federated tuning work?

Federated tuning works in rounds. The server sends the current weights to a sample of clients, each client trains on its own data for a few local steps, and the server replaces the global weights with a weighted average of what comes back. This is the FederatedAveraging (FedAvg) algorithm ([McMahan et al., 2016, Algorithm 1](https://arxiv.org/abs/1602.05629)).

![Diagram: a server sends global weights to four clients holding private data; each trains locally and sends updates back; the server averages them weighted by data size](https://launchkudos.com/media/4df23f1ec2cbcc3f9618.webp)

### One FedAvg round, step by step

1. **Select clients.** The server picks `m = max(C × K, 1)` of its K clients at random, where C is the fraction of clients used per round.
2. **Broadcast.** Each selected client receives the current global weights `w_t`.
3. **Train locally.** Each client runs E local epochs of SGD over its own data in minibatches of size B, then returns its new weights `w_k`.
4. **Average.** The server sets `w_{t+1} = Σ_k (n_k / m_t) · w_k`, where `n_k` is client k's number of examples and `m_t` is the total held by that round's clients. (arXiv version 4 of the paper, January 2023, fixed a typo in this line of the pseudocode.)

Setting B to the full local dataset and E = 1 gives FedSGD, the one-gradient-step baseline the paper compares against ([Sec. 2](https://arxiv.org/abs/1602.05629)).

### What changes for LLMs

Sending a full 7B model every round is the main cost. FedIT and OpenFedLLM both freeze the base model and train [LoRA](https://launchkudos.com/news/llm-fine-tuning-lora) adapters, so clients upload only adapter weights and the server averages only those. FedIT says model aggregation combines "only the trainable parameters specified by the LoRA configuration instead of all the parameters" to cut computation and communication ([Zhang et al., 2023, Sec. 3.4](https://arxiv.org/abs/2305.05644)).

**Worked example from OpenFedLLM's setup.** Llama2-7B has 6,738M parameters; with LoRA rank 32 the trainable and communicated part is 4.194M, which the paper reports as 0.06% of the total, sent per round ([Ye et al., 2024, Sec. 4.1, Table 3](https://arxiv.org/abs/2402.06954)). OpenFedLLM also quantizes the base model to int8 so training runs on one consumer GPU, an NVIDIA RTX 3090.

## When was federated tuning introduced, and by whom?

Federated learning came first, and its application to LLM fine-tuning followed about seven years later:

| Paper | Authors | First on arXiv | Venue |
|---|---|---|---|
| [Communication-Efficient Learning of Deep Networks from Decentralized Data](https://arxiv.org/abs/1602.05629) (FedAvg) | H. Brendan McMahan, Eider Moore, Daniel Ramage, Seth Hampson, Blaise Agüera y Arcas (Google) | Feb. 17, 2016 | AISTATS 2017 |
| [Towards Building the Federated GPT: Federated Instruction Tuning](https://arxiv.org/abs/2305.05644) (FedIT) | Jianyi Zhang, Saeed Vahidian, Martin Kuo, Chunyuan Li, Ruiyi Zhang, Tong Yu, Yufan Zhou, Guoyin Wang, Yiran Chen (Duke, Microsoft Research, Adobe Research, Amazon) | May 9, 2023 | Condensed version at ICASSP 2024 |
| [OpenFedLLM: Training Large Language Models on Decentralized Private Data via Federated Learning](https://arxiv.org/abs/2402.06954) | Rui Ye, Wenhao Wang, Jingyi Chai, Dihan Li, Zexi Li, Yinda Xu, Yaxin Du, Yanfeng Wang, Siheng Chen (Shanghai Jiao Tong Univ., Zhejiang Univ., Shanghai AI Lab) | Feb. 10, 2024 | KDD 2024 ([ACM DOI](https://doi.org/10.1145/3637528.3671582)) |

FedIT calls itself "the first exploration of FL-based instruction tuning for LLMs" ([abstract](https://arxiv.org/abs/2305.05644)).

## What results did the federated tuning papers report?

**FedAvg (2016): far fewer rounds than synchronized SGD.** Across five model architectures and four datasets, the method was "robust to the unbalanced and non-IID data distributions" and cut the communication rounds needed by 10-100x compared with synchronized SGD ([McMahan et al., abstract](https://arxiv.org/abs/1602.05629)). One example: on CIFAR-10, a centralized SGD baseline reached 86% accuracy after 197,500 minibatch updates, each of which would be a communication round in the federated setting, while FedAvg reached 85% after 2,000 rounds ([Sec. 3](https://arxiv.org/abs/1602.05629)). A large-scale next-word test used 10 million public social-network posts grouped into over 500,000 clients.

**FedIT (2023): beat local training, trailed centralized training.** Setup: 100 clients built from Databricks-dolly-15k, 20 rounds, 5 clients (5%) per round, one local epoch each, LLaMA-7B with LoRA rank 8 on all linear layers ([Zhang et al., Sec. 4.1](https://arxiv.org/abs/2305.05644)). Per client: 17.9M trainable parameters (0.26%), 2 hours of training and 23GB of GPU memory on one NVIDIA Titan RTX ([Table 2](https://arxiv.org/abs/2305.05644)). The resulting model, Shepherd-7B, was scored by GPT-4 on 20 unseen Vicuna questions ([Table 3](https://arxiv.org/abs/2305.05644)):

| Baseline | Baseline score | Shepherd-7B score | Relative score |
|---|---|---|---|
| Centralized tuning on all instructions | 142.2 | 130.7 | 0.919 |
| LLaMA-7B, no instruction tuning | 114.0 | 131.7 | 1.155 |
| Local-1 (brainstorming only) | 120.0 | 131.0 | 1.092 |
| Local-2 (closed QA only) | 116.1 | 129.0 | 1.111 |
| Local-3 (classification + brainstorming) | 121.3 | 131.8 | 1.087 |

The authors write that the gap to centralized training is "partly attributed" to clients training on very different instruction distributions.

**OpenFedLLM (2024): every FL algorithm beat local training.** The framework covers federated instruction tuning and federated value alignment, 7 FL algorithms (FedAvg, FedProx, SCAFFOLD, FedAvgM, FedAdagrad, FedYogi, FedAdam), 8 training datasets and 30+ evaluation metrics ([Ye et al., Sec. 3-4](https://arxiv.org/abs/2402.06954)). Selected numbers, all with Llama2-7B:

| Test | Local training | FedAvg | Best FL algorithm | GPT-4 |
|---|---|---|---|---|
| General instruction tuning, MMLU (Table 4) | 38.70 | 45.13 | 45.79 (FedYogi) | not reported |
| General instruction tuning, MT-Bench avg (Table 4) | 2.844 | 3.346 | 3.488 (SCAFFOLD) | not reported |
| Finance sentiment, avg accuracy over FPB, FiQA-SA, TFNS (Table 5) | 0.722 | 0.832 | 0.854 (SCAFFOLD) | 0.731 |

The paper also reports that training "only requires one single GPU and takes 1 - 2 hours per client for 100 communication rounds", and that "no FL algorithm can guarantee the best performance in all scenarios" ([Sec. 1](https://arxiv.org/abs/2402.06954)). It calls the finance result "the first time in the literature showing that FL can outperform GPT-4 at any dimension".

## How is federated tuning different from multi-task and instruction tuning?

Federated tuning changes where training happens; [multi-task tuning](https://launchkudos.com/news/llm-fine-tuning-multi-task-tuning) and [instruction tuning](https://launchkudos.com/news/llm-fine-tuning-instruction-tuning) change what data is trained on. They combine: FedIT is instruction tuning run federated, and FedIT's authors say client heterogeneity "can be a beneficial factor" because it diversifies the instructions ([Zhang et al., Sec. 4.2](https://arxiv.org/abs/2305.05644)).

| | Centralized fine-tuning | Federated tuning |
|---|---|---|
| Where data lives | Pooled on the trainer's machines | Stays with each client |
| What moves | Data | Model weights or updates (often LoRA only) |
| Main cost | Compute | Communication rounds (FedAvg's focus) |
| Data distribution | Can be shuffled into IID batches | Unbalanced and non-IID by default |
| Result in FedIT | Upper bound (score 142.2) | 130.7, relative score 0.919 |

## Which libraries support federated tuning?

Three maintained open-source frameworks document federated LLM fine-tuning, plus the papers' own code:

- **[Flower](https://flower.ai/docs/framework/)** (`flwr`, docs v1.45.x). Its [FlowerTune LLM example](https://flower.ai/docs/examples/flowertune-llm.html) "conducts federated instruction tuning with pretrained OpenLLaMA models on Alpaca-GPT4 dataset", using PEFT with bitsandbytes, 20 virtual clients and by default 2 clients per round for 100 rounds.
- **[NVIDIA FLARE](https://nvflare.readthedocs.io/en/main/programming_guide/llm_fine_tuning.html)** documents federated SFT and PEFT, including LoRA. Its Hugging Face integration patches a Transformers `Trainer` or TRL `SFTTrainer` "so existing trainer.evaluate() and trainer.train() calls can participate in FL rounds"; it also supports NVIDIA NeMo.
- **[FATE-LLM](https://github.com/FederatedAI/FATE-LLM)** describes itself as "a framework to support federated learning for large language models(LLMs) and small language models(SLMs)", with parameter-efficient training, FedIPR for model IP protection, and tutorials for methods such as Offsite-Tuning and FedKSeed.
- **Paper code:** FedIT's [Shepherd](https://github.com/JayZhang42/FederatedGPT-Shepherd) and [OpenFedLLM](https://github.com/rui-ye/OpenFedLLM).

## How do you use federated tuning in code?

This is the server side of a federated LoRA run with Flower's current Message API. Names are checked against Flower's [`FedAvg`](https://flower.ai/docs/framework/ref-api/flwr.serverapp.strategy.FedAvg.html), [`ArrayRecord`](https://flower.ai/docs/framework/ref-api/flwr.app.ArrayRecord.html) and [`flwr.app`](https://flower.ai/docs/framework/ref-api/flwr.app.html) reference pages (v1.45.x) and PEFT's [`get_peft_model_state_dict`](https://huggingface.co/docs/peft/package_reference/functional) (v0.22.0).

```python
from flwr.app import ArrayRecord, Context
from flwr.serverapp import Grid, ServerApp
from flwr.serverapp.strategy import FedAvg
from peft import LoraConfig, get_peft_model, get_peft_model_state_dict
from transformers import AutoModelForCausalLM

app = ServerApp()

@app.main()
def main(grid: Grid, context: Context) -> None:
    base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-0.6B")
    lora = LoraConfig(r=8, target_modules="all-linear", task_type="CAUSAL_LM")  # FedIT: rank 8, all linear layers
    model = get_peft_model(base, lora)

    # Only the LoRA adapter weights are sent out and averaged
    arrays = ArrayRecord(get_peft_model_state_dict(model))
    strategy = FedAvg(fraction_train=0.05)      # 5% of clients per round, as in FedIT
    strategy.start(grid=grid, initial_arrays=arrays, num_rounds=20)
```

Each client is a `ClientApp` whose `@app.train()` function loads the received weights (`msg.content["arrays"].to_torch_state_dict()`), trains on local data, and replies with a `RecordDict` holding `"arrays"` and `"metrics"`, as in Flower's [Hugging Face quickstart](https://flower.ai/docs/framework/tutorial-quickstart-huggingface.html). By default `FedAvg` weights each client by the `"num-examples"` metric it reports (`weighted_by_key`), which matches the `n_k` weighting in the paper. Runs start with `flwr run .`.

## Common pitfalls

- **Non-IID data hurts the averaged model.** FedIT's federated model scored 0.919 relative to centralized training; the authors attribute part of the gap to clients learning "different representations" from very different instruction sets ([Zhang et al., Sec. 4.2](https://arxiv.org/abs/2305.05644)).
- **Too much local training.** "For very large numbers of local epochs, FedAvg can plateau or diverge"; the authors suggest decaying the amount of local computation later in training ([McMahan et al., Sec. 3](https://arxiv.org/abs/1602.05629)).
- **No single best aggregator.** OpenFedLLM found FedYogi and SCAFFOLD best for general data, SCAFFOLD for finance, and FedYogi below GPT-4 on FPB accuracy (0.820 vs 0.834) ([Tables 4-5](https://arxiv.org/abs/2402.06954)).
- **Federated is not the same as private.** FedAvg's authors say "some trust of the server coordinating the training is still required", and list differential privacy and secure multi-party computation as ways to get "stronger guarantees" ([Sec. 1 and Conclusions](https://arxiv.org/abs/1602.05629)).

> **How we checked this**
> We read the full text of McMahan et al. (arXiv 1602.05629 v4), Zhang et al. (2305.05644 v2) and Ye et al. (2402.06954 v1) on Dec. 4, 2026, and took numbers from the tables and sections cited. OpenFedLLM's KDD 2024 venue comes from its ACM DOI record in OpenAlex. Flower, NVIDIA FLARE, FATE-LLM and PEFT names were checked on their official docs and repository pages the same day. We did not run the code.

## FAQ

### What is the difference between federated learning and federated tuning?
Federated learning trains a model across clients that keep their data local (FedAvg, 2016). Federated tuning applies the same loop to fine-tuning a pretrained LLM, usually updating only adapter weights such as LoRA, as FedIT and OpenFedLLM do.

### Does federated tuning keep data private?
Raw data never leaves a client, and only model updates are sent. FedAvg's authors note that the server must still be trusted to some degree and point to differential privacy and secure multi-party computation for stronger guarantees.

### Is federated tuning as good as centralized fine-tuning?
Not in FedIT's test: its federated model scored 130.7 against 142.2 for a model trained on all the data centrally (relative score 0.919). It did beat every model trained on a single client's data.

### Can a federated Llama 2 7B beat GPT-4?
On OpenFedLLM's financial sentiment benchmark, yes: FedAvg reached 0.832 average accuracy over three datasets against 0.731 for GPT-4. Locally trained models scored 0.722. This is one domain, not general ability.

### Which framework should I use for federated LLM fine-tuning?
Flower, NVIDIA FLARE and FATE-LLM all document federated LLM fine-tuning with parameter-efficient methods. Flower's FlowerTune example and FLARE's Hugging Face integration both build on PEFT; FATE-LLM adds methods such as Offsite-Tuning and FedIPR.

### Why use LoRA in federated tuning?
It shrinks what each round sends. In OpenFedLLM only 4.194M of Llama2-7B's 6,738M parameters (0.06%) were trained and communicated per round; in FedIT each client trained 17.9M parameters (0.26%).

## Related techniques

- [Multi-Task Tuning](https://launchkudos.com/news/llm-fine-tuning-multi-task-tuning): mixing many tasks in one training run (Part 9)
- [Instruction Tuning](https://launchkudos.com/news/llm-fine-tuning-instruction-tuning): the training objective FedIT runs federated (Part 8)
- [LoRA](https://launchkudos.com/news/llm-fine-tuning-lora) and [QLoRA](https://launchkudos.com/news/llm-fine-tuning-qlora): the adapters that keep federated rounds small
- [DPO](https://launchkudos.com/news/llm-fine-tuning-dpo): the alignment loss OpenFedLLM runs on each client
- [All 15 LLM fine-tuning techniques](https://launchkudos.com/news/llm-fine-tuning-techniques)

## Sources

- McMahan, H. B., Moore, E., Ramage, D., Hampson, S., Agüera y Arcas, B. (2016). [Communication-Efficient Learning of Deep Networks from Decentralized Data](https://arxiv.org/abs/1602.05629). arXiv:1602.05629, v1 Feb. 17, 2016, v4 Jan. 26, 2023; AISTATS 2017. Read Dec. 4, 2026.
- Zhang, J., Vahidian, S., Kuo, M., Li, C., Zhang, R., Yu, T., Zhou, Y., Wang, G., Chen, Y. (2023). [Towards Building the Federated GPT: Federated Instruction Tuning](https://arxiv.org/abs/2305.05644). arXiv:2305.05644, v1 May 9, 2023, v2 Jan. 29, 2024; ICASSP 2024. Read Dec. 4, 2026.
- Ye, R., Wang, W., Chai, J., Li, D., Li, Z., Xu, Y., Du, Y., Wang, Y., Chen, S. (2024). [OpenFedLLM: Training Large Language Models on Decentralized Private Data via Federated Learning](https://arxiv.org/abs/2402.06954). arXiv:2402.06954, Feb. 10, 2024; KDD 2024. Read Dec. 4, 2026.
- Flower. [Framework docs](https://flower.ai/docs/framework/), [FedAvg reference](https://flower.ai/docs/framework/ref-api/flwr.serverapp.strategy.FedAvg.html), [Hugging Face quickstart](https://flower.ai/docs/framework/tutorial-quickstart-huggingface.html), [FlowerTune LLM example](https://flower.ai/docs/examples/flowertune-llm.html), v1.45.x. Checked Dec. 4, 2026.
- NVIDIA. [NVIDIA FLARE: LLM fine-tuning](https://nvflare.readthedocs.io/en/main/programming_guide/llm_fine_tuning.html). Checked Dec. 4, 2026.
- FederatedAI. [FATE-LLM repository](https://github.com/FederatedAI/FATE-LLM). Checked Dec. 4, 2026.
- Hugging Face. [PEFT functional API](https://huggingface.co/docs/peft/package_reference/functional) and [LoRA reference](https://huggingface.co/docs/peft/package_reference/lora), v0.22.0. Checked Dec. 4, 2026.

**Series:** [← Prev: Multi-Task Tuning](https://launchkudos.com/news/llm-fine-tuning-multi-task-tuning) · [All 15 techniques](https://launchkudos.com/news/llm-fine-tuning-techniques) · [Next: RLHF →](https://launchkudos.com/news/llm-fine-tuning-rlhf)
