An Empirical Study on the Fairness of Pre-trained Word Embeddings (2022)

Abstract: Pre-trained word embedding models are easily distributed and applied, as they alleviate users from the effort to train models themselves. With widely distributed models, it is important to ensure that they do not exhibit undesired behaviour, such as biases against population groups. For this purpose, we carry out an empirical study on evaluating the bias of 15 publicly available, pre-trained word embeddings model based on three training algorithms (GloVe, word2vec, and fastText) with regard to four bias metrics (WEAT, SEMBIAS,DIRECT BIAS, and ECT). The choice of word embedding models and bias metrics is motivated by a literature survey over 37 publications which quantified bias on pre-trained word embeddings. Our results indicate that fastText is the least biased model (in 8 out of 12 cases) and small vector lengths lead to a higher bias.

## introduction word embeddings are a powerful tool and are applied in variety of natural language processing tasks, such as text classification @xcite @xcite @xcite and sentiment analysis @xcite @xcite @xcite . however, analogies such as "man is to computer programmer as woman is to homemaker" @xcite contain worrisome biases that are present in society and hence embedded in language. in recent years, numerous studies have attempted to examine the fairness of word embeddings by proposing different bias metrics @xcite @xcite @xcite , and comparing them @xcite . the quality of word embedding models differs depending on the task and training corpus used. due to the relatively expensive costs, constructing large-scale labelled datasets is a huge barrier for nlp applications, notably for syntax and semantically related tasks @xcite . recent research has shown that by using pre-trained word embedding models, trained on a large corpus, considerable performance gains on various nlp tasks can be achieved @xcite . a number of studies @xcite @xcite have published these embeddings learned from large text corpora which are versatile enough to be used in a variety of nlp tasks @xcite . despite their widespread use, many researchers use word embeddings without performing an indepth study on their characteristics; instead, they utilised default settings that come with ready-made word embedding toolkits @xcite . on top of that, these pre-trained models are susceptible to inheriting stereotyped social biases (e.g., ethnicity, gender and religion) from the text corpus they are trained on @xcite @xcite and the researchers building these models @xcite . moreover, word embedding models are sensitive to a number of parameters, including corpus size, seeds for random number generation, vector dimensions, etc. @xcite . according to @xcite changes in parameters, are responsible for the majority of empirical differences between embedding models. as a result, there has been an increasing interest among researchers to investigate the impact of parameters on word embedding model properties (e.g., consistency, stability, variety, and reliability) @xcite @xcite @xcite @xcite . however, much uncertainty still exists about the relation between word embedding parameters and its fairness. with the in-depth investigation of fair-ness, we hope that this research will lead to a more directed and fairness-aware usage of pre-trained word embeddings. therefore, this study investigates the performance of pre-trained word embedding models with respect to multiple bias metrics. furthermore, the impact of each pre-trained word embedding model's vector length on the model's fairness is explored. we investigate 15 different scenarios in total as a combination of model, training corpus, and parameter settings. we make the scripts used to determine the fairness of pre-trained word embedding models publicly available. 1 bias statement. word embeddings are used to group words with similar meanings (i.e., generalise notions from language) @xcite . however, word embedding models are prone to inherit social biases from the corpus they are trained upon. the fundamental concern is that training a system on unbalanced data may lead to people using these systems to develop inaccurate, intrinsic word associations, thus propagating biases (costa-jussà and de jorge, 2020). for example, stereotypes such as man : woman :: computer programmer : homemaker in word2vec trained on news text can be found @xcite . if such an embedding is used in an algorithm as part of its search for prospective programmers, documents with women's names may be wrongly downweighted @xcite . our research helps practitioners to make an informed choice of fair word embedding models, in particular pre-trained models, for their application with regards to intrinsic biases (i.e., gender, race, age). ## background it has been discovered that word embeddings do not only reflect but also have the tendency to amplify the biases present in the data they are trained on @xcite which can lead to the spread of unfavourable stereotypes @xcite . the implicit associations which are a feature of human reasoning are also encoded by embeddings @xcite . using the implicit association test (iat), @xcite reported that people in the united states demonstrated to link african american names with bad connotations more than eu-ropean american names, female names with art related words and male names with math related words. in 2016, @xcite used glove vectors and cosine similarity to recreate iat and discovered that african american names like jamal and tamika showed higher cosine similarity with unpleasant words like abuse and terrible. on the contrary, european american names such as matthew and ann had a greater cosine similarity with pleasant terms such as love and peace. these are an example of representational harm where a system causes harm that is demeaning some social groups @xcite . in the context of word embeddings, it is not only of importance to show that bias exists, but also to determine the degree of bias. for this purpose, bias metrics can be used. bias metrics can be applied either to a single word, a pair of words, or an entire list of words. percent male neighbours (pmn) @xcite is a bias metric that operates on a single word, where one could see the percentage of how many male-gendered words surrounded a target word. for instance, @xcite discovered that using pmn, 16% of the words around nurse are male-gendered words. however, when engineer is the target term, 78% of words surrounding it are male-gendered. moreover, @xcite sought to measure bias by comparing the embeddings of a pair of gender-specific terms to a word embedding. the authors introduced direct bias, in which a connection is calculated between a gender neutral word (e.g., nurse) and an obvious gender pair (e.g., brothersister). they also took into account gender-neutral word connections that are clearly derived from gender (i.e., indirect bias). for instance, female associations with both receptionist and softball may explain why the word receptionist is significantly closer to softball than football. similarly, sembias @xcite also uses word pairs to evaluate the degree of gender bias in a word embedding. sembias identifies the correct analogy of he-she in a word embedding according to four pairs of words: a gender definition word pair (e.g., waiterwaitress), a gender-stereotype word pair (e.g., doctornurse) and two other pairs of words that have similar meanings (e.g., dogcat, cuplid). in addition, word embedding association test (weat) @xcite determines the degree of association between lists of words (target and attribute words), to automatically assess biases emerging from word embeddings. a target word set is a collection of words that represent a specific social group and are used to assess fairness (e.g., muslims, african american, men). while an attribute word set is a set of words denoting traits, characteristics, and other things that can be used to show a bias toward one of the targets (e.g., career vs family). another significant aspect of these metrics is that there is lack of a clear relationship between them @xcite . they function with diverse inputs, resulting in incompatibility between the outputs. as a result, a number of studies began to examine the use of word embedding fairness frameworks, such as embeddings fairness evaluation framework (wefe) @xcite and fair embedding engine (fee) @xcite . ## paper selection the aim of paper selection is to gather published work that refers to word embedding models and metrics used to evaluate the fairness of word embeddings. following that, we choose the most commonly used pre-trained word embedding models and bias metrics to support our experiments. due to the scope and recent emergence of this topic, we conduct a comprehensive literature review according to guidelines by @xcite . the selection starts with searching for the relevant publications and then extracts pertinent information. below, we discuss our search methodology in detail, starting with preliminary search, defining keywords, repository search, followed by selecting relevant papers based on the inclusion criteria and snowballing. ## related work there has been a growing interest among researchers to tackle bias in word embeddings, herein we focus on previous work comparing different models and their characteristics. @xcite evaluated embedding space biases caused by four different models and found that glove embeddings are biased according to all 10 weat tests, while fasttext exhibits significant biases only for a subset of tests. this finding broadly supports our finding where all smallest weat scores belong to glove pretrained embeddings. however, their focus is different from our as their approach aims at understanding the consistency of the bias effects across languages, corpora, and embedding models. @xcite compared the stability of the fairness results to those of the word embedding models used: fasttext, glove, and word2vec, all of which were trained on wikipedia. among the three models, they discovered that fasttext is the best stable word embedding model which results in the highest stability for its weat results. @xcite implemented their proposed fairness framework, wefe, by conducting case study where six publicly available pre-trained word embedding models are compared with respect to four bias metrics (e.g., weat, weat-es, rnd, rnsb). consistent with our finding, they discovered that fasttext rank first in weat. @xcite proposed a general debiasing framework debiasing embeddings implicitly and explicitly (debie). they used two bias metrics: weat test 8 and ect to compare the bias of cbow, glove, and fasttext trained in wikipedia. they observed that fasttext is more biased than glove in both metrics. while this contradicts our observations, their study did not utilise pre-trained models but manually trained them on the same corpus. @xcite demonstrated the viability of their modified weat metric on three classes of biases (religion, gender and race) in three different publicly available word embeddings with vector length of 300: fasttext, glove and word2vec. their findings yielded that before debiasing, fasttext has the least religion and race bias, while word2vec has the least gender bias. however, one of the study's discoveries opposes our findings where word2vec does not have the least gender bias. this difference may occur given the fact that the authors collected word sets from a number of different literature. furthermore, previous work considers the impact of word embedding vector length on the performance and the relation to fairness. @xcite looked at how the length of the vectors used in training fasttext, glove, and word2vec affected their stability. the models' stability improves as the vector dimensions grow larger. on the other hand, @xcite found that word embeddings with smaller vectors are better at grouping similar words. this generalisation means that word embeddings with shorter vector lengths have a higher tendency to be biased. the results of our empirical study, obtained using more data and metrics, corroborate the above findings. much of the previous research has focused on proposing and evaluating debiasing techniques, modified metrics and fairness frameworks. therefore, our study makes a major contribution to the research on fairness of word embeddings by empirically comparing the degree of bias of the most popular and easily accessible pre-trained word embeddings according to a variety of popular bias metrics, as well as the impact of vector length involved in the training process to its fairness. ## conclusion the purpose of this study was to empirically assess the degree of fairness exhibited by different publicly available pre-trained word embeddings based on different bias metrics. to this end, we first analysed what are the most used pre-trained word embeddings and bias metrics by conducting a comprehensive literature survey. the results pointed out that the majority of the papers used three word embedding models (namely glove, word2vec, and fasttext) and four bias metrics (namely weat, sembias, direct bias, and ect). our results revealed that the most fair of the three pre-trained word embedding models evaluated is fasttext. we also found that while using pre-trained embeddings, the influence of vector length on fairness must be carefully considered. the scope of this study was limited in terms of selecting word list used to apply bias metrics to the word embeddings. we closely examined the earlier studies that may have influenced bias scores. in the future, we need a deeper analysis and explanation of the numerous fairness tendencies discovered in this study, such as the correlation with explicit gender gaps and survey data @xcite , and the extent to which the embeddings reproduce bias @xcite . moreover, the study could be replicated by not only using pre-trained word embeddings models, but manually training models with different parameters on an identical text corpus. further study could also be conducted to explore the fairness of contextual word embeddings (e.g., elmo, bert), the application bias in word embeddings @xcite , and bias in word embedding in languages with grammatical gender @xcite .