Abstract
Language models (LMs) like BERT and GPT have revolutionized natural language processing (NLP). However, privacy-sensitive domains, particularly the medical field, face challenges to train LMs due to limited data access and privacy constraints imposed by regulations like the Health Insurance Portability and Accountability Act (HIPAA) and the General Data Protection Regulation (GDPR). Federated learning (FL) offers a decentralized solution that enables collaborative learning while ensuring the preservation of data privacy. In this study, we systematically evaluate FL in medicine across 2 biomedical NLP tasks using 6 LMs encompassing 8 corpora. Our results showed that: 1) FL models consistently outperform LMs trained on individual client's data and sometimes match the model trained with pooled data; 2) With a fixed number of total data, LMs trained using FL with more clients exhibit inferior performance, but pre-trained transformer-based models exhibited greater resilience; 3) LMs trained using FL perform nearly on par with the model trained with pooled data when clients' data are IID distributed while exhibiting visible gaps with non-IID data.
Introduction
The "data silo" problem is the primary hurdle in biomedical NLP. While models like BERT and GPT thrive on massive datasets, medical data is naturally distributed across different hospitals and clinics. Furthermore, medical text suffers from domain shift; a model trained on general-domain corpora like Wikipedia often struggles with the nuances of clinical discharge summaries or specific abbreviations used in oncology.
Centralizing this data for training is often a legal and ethical non-starter. This research investigates whether Federated Learning (FL)—a decentralized training approach where the model travels to the data, rather than the data to the model—is a viable, high-performance alternative for critical tasks like identifying diseases in text (NER) or understanding gene-drug interactions (RE).
Methodology
The researchers conducted a comprehensive "stress test" of FL across several dimensions:
- Algorithms: They compared the industry-standard FedAvg (Federated Averaging) with FedProx, an algorithm designed to handle "non-IID" data where data distribution varies significantly between institutions.
- Architectures: Six different models were tested, ranging from lightweight options like BiLSTM-CRF (20M parameters) to transformer-based heavyweights like BlueBERT (334M parameters).
- Training Schemes: FL was compared against Centralized Learning (the "gold standard" where all data is pooled) and Single-client Training (the status quo where a hospital trains only on its own data).
- Datasets: The study utilized eight diverse biomedical corpora, including five NER tasks (e.g., 2018 n2c2, BC2GM) and three Relation Extraction tasks (e.g., EUADR, GAD).
Experimental Results
The experimental results demonstrate that FL-trained models consistently bridge the gap between isolated single-client training and centralized data pooling.
As shown in the NER results above, FL models (FedAvg) consistently crushed single-client models. For a small clinic with limited data, participating in an FL network provides a massive boost in accuracy (F1-score) without compromising patient privacy. In many scenarios, FedAvg achieved performance nearly identical to centralized learning. For example, on the BC4CHEMD dataset, the gap between FL and centralized training was negligible.
The Relation Extraction results further confirm these findings. Across datasets like EUADR and GAD, the FedAvg approach significantly improved upon single-client performance, demonstrating the generalizability of FL across different biomedical NLP tasks.
Beyond these comparisons, the study benchmarked FL-trained models against state-of-the-art LLMs like GPT-4. Surprisingly, the smaller, FL-trained models (like BioBERT) significantly outperformed GPT-4 on these specific biomedical tasks. Furthermore, FL-trained models were thousands of times faster at inference; while GPT-4 took roughly 0.8 seconds per sentence, the FL-trained GPT-2 model required only $1.58 \times 10^{-2}$ seconds.
Key Insights
- The Resilience of Scale: As a fixed amount of data is split among more clients (increasing fragmentation), performance typically drops. However, larger transformer-based models (like BERT) showed incredible resilience to this fragmentation compared to smaller, traditional models.
- Specialization Beats Brute Force: The superior performance of specialized FL-trained models over general-purpose giants like GPT-4 suggests that for highly specialized domains, a "small" model trained on the right data is more effective than a "giant" model that has mastered nothing.
- The Sensitivity of FedProx: While FedProx is theoretically better for heterogeneous data, it proved extremely sensitive to its hyper-parameter $\mu$. If not tuned perfectly, it can actually perform worse than the simpler FedAvg.
Conclusion
By proving that FL is both feasible and high-performing for BioNLP, this study provides a roadmap for a future where medical AI is built through global collaboration rather than data hoarding. Future work will focus on integrating Differential Privacy (DP) to provide even stronger security guarantees against potential gradient leakage attacks.
Our code is available at: https://github.com/PL97/FedNLP
Summary updated