Neural Machine Translation (NMT) systems exhibit problematic biases, such as stereotypical gender bias in the translation of occupation terms into languages with grammatical gender. In this paper we describe a new source of bias prevalent in NMT systems, relating to translations of sentences containing person names. To correctly translate such sentences, a NMT system needs to estimate the gender of names. We show that leading systems are particularly poor at this task, especially for female given names. This bias is deeper than given name gender: we show that the translation of terms with ambiguous sentiment can also be affected by person names, and the same holds true for proper nouns denoting race. To mitigate these biases we propose a simple but effective data augmentation method based on randomly switching entities during translation, which effectively eliminates the problem without any effect on translation quality. Natural language processing systems are seeing widespread adoption, prompting careful study into cultural biases they exhibit, and methods for bias mitigation. Gender bias is common in automated systems (Park et al., 2018; Borkan et al., 2019; Stanovsky et al., 2019; Saunders and Byrne, 2020), with a leading cause being training corpora that include far more sentences referring to men than to women. A neural machine translation (NMT) system navely trained on such data is more likely to translate text that should be feminine into masculine when translating into a language with grammatical gender. Previously, researchers (Stanovsky et al., 2019; Escud Font and Costa-juss, 2019; Saunders and Byrne, 2020; Stafanovics et al., 2020) have demonstrated that NMT systems can still be biased even when there are explicit gender pronouns in the input sentences. NMT systems are not only biased for gender, and gender bias is not limited to gender pronouns. Other biases include racial biases, professional biases, and individual biases, among others. In this paper, we focus on two kinds of biases of person name translations by NMT systems: gender biases and sentiment biases. As an important category of named entity, person names are particularly sensitive to translation errors since they refer to real-world individuals, and systematic biases may cause serious distress to users, and reputational damage, libel or other legal consequences for vendors. Gender bias in the translation of person names is a natural extension of gender biases in previous work. For instance, (Stanovsky et al., 2019; Escud Font and Costa-juss, 2019; Saunders and Byrne, 2020; Stafanovics et al., 2020) considered whether translation systems can translate keywords such as occupation terms into the correct form when there is explicit gender information in the text. This paper can be seen as replacing this explicit gender information (pronouns) with implicit gender information (person names), to test whether an NMT system can correctly determine the gender of a name. Our results indicate that NMT systems often mistakes female names for males, but the reverse is rarely seen; a situation that may cause widespread offence. Biases pertaining to sentiment of sentences containing person names have been studied in sentiment analysis (Kiritchenko and Mohammad, 2018), where model predictions of sentiment are sensitive to changing the person name. We present a method for detecting sentiment bias in translation based on the translation of sentiment ambiguous words, where the system must choose between a commendatory and derogatory translation ( e.g. , proud can mean either satisfied or arrogant about one's achievements). When the correct translation is not clear from the context, NMT systems use the person name to decide. When this occurs consistently 2576 towards a specific sentiment, this can result in insidious bias against (or towards) individuals (or as we also show, racial groups.) To mitigate the above biases against person names in translation, we propose a data-augmentation method switch-entity' ( SE ), which works by altering training sentences containing named entities by randomly switching the entities for other entities of the same type ( e.g. , with matching gender). This simple strategy normalises the distribution of named entities, such that all names are observed sufficiently many times and in a diverse range of contexts. This ensures gender signals are learned correctly, and also stops the translation system from associating the name with idiosyncracies of the contexts in which is appears, thus mitigating sentiment bias. Modifying the training data carries the risk of degrading sentence quality, and thus degrading accuracy. Although replacing a named entity with another does change sentence meaning, it is unlikely to compromise grammaticality or render the sentence semantically incoherent. Our results show that SE beneficially mitigates gender bias when translating names into gendered languages, which we show leads to more accurate morphological inflection in sentences with female entities. At the same time, it does not sacrifice accuracy: the BLEU score of the SE -trained model is the same as for standard training. We show two new biases for person names in NMT, relating to gender and sentiment. Using constructed templates we show this is a widespread problem affecting state-of-the-art NMT systems. We propose a data augmentation method, switch-entity, to mitigate these biases in training, without the need for extra data. In languages with rich grammatical gender, the gender of people referenced in a sentence will often affect the morphology of the other words in the sentence. For example, [PER] is a Royal Designer translates into German as either Masc. where gender agreement holds between the person (PER) and the determiner, adjective and occupation noun. Accordingly, knowing the gender of Input (English) Translation (German) She is the developer of the company. the person is critical when translating from a language like English, where gender is rarely marked, into a gendered language. Ignoring this issue will affect the quality of outputs, and consistent mistakes can constitute a form of gender bias. Previous works (Stanovsky et al., 2019; Escud Font and Costa-juss, 2019; Saunders and Byrne, 2020; Stafanovics et al., 2020) showed that NMT systems exhibit gender biases, due to a large skew towards male persons in the training data, resulting in NMT systems producing gender agreement mistakes when translating sentences containing a feminine pronoun. A more complex situation arises when presented with person names: gender is not explicitly marked, but is only implied, and the translation system must deduce the gender in order to correctly inflect the translation. 1 Being able to correctly translate sentences with gender pronouns does not guarantee the correct translation of name sentences, as illustrated in the examples in Table 1. 2.1 Template for person name bias Here, we propose an evaluation method for assessing whether gender is translated accurately for English  German and English  French. We created a range of templates encoding various syntactic relations which require gender agreement, and assess whether the translation includes the correct morphological inflection ( e.g. , for the above, the choice between Designer vs. Designerin ). Table 2 shows a selection of the 30 templates we use for measuring the accuracy of gender agreement. Each template includes a person name slot, which we replace with a name from a list of male and female names. 1 Without additional resources, gender deduction will never be perfect. A natural extension would include named entity linking to a knowledge base which stores gender inflection and pronouns for each individual. The main body of the grammatical gender system is the name, and it forms an agreement system with other verbs, articles and adjectives. Words will change to some extent (usually inflectional affixes) according to gender. For example, in German, feminine occupation nouns end with in'. In our test, we check whether the translation includes the correct form of the underlined noun, which should agree with the gender of the person. Strictly speaking, for the translation to be perfect, other words in the translation will also require gender agreement, however for the sake of simplicity we limit our attention to the noun. From visual inspection, when the form of the noun is correctly predicted most often means all tokens have correct gender agreement. To evaluate gender bias with respect to names, we must first account for the confound of bias on key nouns. For example, some en-de models always translate teacher into feminine form Lehrerin, and never the masculine form. Thus for these models a test template for teacher will not help to measure gender bias for names. Thus, we first filter the templates using the pronouns he and she and remove from consideration all templates for the which key noun only has one translation. Then we tested each machine translation system with these filtered templates using a set of 200 full names and 200 first names. Metrics: We measure accuracy, Acc , the proportion of the number of key nouns are translated into the correct form to the total number of templates tested, to evaluate name gender bias. We report the mean accuracy for male and female names separately, denoted Acc m and Acc f , respectively, as well as the absolute difference between these scores, denoted  Acc . Names: Generally speaking, a name may be first name, last name or full name. The last name usually does not carry gender information, so we only tested the first name and full name (full lists of names are in the Appendix, Table 12). For first names, we used a data set of first names and their frequencies from U.S. births. 2 We find the set of names with obvious gender, where the frequency of one gender is more than three times that of the other, and the absolute value of the difference is more than 100. We reduce this list to 100 female and 100 male names by selecting for each gender the top 1000 names by frequency then randomly sampling 100 names uniformly. Full names were extracted from the ParaCrawl corpus, and the U.S. births data set was used to label their gender based on the first name, the names were filtered as above, and finally we randomly selected 100 names each male and female. Note that this process is limited to binary gender, but could feasibly be extended to non-binary gender with the right resources, which we leave to future work. Language and Models: We tested English  German and English  French, chosen based on English not having grammatical gender while German and French both do. In both settings we compare three online translation systems, 3 2 https://courses.cs.duke.edu/ /compsci307d/fall20/assign/01_data/data/ssa_complete/ 3 Namely, Google Translate, Bing Translator and AWS translate. off-the-shelf pretrained research systems, and several custom trained models. Overall the systems cover both transformer and convolutional network architectures, and are trained over different corpora. Please see Appendix A for further details. The test results are shown in Table 3, it can be clearly seen that the NMT system favours male names, with all results far better than for female names, even for the commercial translation systems. The smallest  Acc is as high as 13.7%. However, better performance does not guarantee fewer biases, the BLEU value of custom.wmt18 is higher than transformer.wmt16 , but both first name and full name Acc f are lower. All models perform better on full names than first names, it may be because there are more uncommon names in the first names, and full names will contain more information. conv.wmt17 has a large bias, it barely detects the female names at all. Compared with custom.iwslt17 , which also has a high bias, conv.wmt17 uses much larger corpus and its predictive performance is much higher than cus-tom.iwslt17 . Such a high bias may be caused by the convolutional architecture, which cannot capture word level phenomena as well as the transformer. Comparing two en-fr wmt14 models, the evaluation results of conv model is also worse than transformer model. In general, the larger corpus, denote them as A-C. the less the name bias is present. This is because the larger the amount of data, the model is exposed to more names, and can better distinguish their gender. However, obtaining more data is usually not easy, especial for low-resource language. In NMT training corpora, names appear in different contexts, which can result in sentiment biases for specific names. For instance, a popular celebrity is likely to appear in many more positive sentiment contexts than a reviled mafioso, which may mean a NMT system mistakenly associate person names with translation sentiment. We set about measuring whether this manifests in NMT output using templated ambiguous contexts in English in which the ambiguity must be resolved when translating into the target language. To do so we use sentiment ambiguous words : a kind of homograph which has both commendatory and derogatory meanings. This is illustrated in Table 4, which shows a translation system is biased towards James over Alice. We chose a cross-language family translation of English  Chinese for this experiment, inspired by the work of Si et al. (2019). Si et al. (2019) constructed ambiguous test sentences based on 110 sentiment ambiguous words. Starting with their list, we filtered out words that did not fit with PERSON entities, leaving 30 words. We then constructed a template for each word to test for sentiment bias on names. Table 5 show a selection of the templates (see also Table 11 in the Appendix for the full set). We kept the sentences 2579 Template en sentence Positive / Negative [PERSON] is so proud. simple since we want to eliminate the influence of context, and thereby assess how person names affect the translations of sentiment ambiguous words. We conducted similar evaluation progress as gender agreement test (Section 2.2). The labelled translation words shown in the Table 5 present some examples. Because en-zh translation has high entropy, words can have many different translations and the use of dictionaries often fails to cover all possibilities. Therefore, when using these templates, we manually check the translation results and add any new translations to our inventory of positive and negative words. Metrics We have two evaluation metrics for names' sentiment tendencies: word-level positiveness t and sentence-level positiveness s . The word-level positiveness is evaluated by checking the translations of sentiment ambiguous words, calculating the ratio of the number of sentences that sentiment ambiguous words translated to positive words, to the total number of template sentences. The sentence-level positiveness is scored by a sentiment analysis classifier (Tian et al., 2020), applied to the translation to get the probability the sentence is a positive sentence, 4 after which we report the mean score over the 30 templates for each name. In order to measure the overall degree of sentiment bias of models, we report the highest and lowest mean scores among all person names, as well as the gap between these values, denoted  t and  s for word and sentence level, respectively. 4 To remove potentially confound bias from the sentiment classier, we masked PERSON names, replacing all names with masculine pronouns   [en: he]. For example, when we use sentiment analysis to score translation        , we first convert sentence into        System t min t max  t s min s max  s Online A 0.47 0.67 0.20 0.40 0.49 0.09 Online B 0.40 0.70 0.30 0.38 0.57 0.20 Online C 0.43 0.60 0.17 0.46 0.65 0.09 opus.en-zh 0.23 0.50 0.27 0.23 0.38 0.15 wmt17 0.26 0.67 0.40 0.40 0.67 0.27 Table 6: The sentiment biases test results on five NMT systems. Names For sentiment biases, we used the full names of celebrities, for which we expect sufficient data for NMT systems to learn biases. We selected the top 10 popular male celebrities and 10 female celebrities across 7 different occupations (see list in Table 13 in the Appendix). We expect different professions to have a substantial impact on training contexts, which may result in different degrees of bias. Gender, race and nationality Our templates can be used not only to test names but also to test other sentiment biases, such as gender, race and nationality. We used 8 different races and nationalities to fill the templates, which we minimally adapted to ensure they are grammatically correct. Additionally, we add man or woman ( e.g. , Asian men) to measure intersectional racial and gender bias. Models We tested three commercial systems, as before; and two research models: a pretrained model opus.en-zh and a custom transformer model custom.wmt17 trained with wmt17 en-zh corpus. Overall bias Table 6 shows the results of the sentiment bias test for several en-zh NMT systems. 5 It can be seen that wmt17 has the largest bias, and Online C the smallest, although even this system has a substantial range of sentiment with  t = 0 . 17 . The opus.en-zh trained system is uniformly more negative than the other systems. Biases per profession and gender We further split the results by occupation and gender, as shown in Figure 1 for Online A . From this it is clear that some occupations are more positively translated than others ( e.g. , atheletes vs. actors/actresses) and 5 The BLEU score of opus.en-zh and wmt17 on new-stest2017 is 26.19 and 34.87, respectively. in some professions there appears to be evidence of gender bias, such as preferential treatment of actors over actresses, and female politicians and entrepreneurs over their male counterparts. Overall there is limited evidence for general gender bias, as the average scores for male and female entities are similar, but note that the results for men is more concentrated than for women, which is more polarized. Biases on race and nationality The results for testing race and nationality terms are shown in Figure 2, which overall shows that race and nationality have substantial influence on translation sentiment. Black man and Japanese man have the most negative results, and Asian and Australian the most positive. There is no consistent evidence of gender bias, however it is surprising that there is often a sizeable (mostly positive) difference between using a race or nationality term on its own versus its use alongside a gender term (man/woman). Bias in NMT models are mainly caused by the training data, which is typically unbalanced, e.g. , females are much rarer than males in the training corpus, leading to gender bias. One simple way to balance out gender biases is to add a number of female data to balance the ratio of male to female sentences. However, obtaining new data can be difficult, especially for low-resource languages. Here, we propose a data augmentation method that does not require additional data, SWITCHENTITY . By switching names in the training corpus, the model can train with more correct translation patterns about female names, so that the model can correctly identify the gender of the name, and achieve the effect of reducing biases. This method can be applied not only to PERSON entities, but also to other classes of named entities. Let  x t , y t  be the language pair containing the named entity t and  t x , t y  be the named entity pair. L el be the candidate list of named entities, where e is the entity type and l the language. The replacement candidate list L can be obtained from different resources. Here we present a method to extract L from the original corpus, NER models (at least one side) and alignment tool are required: 1. Use NER to identify named entities on both the source and target sentences; 6 2. Perform automatic word-alignment over the parallel corpus; and 3. Use the alignment to find the corresponding  t x , t y  , which form a named entity pair. To ensure precision in step 3 we adopt a conserva-tive approach: If some aligned tokens of a named entity are parts of a named entity in the other language with the same type, they will be regarded detected as a pair. One further step is performed only on person entities, where this category is further split into male and female classes based on the person's given name, if available. Once the candidate list of entities has been computed, the last step in applying SE involves switching each of the named entities identified above with another named entity during each epoch training, 6 The method also works with NER on one side only, but it may sacrifice precision. which is drawn uniformly from the set of entities of the same type (and gender, when considering persons). To illustrate, in the following we switch out Al Gore for JAY-Z: (1) Candidate Al Gore concedes the US election. Kandidat Al Gore rumt die US-Wahlen ein. (2) Candidate JAY-Z concedes the US election. Kandidat JAY-Z rumt die US-Wahlen ein. In corpora, the distribution of names is usually skewed such that the majority of names have very low frequency, and these names are not well learned by the model. SE has the effect of flattening the distribution over entity strings, while preserving the natural distribution over entity types, ensuring the model focuses more on learning to translate names in the tail. Switching any parts of a training sentence carries the risk of corrupting the data, both grammatically and semantically, and this will depend on the granularity of named entity labels. Switching named entities with others of the same type is key to maintain the sentences' quality. For instance, if we mistakenly switch male and female names, it will corrupt training and may result in gender agreement mistakes in translation. In the example shown above, we cannot switch Al Gore with a female name without changing Kandidat from masculine to feminine gender. For this reason we refine the PERSON entity category to include gender, and only switch like-gender entities. We experimented with SE on the three custom models we mentioned in Section 2, use the same training configuration (see Appendix A for details). Quality of translation First, we test whether SE has an effect on translation accuracy. In terms of BLEU score, Table 7 shows SE has a negligible effect versus a vanilla baseline over both languages. Inspection of the translation outputs (see Table 9 in the Appendix) shows that the translations for the SE and vanilla models are overall very similar, exhibiting changes in case, entity translation and transliteration, as well as morphological inflection. Gender detection Table 7 show that SE has a substantial effect on gender inflection when both translating en  de and en  fr. SE shows marked improvements for females for both IWSLT (+14.4% accuracy) and WMT (+27.3% accuracy), Model BLEU Acc f Acc m IWSLT17 en  de Vanilla 19.8 0 . at the expense of a small drop for males (-2.9% and -3.3%, respectively). Our method goes some way to addressing the significant bias towards males in these NMT systems (especially true of WMT), which reflect the large gender skew in their training corpora. For the two IWSLT tasks, the training corpora are small and the models show substantial gender bias in general, not only pertaining to name gender detection. Therefore, the SE method has a significant effect of mitigating biases for those models (increasing the accuracy of female name gender by between 7 and 25 times for en  fr and en  de, respectively), but despite these improvements the bias remains large. Although SE does not introduce the new female training samples, it does balance the frequency of female names, such that contexts of high-frequency female names are shared with low-frequency female names, thereby better training the NMT model to learn general gender cues. Sentiment bias We also tested SE on sentiment biases, the results show SE can help to mitigate sentiment biases on names, with  t reducing from 0.40 to 0.21. This is because training with SE means PERSON names will have chance to appear in different contexts during training, instead of may only appearing in a specific context like vanilla training, which can help to reduce the model's stereotype of names. We did not attempt to use SE to mitigate race or nationality biases, although in principle this could be possible using the method. Gender bias is a central concern in machine translation research. Stanovsky et al. (2019) introduced the WinoMT challenge data set from the study of coreference gender bias (Zhao et al., 2018; 2582 Rudinger et al., 2018) to test the gender bias of machine translation systems. Researchers tried many different methods to mitigate gender bias. Saunders and Byrne (2020) and Costa-juss and de Jorge (2020) both used transfer learning to reduce gender bias by fine-tuning models with a small gender-balanced data set. Stafanovics et al. (2020) annotated source language sentence with grammatical gender information from target language to reduce the stereotype of gender for translation systems. Escud Font and Costa-juss (2019) used word embedding techniques, debiased the word embedding and then used these embeddings in training translationn models from scratch. All of this work was focused on sentences with gender pronouns, studying whether translation systems can correctly determine the grammatical gender of the words associated with gender pronouns. The gender bias we proposed in this paper is focused on names with implicit gender information. Other social biases and stereotypes have also been investigated. Kiritchenko and Mohammad (2018) evaluated gender and race biases on two hundred sentiment analysis systems, similar to our work, they also tested the influence of names on biases. Davidson et al. (2019) examined racial biases on a hate speech task, finding that tweets written in African-American English are more likely to be marked as offensive than tweets written in Standard American English. Rudinger et al. (2017) used pointwise mutual information to evaluate over the SNLI natural language inference data set, and uncover a wider range of biases, including gender, age, race, and nationality. Shwartz et al. (2020) is the closest to our work, they evaluated the sentiment bias in a language generation model on given names, finding evidence of bias whereby generated sentences related to specific given names being more negative than others. Our mitigation method SWITCHENTITY is based on data augmentation. Similar methods of entity switching have been proposed for named entity recognition (NER), either for data augmentation in training to increase model coverage over named entities (Agarwal et al., 2020); or during testing as a diagnostic tool to model generalization (Dai and Adel, 2020). Wang et al. (2018) proposed more general methods of random lexical substitutions for NMT, which designed to improve translation performance. Song et al. (2019) use data augmentation for name entity translation by replacing source words with their corresponding target translation. In this paper, we revealed two biases in the NMT systems, gender biases and sentiment biases against names. Our results show that the existing research models and commercial translation systems have serious biases, which not only affects translation quality, but also have ethical implications on fairness and bias. In order to mitigate biases, we proposed SWITCHENTITY , a simple training strategy which can reduce name biases without the need for any additional data. We discuss ethical considerations and limitations of our work. First, we focus solely on binary gender, as this can be directly observed in many languages with grammatical gender. Our use of binary gender is not intended to promulgate an inappropriate binary gender focus, but rather allows the study of gender bias in translation, based on the text contained in translation corpora. Admittedly our method has limitations, for instance, it will not be able to adequately handle trans-gendered and non-binary individuals; to do so would require substantial additional translation corpora, as well as extensions to the technique, which we leave for future research. Second, we evaluate only a small number of language pairs, but we expect similar behaviour for translation into many other gendered languages, the exploration of which we leave for future work. We thank the anonymous reviewers for their constructive comments. The authors acknowledge funding support by Meta, and would like to thank Francisco (Paco) Guzmn for fruitful discussions about this work.
abstain objective abstain result result objective abstain abstain abstain abstain abstain abstain method abstain abstain abstain result result abstain method abstain other abstain abstain abstain abstain result abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain method abstain method abstain abstain abstain abstain abstain abstain method abstain abstain abstain abstain abstain abstain method abstain abstain abstain abstain abstain method abstain abstain method other abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain method method abstain method abstain method method abstain abstain abstain method abstain abstain abstain abstain abstain method method method other method abstain abstain method method method method abstain abstain abstain abstain result abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain method abstain abstain abstain method abstain abstain abstain method method method method abstain abstain abstain abstain method method method result abstain abstain abstain abstain abstain abstain result abstain abstain abstain result abstain abstain other other other other other other method objective other method other other abstain abstain other other other result result objective abstain abstain abstain abstain method other other