Federated LoRA Fine-Tuning
Plato now provides first-class support for parameter-efficient LoRA fine-tuning of HuggingFace causal language models.
Quick start
The reference configuration configs/HuggingFace/fedavg_opt_lora.toml launches a single-round federated run with one client using gradient accumulation to fit facebook/opt-125m on the srivatsavaasista/textgenerator-ds-mini dataset.
uv run python plato.py --config configs/HuggingFace/fedavg_opt_lora.toml
Key configuration points:
data.datasource: LoRAenables the LoRA-aware HuggingFace datasource and lets you setdata.text_field,data.max_length, and dataset splits.algorithm.type: fedavg_loraexchanges only LoRA adapter weights between clients and the server.parameters.loraconfigures rank, target modules, dropout, and related hyperparameters consumed bypeft.trainer.gradient_accumulation_stepskeeps GPU memory usage manageable when fine-tuning larger models.
Customising your run
- Datasets – Change
data.dataset_nameor providedata.dataset_configanddata.text_fieldfor other HuggingFace corpora. - Models – Update
trainer.model_nameto any HuggingFace causal language model. Whenparameters.lorais present the model registry wraps the network with a LoRA adapter automatically. - Optimisers – Tune
parameters.optimizeror swap to an alternative optimiser strategy if needed.
Because the LoRA integration lives inside the standard trainer, you can still combine callbacks, composable strategies, or alternative aggregation rules exactly as with other Plato workloads.