TL;DR
This paper introduces Federated Domain-Adaptive Pre-Training (FDAPT) to adapt large language models to specific domains without sharing sensitive data. They demonstrate FDAPT maintains competitive performance against centralized methods, even with non-IID data, and propose FFDAPT to significantly improve computational efficiency.
What Problem Does This Paper Address?
Foundation Models (FMs) like GPT-4 and LLaMA are incredibly powerful but often need to be adapted to specific domains (e.g., medicine, law) to perform optimally on specialized tasks. This Domain-Adaptive Pre-Training (DAPT) typically requires large amounts of domain-specific data and significant computational resources. Furthermore, this data might be sensitive and cannot be shared centrally. Federated Learning (FL) offers a solution by allowing collaborative training without data sharing, but its application to DAPT (Federated Domain-Adaptive Pre-Training or FDAPT) has been underexplored, with limited empirical studies and a lack of focus on non-IID (non-independent and identically distributed) data scenarios, which are common in real-world FL.
Methods
The core of this work is the empirical investigation and enhancement of FDAPT.
- FDAPT: The authors formalize the process of adapting pre-trained FMs to specific domains using FL. This involves clients training a shared model on their local, domain-specific data using the same pre-training tasks. The FedAvg algorithm is used for model aggregation.
- Non-IIDness Formalization: A key contribution is the formal definition of non-IIDness in the context of federated pre-training. They identify three types:
- Quantity Skew: Imbalance in the number of training data points across clients.
- Sentence Length Distribution Skew: Imbalance in the average sentence length across clients.
- Vocabulary Distribution Skew: Imbalance in the number of unique words (vocabulary size) across clients.
- FFDAPT (Frozen Federated Domain-Adaptive Pre-Training): To address the computational cost of pre-training, they propose FFDAPT. This method freezes a portion of the model's layers during the federated pre-training process. The idea is that freezing layers preserves learned general knowledge while allowing other layers to adapt to the domain, thus reducing computation without significant performance loss.
Datasets
The study utilizes the PubMed dataset for pre-training in the biomedical domain. For evaluation, they use 9 publicly available downstream tasks in the biomedical domain, categorized as:
- 6 Named Entity Recognition (NER) tasks (NCBI Disease, BC5CDR, BC4CHEMD, BC2GM, LINNAEUS, Species-800)
- 2 Relation Extraction (RE) tasks (GAD, EU-ADR)
- 1 Question Answering (QA) task (BioASQ 7b-factoid)
Key Insights and Ideas
- FDAPT is Viable for Non-IID Data: A significant finding is that FDAPT can maintain competitive performance even when client data distributions are skewed (non-IID). This is crucial for real-world FL applications where data is rarely perfectly uniform.
- Minimal Performance Drop: The performance degradation of FDAPT compared to centralized pre-training is consistently small (often less than 1%), making it a practical alternative for privacy-sensitive scenarios.
- Occasional Outperformance: Surprisingly, federated models sometimes outperform centralized baselines, especially on specific tasks and with certain configurations. This suggests that the aggregation process in FL might, in some cases, lead to more robust or generalized models.
- Freezing Layers for Efficiency: The FFDAPT approach demonstrates that freezing a portion of the model layers can significantly speed up training without a substantial hit to downstream task performance. This is a practical step towards making federated domain adaptation more accessible.
- Formalizing Non-IIDness is Important: Defining and simulating non-IID scenarios for pre-training is essential for understanding the true robustness and limitations of FDAPT.
Key Results
- FDAPT Performance: FDAPT achieved competitive downstream task performance compared to centralized pre-training across various IID and non-IID settings. Performance drops were generally less than 1%. In some cases, FDAPT models even outperformed the centralized baseline (e.g., up to 1.1% higher F1 on EU-ADR, up to 2.4% higher strict accuracy on BioASQ 7b). All FDAPT models surpassed the original, non-adapted DistilBERT model.
- FFDAPT Efficiency: FFDAPT improved training efficiency by an average of 12.1%.
- FFDAPT Performance: FFDAPT maintained similar downstream task performance to vanilla FDAPT, with performance fluctuations generally less than 1%. In some specific scenarios, FFDAPT even showed slight improvements (e.g., 0.8% on Species-800, 1.4% on EU-ADR, 1.6% on QA).
Limitations and Future Work
- Real-world Simulations: The authors acknowledge that their experiments were conducted under specific settings. Future work could involve larger-scale simulations with more diverse model backbones and domain datasets, as well as more complex non-IID simulations (e.g., sentence embedding distribution skew).
- Computational and Communication Efficiency: While FFDAPT improves efficiency, further enhancements are possible. This could involve exploring module adapters or communication-efficient algorithms.
- Domain-Related Challenges: The study found FDAPT to be effective in the biomedical domain, contrasting with a previous study that reported FDAPT being worse than centralized pre-training in the clinical domain. Investigating this discrepancy further could reveal specific task characteristics that are harder to federate.
- Other FL Challenges: Future research could also explore how FL can address system heterogeneity, develop specific federated strategies, and integrate advanced privacy-enhancing approaches beyond data privacy.
Summary updated