Mitigating Language-Dependent Ethnic Bias in BERT (2021)

Abstract: In this paper, we study ethnic bias and how it varies across languages by analyzing and mitigating ethnic bias in monolingual BERT for English, German, Spanish, Korean, Turkish, and Chinese. To observe and quantify ethnic bias, we develop a novel metric called Categorical Bias score. Then we propose two methods for mitigation; first using a multilingual model, and second using contextual word alignment of two monolingual models. We compare our proposed methods with monolingual BERT and show that these methods effectively alleviate the ethnic bias. Which of the two methods works better depends on the amount of NLP resources available for that language. We additionally experiment with Arabic and Greek to verify that our proposed methods work for a wider variety of languages.

## introduction ethnic (or national) bias, an over-generalized association of an ethnic group to particular, often negative attributes @xcite , is one of the most prevalent social stereotypes. compared to gender and racial bias, ethnic bias tends to depend more on the cultural context @xcite , as anyone could step outside of their ethnic background (e.g., by moving to a different country) and suddenly belong to a minority group. in studying various aspects of large-scale language models (lms), there are many studies on gender and racial bias @xcite @xcite @xcite @xcite @xcite , but there have not been in-depth investigations into ethnic bias. figure 1 : examples of ethnic bias in monolingual bert for english, german, and korean. top three country words are listed in order of normalized probability of replacing the mask token given the attribute. this paper studies ethnic bias in several monolingual versions of bert @xcite . figure 1 depicts examples of ethnic bias in english, german, and korean based on the mask prediction metric @xcite . the different predictions by bert imply that the ethnic bias in these three bert models reflect the historical and social context of the countries in which they are used. for example, the current political climate in germany and the us is hostile toward iraq, and korea was occupied and ruled by japan in recent history, and those negative contexts are reflected as ethnic biases in german (de-1), english (en-1), and korean (ko-1). there are also instances of ethnic bias shared across languages, and we can see an example in en-2, de-2, and ko-2 where somalia and cuba appear within top three in all three languages. in addition to these three, we study three more languages: spanish, turkish, and chinese. to quantify and mitigate ethnic bias, we propose a scoring metric called categorical bias (cb) score and two mitigation methods: 1) using a multilingual model and 2) aligning two monolingual models. we suggest two separate solutions because of the relatively poor performance of the multilingual model on low-resource languages @xcite . the first solution using the multilingual bert model works well for chinese, english, german, and spanish, languages that are resourceabundant. an alternative solution leverages alignment with the english embedding space, and this solution reduces the bias score for korean and turkish, relatively low-resource languages. extensive experiments with six languages (english, german, spanish, korean, turkish, and chinese) demonstrate that our proposed solutions work well for mitigation. we conduct an ablation study to find out what part of the treatment contributes most significantly to bias mitigation. moreover, we demonstrate that the bias mitigation methods do not result in a performance drop for downstream tasks. finally, we validate mitigation technique with two additional languages @xcite . our contributions can be summarized as follows: ## ethnic bias defining ethnic bias and differentiating it from national bias is very difficult, and in the language models that we look at, it is only possible to lump together ethnic bias and national bias. furthermore, it is difficult to work with fine-grained ethnicity (e.g., "navajo nation") which is not well represented in large-scale text corpora used to train lms in various languages, so we limit the scope of our research to coarse-grained ethnic groups. we note that this ambiguous and limited definition of ethnic bias is not ideal, but it is common practice in social science literature @xcite @xcite . we look deeply into ethnic bias because it is prevalent in datasets that consist of everyday language @xcite , and we conjecture that the bias in the datasets results in similar bias in the models trained with those datasets. ## measuring ethnic bias we define ethnic bias in bert as the degree of variance of the probability of a country name given an attribute in a sentence without any relevant clues. for example, given the sentence template "people from [mask] are @xcite ," the probability of various ethnicity words to replace [mask] should follow the prior probabilities of those words and not vary significantly depending on the attribute. ## mitigation as ethnic bias varies across languages, we try to find a general mitigation technique that can be used in various languages. we propose two solutions: multilingual bert (m-bert) and contextual word alignment. ## experiments we employ a template-based approach which assesses the association between pre-defined ethnicities and social positions @xcite . we generate ten semantically equivalent sentence templates, five singular and five plural, and these sentence templates are designed not to contain any clues for inferring the ethnicity. we make a set of thirty ethnicities and seventy social positions such as occupations (e.g., computer programmer, professor) @xcite and legal status (e.g., immigrant, refugee). the templates, ethnicities, and attributes are machine-translated into five languages and revised by professional translators: korean (ko), german (de), chinese (zh), spanish (es) and turkish (tr). if a language has no structural difference in the singular and the plural forms, like chinese, the translated templates may be the same, and in those cases, we exclude one of the redundant templates. we list the templates, ethnicities, and attributes in appendix a. we use various bert models and datasets in the experiments. 4 the baseline models are six monolingual base-uncased bert models uploaded on the transformer library. we verify our mitigation methods with six languages: english, german, spanish, korean, turkish, and chinese. we use xnli @xcite and kornli @xcite )translated version of xnli in korean -as anchor points for the alignment matrix w . the corpora used in fine-tuning varies depending on the languages, and they are listed in appendix b. following the masking strategy in previous work @xcite , we set the maximum sequence length as 128 and the batch size as 16, the learning rate as 1e-4, and use the adam optimizer @xcite . we freeze bert and the alignment matrix w and fine-tune for two epochs when the loss does not drastically drop. as a baseline, we experiment using counterfactual data augmentation (cda) @xcite which balances the targets in others america iraq syria russia saudi america vietnam iraq china iran afghanistan korea iraq iran china japan israel vietnam china germany china russia korea turkey italy others 0 1 en de es ko tr zh afghan spain others afghan england saudi vietnam russia america others vietnam america japan iraq others others 0.09 0.08 0.07 0.07 0.05 0.05 0.05 0.54 0.09 0.08 0.07 0.06 0.05 0.05 0.04 0.56 0.29 0.16 0.10 0.08 0.07 0.06 0.05 0.19 0.31 0.13 0.11 0.10 0.09 0.06 0.06 0.14 0.31 0.08 0.06 0.06 0.05 0.05 0.04 0.35 0.86 0.13 normalized probability a person from [mask] is an enemy. (0.47) (2.20) (4.37) (11.65) (5.33) (27.08) the training data by augmentation. we use onesided cda and replace the ethnicity terms in the training data (e.g., replace "mexico" with "china", "france", "egypt", etc.) so that we balance the number of ethnicity terms in the training data for finetuning. other than cda, we cannot compare with bias mitigation approaches that work in the embedding space because our measurement is based on probability. for downstream tasks, we check the performance of the proposed method with the task of named-entity recognition (ner) of each languages. we generally follow the settings and hyperparameters for fair comparison. more information about corpora, models and fine-tuning is available in appendix b. ## results & discussion in this section, we describe the results and discussion. first, we show the presence of ethnic bias and its variation across monolingual bert models. next, we quantify and inspect the effectiveness of the two mitigation methods using the cb score. we verify the efficacy of alignment with a downstream task and an ablation study and show the effect of mitigation. finally, we see the benefits of mitigation techniques in two additional languages. ## related work our work makes contributions in two major directions: measuring bias for multi-class variables and methods for mitigating bias. how to measure semantic bias in nlp earlier work on measuring bias was based on word embeddings @xcite @xcite . after recognizing gender bias in word embeddings, word embedding association test (weat) @xcite inspired by implicit association test (greenwald et al., 1998) was used as a standard bias measurement on word embeddings. as neural lms such as bert became more prevalent, may et al. (2019) introduced a variant of weat for sen-tence representations. kurita et al. (2019) proposed the use of masked token prediction to estimate the degree of bias which results in more consistent measurement. based on kurita et al. (2019), we propose a technique for measuring multi-class bias, generalization of the log probability bias score. how to mitigate semantic bias in nlp there are several ways to mitigate bias: (1) bias subspace subtraction, (2) data augmentation, (3) adversarial training, and (4) transfer learning. the first branch of methods is biased space subtraction @xcite @xcite @xcite . another way of mitigation is data augmentation @xcite @xcite , for example by using gender swapping on the coreference resolution task @xcite . a third method is re-training with some constraints which can mitigate bias @xcite @xcite , but these come with the difficulty of re-training. transfer learning is another option. liang et al. (2020c) makes use of fine-tuned multilingual lm on english to address its efficacy on chinese as well. zhao et al. (2020) reveals the presence of gender bias and proposes a method to mitigate in multilingual word embeddings using alignment. we propose two bias mitigation methods that are shown to be effective for multiple languages. first is fine-tuning a multilingual lm, and this method works well for high-resource languages. second is aligning a monolingual lm with another monolingual lm that has a lower level of bias, and this works well for relatively low-resource languages. it is important to develop these mitigation approaches that can be applied to a wide variety of languages. ## conclusion & future work in this paper, we study language-dependent ethnic biases in bert. to first quantify ethnic bias, we introduced the category bias (cb) score. we show the language-dependent nature of ethnic bias, and then we proposed two mitigation strategies: multilingual model and contextual word alignment with english, which has the lowest cb score. for resource-rich languages, the multilingual model alone can mitigate the bias, or fine-tuning the multilingual model can effectively decrease the bias. for all languages, the alignment approach reduces bias and is a better solution for low-resource languages. most of the research on bias is limited to english, and our work contributes to studying bias in multiple languages including relatively low-resource languages. our study shows the variation of ethnic bias across languages with the same set of templates and attributes translated into multiple languages. one limitation of our study is that we did not include all languages and all detailed ethnicities. as our study focuses on the language-dependent characteristic of ethnic bias and depends on publicly available monolingual language models, we are unable to employ fine-grained scope of ethnicity which may be under-represented. hence, we leave as future work to use templates, attributes, and ethnic groups that are more suitable for each language such that we can conduct in-depth studies on bias in many languages, especially for low-resource languages.