Practical Takes on Federated Learning with Pretrained Language Models (2023)

Abstract: Real-world applications of language models entail data privacy constraints when learning from diverse data domains. Federated learning with pretrained language models for language tasks has been gaining attention lately but there are definite confounders that warrants a careful study. Specifically, understanding the limits of federated NLP applications through varying the effects of different aspects (such as data heterogeneity, the trade-off between training time and performance, the effect of different data, and client distributions and sensitivity of the shared model to learning local distributions) is necessary to evaluate whether language models indeed learn to generalize by adapting to the different domains. Towards that, we elaborate different hypotheses over the components in federated NLP architectures and study them in detail with relevant experiments over three tasks: Stanford Sentiment Treebank-2, OntoNotes-5.0 and GigaWord. The experiments with different Transformer inductive biases on the variety of tasks provide a glimpse at the understanding of federated learning at NLP tasks. Specifically, the analysis suggests that regularization due to the ensembling effect may be masquerading as domain adaptation of federated learning in NLP with pre-trained language models.

## introduction the success of large pretrained language models @xcite @xcite have demonstrated their applicability in consumer-based natural language processing (nlp) applications @xcite . while there are such massive datasets @xcite , making models trained on these datasets to reflect the data diversity is an important challenge towards building equitable nlp systems. hence, treating the distribution of data over the users as non-iid @xcite @xcite to better emphasize the preferences of users as personalization gets naturally extended to the consumer nlp applications. but, recent studies highlight that pretrained language models (plms) @xcite tend to get their predictions skewed by the frequency effects of tokens in the data distribution @xcite , this is concerning from a privacy and personalization standpoint. @xcite ; @xcite ; @xcite show that neural language models (even the large pretrained architectures) have challenges in adapting to different data distributions on generative and classification tasks alike. federated learning (fl) @xcite has been gaining popularity in machine learning as a practical way to mitigate domain adaptation with the promise of data privacy. fl as a learning paradigm focuses on learning a shared model through training data distributed over several clients. such approaches have only recently begun to focus on nlp applications @xcite . @xcite suggest that the success of federated algorithms can be improved through adapting over the client distribution that improves the generalization performance across the client distributions. however, the opaqueness of the pretraining routine -primarily, quantifying what, and how much of that a language model has learnt from the pretraining corpora @xcite @xcite cast a shadow on evaluating the effectiveness of these architectures in learning from diverse domains. understanding the roles of different inductive biases not limited to the architecture, loss functions and data distribution becomes imperative to carefully look at claims of "domain adaptation" @xcite . the representation of texts guided by syntax and semantic elements makes generalization to non-iid distributions in nlp more challenging if not the same when compared to domains such as computer vision @xcite @xcite . then, it becomes imperative to understand the role of different constituents in the federated learning in nlp setup to take steps in the right direction. in that regard, we investigate four major hypotheses detailing the confounding variables in federated nlp systems: (1) role of pretrained weights in fl's domain adaptation, (2) distribution of clients, (3) data homogeneity, and (4) robustness of personalizing to local distribution. although the primary focus of the paper is to generate discussions along these questions, we support the discussions with relevant experiments on 3 different nlp tasks on 2 large transformer architectures. algorithm 1 fedopt algorithm @xcite input: the performance gap like in @xcite , we compare the performance of federated server, θ s , with θ central over a common unseen set, d test as in equation 1 , ## results following our motivation in §4.1 and questions raised for the confounders to the federated system for nlp tasks in §4.2, we structure the results to our investigation in this section. ## conclusion this work explores pertinent questions that require a closer look at evaluating plms in the federated setting. through empirical observations, we find that in federated learning, where the emphasis is more on personalization while ensuring privacy there could be a risk of pretrained models overlooking the client distributions. we also evaluated the effects of varying the client distributions which suggested that the gap between centralized and federated performance to be reduced when the samples are uniformly distributed over the clients. while that is ideal, the random distribution too does not suffer significant performance loss with pretrained weights. however, the critical aspect of the questions stems from the need to investigate the pretraining routine in identifying the right domain adaptation challenges for pretrained models. the gap being minimized while the personalization taking a toll calls for a deeper inspection to explore the limits of domain adaptation in plms with an appropriate evaluation framework (datasets, and metrics) that controls for the leak in the pretraining corpus.