An Empirical Study of the Downstream Reliability of Pre-Trained Word Embeddings (2020)

Abstract: While pre-trained word embeddings have been shown to improve the performance of downstream tasks, many questions remain regarding their reliability: Do the same pre-trained word embeddings result in the best performance with slight changes to the training data? Do the same pre-trained embeddings perform well with multiple neural network architectures? Do imputation strategies for unknown words impact reliability? In this paper, we introduce two new metrics to understand the downstream reliability of word embeddings. We find that downstream reliability of word embeddings depends on multiple factors, including, the evaluation metric, the handling of out-of-vocabulary words, and whether the embeddings are fine-tuned.

## introduction pre-trained word embeddings have been shown to improve neural networks' performance across a wide variety of tasks. for instance, pretrained word embeddings improve the performance of models for text classification @xcite , relation extraction @xcite , named entity recognition @xcite , and machine translation @xcite . however, neural network performance is unstable when retrained multiple times on the same dataset @xcite . small changes in the training data can result in substantial differences in overall performance. similarly, after retraining word embeddings instead of the model (i.e., to incorporate out-of-vocabulary words or capture changes in their semantic meanings), the instability of the word embeddings themselves, can cause differences in downstream performance @xcite ). yet, retraining is still important. otherwise, performance will deteriorate over time @xcite . in this paper, we evaluate the downstream reliability of pre-trained word embeddings. @xcite discuss how model instability can increase a company's cost of deploying and keeping natural language processing (nlp) pipelines in production. let x and x be two different sets of embeddings, and let g x and g x be two models trained on x and x. @xcite define instability as in many scenarios, it is expected that different sets of embeddings may result in better performance, e.g., training on new domains @xcite . thus, there are many aspects related to the reliability and stability of the nlp pipeline that is neither cost-effective nor efficient and have yet to be studied. for example, instead of slight changes in word embeddings trained on the same source corpora, but collected at different times, what if task t 's training dataset changed? what if the embeddings are the same, and the model g() changes? will the same pre-trained embeddings work if the dataset changes? will the same embeddings work for different models? how will changes in pre-trained embeddings affect downstream fairness? overall, if an nlp engineer does not need to evaluate every model, with every set of pre-trained word embeddings, for every question of interest, both the computational cost of putting models into production and the engineer's time spent evaluating model variations may be reduced. toward addressing the above methodological gaps, this paper presents the following contributions: (1.) we introduce two new metrics to measure the downstream reliability of word embeddings: cross-dataset reliability (cdr) and cross-model reliability (cmr); (2.) using our reliability measures, we provide a comprehensive analysis of the downstream reliability of word embeddings on three offensive language datasets, multiple standard classification and fairness metrics, and multiple neural network architectures; and (3.) we provide an in-depth discussion about our findings, their implications, as well as the limitations of our study. ## related work in this section, we briefly describe the main areas of research in which this paper is based: word embeddings, word embedding instability, and the downstream impact of word embeddings. ## methodology in this paper, we use two definitions of reliability: cross-dataset reliability (cdr) and cross-model reliability (cmr). these definitions differ from the definition of word embedding stability defined by @xcite (as shown in equation 1 ). formally, let @xmath0. f (z, m) ∈ r q is a vector of evaluation metrics (e.g., auc, f1, accuracy, etc.) for model m (e.g., cnn) on dataset z. the scores in f (z, m) are the result of training model m using q different pre-trained word embeddings. therefore, f (z, m) k is the result (e.g., auc) of model m trained on dataset z with pre-trained embeddings k. thus, we define cdr as to improve the robustness of our measurements, each result f (z, m) k is the average of training model m on dataset z ten times using the k-th set of embeddings with different random seeds. ## experiments in this section, we describe the evaluation metrics used in our experiments, and relate the overall performance of the models and imputation strategies to reliability. ## discussion we have two major findings in this paper. first, if we fine-tune word embeddings, then the downstream performance will be erratic between models and datasets. while the difference between a model trained on different embeddings may be smaller with the "impute" strategy for some metrics/datasets, there are still meaningful differences. moreover, the finding that static embeddings are reliable and can match the "impute" strategy scores with certain pre-trained embeddings implies that we may be able to save computation by not fine-tuning the embeddings. also, we may be able to save computation by not evaluating all embeddings on future training iterations with the model. thus, if computational efficiency is essential, and an nlp engineer wants to train a model on recently collected data, they only need to evaluate the best embeddings from their previous study. likewise, if an nlp engineer wants to efficiently test a new model with static embeddings, based on the cmr results, the engineer only needs to evaluate the new model on the embeddings that initially resulted in the best performance. our second major finding for the fped and fned fairness metrics is that the reliability of the downstream fairness of word embeddings is erratic across models, datasets, and embedding imputation strategies. so, if the fped and fned fairness metrics are essential for the downstream task, it is crucial to test every embedding-model combination. however, many industries (e.g., health, government, etc.) that have applications where fairness is mission-critical may not have the resources for large-scale experimentation. therefore, even if these industries rely on human-nlp collaboration, finding efficient and reliable methods of fairness estimation may be helpful, even if the accuracy does not necessarily achieve state-of-the-art performance. while there has been research about reducing the social cost of testing the fairness of text classification models @xcite , all embedding-model combinations still need to be tested in their framework. it is our opinion, that reducing the social and computational cost of testing the fairness of nlp methodologies is an important avenue of future research. one of the major limitations of this study is that we treat gender as a binary concept while evaluating fairness. gender is difficult (impossible) to detect automatically because gender is not a binary classification task. people may identify as binary trans people, non-binary people, or as gender non-conforming people. in this work we do not classify users into gender categories, but we do use a synthetic dataset to estimate binary gender fairness. as future work, we believe it is best to perform controlled experiments where we ask users how they identify, rather than grouping them automatically or using toy synthetic test sets. this approach-of asking rather than predicting-is also suggested for studies about gender in @xcite . finally, it is important to note the similarities and differences of our reliability metrics (cdr and cmr) to domain adaptation. generally, domain adaptation methods attempt to improve the performance of machine learning models on data for a task that does not match the original data distribution @xcite . in this paper, we explore the downstream reliability of word embeddings when applied to datasets that do not match the original data distribution. yet, the downstream performance of word embeddings may be reliable, but not generalize well in terms of overall performance. ideally, future work should explore methods that generalize well and are reliable. ## conclusion in this paper, we develop metrics of downstream reliability of pre-trained word embeddings. specifically, we measure the downstream reliability of word embeddings across datasets and models. our findings conclude that the performance of word embeddings are reliable when they are static, i.e., when they are not fine-tuned. this implies, without fine-tuning, that every publicly available set of word embeddings does not need to be evaluated if an nlp engineer trains on an updated dataset, or tests a different neural network architecture.