Double-Hard Debias: Tailoring Word Embeddings for Gender Bias Mitigation (2020)

Abstract: Word embeddings derived from human-generated corpora inherit strong gender bias which can be further amplified by downstream models. Some commonly adopted debiasing approaches, including the seminal Hard Debias algorithm, apply post-processing procedures that project pre-trained word embeddings into a subspace orthogonal to an inferred gender subspace. We discover that semantic-agnostic corpus regularities such as word frequency captured by the word embeddings negatively impact the performance of these algorithms. We propose a simple but effective technique, Double Hard Debias, which purifies the word embeddings against such corpus regularities prior to inferring and removing the gender subspace. Experiments on three bias mitigation benchmarks show that our approach preserves the distributional semantics of the pre-trained word embeddings while reducing gender bias to a significantly larger degree than prior approaches.

## introduction despite widespread use in natural language processing (nlp) tasks, word embeddings have been criticized for inheriting unintended gender bias from training corpora. @xcite highlights that in word2vec embeddings trained on the google news dataset @xcite , "programmer" is more closely associated with "man" and "homemaker" is more closely associated with "woman". such gender bias also propagates to downstream tasks. studies have shown that coreference resolution systems exhibit gender bias in predictions due to the use of biased word embeddings @xcite . given the fact that pre-trained word embeddings have been integrated into a vast number of nlp models, it is important to debias word embeddings to prevent discrimination in nlp systems. to mitigate gender bias, prior work have proposed to remove the gender component from pre-trained word embeddings through postprocessing @xcite , or to compress the gender information into a few dimensions of the embedding space using a modified training scheme @xcite . we focus on post-hoc gender bias mitigation for two reasons: 1) debiasing via a new training approach is more computationally expensive; and 2) pre-trained biased word embeddings have already been extensively adopted in downstream nlp products and post-hoc bias mitigation presumably leads to less changes in the model pipeline since it keeps the core components of the original embeddings. existing post-processing algorithms, including the seminal hard debias @xcite , debias embeddings by removing the component that corresponds to a gender direction as defined by a list of gendered words. while @xcite demonstrates that such methods alleviate gender bias in word analogy tasks, @xcite argue that the effectiveness of these efforts is limited, as the gender bias can still be recovered from the geomrtry of the debiased embeddings. we hypothesize that it is difficult to isolate the gender component of word embeddings in the manner employed by existing post-processing methods. for example, @xcite ; @xcite show that word frequency significantly impact the geometry of word embeddings. consequently, popular words and rare words cluster in different subregions of the embedding space, despite the fact that words in these clusters are not semantically similar. this can degrade the ability of component-based methods for debiasing gender. figure 1 : ∆ of cosine similarities between gender difference vectors before / after adjusting the frequency of word w. when the frequency of w changes, the cosine similarities between the gender difference vector ( -→ v ) for w and other gender difference vectors exhibits a large change. this demonstrates that frequency statistics for w have a strong influence on the the gender direction represented by -→ v . specifically, recall that hard debias seeks to remove the component of the embeddings corresponding to the gender direction. the important assumption made by hard debias is that we can effectively identify and isolate this gender direction. however, we posit that word frequency in the training corpora can twist the gender direction and limit the effectiveness of hard debias. to this end, we propose a novel debiasing algorithm called double-hard debias that builds upon the existing hard debias technique. it consists of two steps. first, we project word embeddings into an intermediate subspace by subtracting component(s) related to word frequency. this mitigates the impact of frequency on the gender direction. then we apply hard debias to these purified embeddings to mitigate gender bias. @xcite showed that typically more than one dominant directions in the embedding space encode frequency features. we test the effect of each dominant direction on the debiasing performance and only remove the one(s) that demonstrated the most impact. we evaluate our proposed debiasing method using a wide range of evaluation techniques. according to both representation level evaluation (weat test @xcite , the neighborhood metric @xcite ) and downstream task evaluation (coreference resolution @xcite ), double-hard debias outperforms all pre-vious debiasing methods. we also evaluate the functionality of debiased embeddings on several benchmark datasets to demonstrate that double-hard debias effectively mitigates gender bias without sacrificing the quality of word embeddings foot_0 . ## motivation current post-hoc debiasing methods attempt to reduce gender bias in word embeddings by subtracting the component associated with gender from them. identifying the gender direction in the word embedding space requires a set of gender word pairs, p, which consists of "she & he", "daughter & son", etc. for every pair, for example "boy & girl", the difference vector of the two embeddings is expected to approximately capture the gender direction: @xcite computes the first principal component of ten such difference vectors and use that to define the gender direction. 2 recent works @xcite show that word frequency in a training corpus can degrade the quality of word embeddings. by carefully removing such frequency features, existing word embeddings can achieve higher performance on several benchmarks after fine-tuning. we hypothesize that such word frequency statistics also interferes with the components of the word embeddings associated with gender. in other words, frequency-based features learned by word embedding algorithms act as harmful noise in the previously proposed debiasing techniques. to verify this, we first retrain glove @xcite embeddings on the one billion english word benchmark @xcite following previous work @xcite . we obtain ten difference vectors for the gendered pairs in p and compute pairwise cosine similarity. this gives a similarity matrix s in which s p i ,p j denotes the cosine similarity between difference vectors -→ v pair i and -→ v pair j . we then select a specific word pair, e.g. "boy" & "girl", and augment the corpus by sampling sentences containing the word "boy" twice. in this way, we produce a new training corpus with altered word frequency statistics for "boy". the context around the token remains the same so that changes to the other components are negligible. we retrain glove with this augmented corpus and get a set of new offset vectors for the gendered pairs p. we also compute a second similarity matrix s where s p i ,p j denotes the cosine similarity between difference vectors -→ v pair i and -→ v pair j . by comparing these two similarity matrices, we analyze the effect of changing word frequency statistics on gender direction. note that the offset vectors are designed for approximating the gender direction, thus we focus on the changes in offset vectors. because statistics were altered for "boy", we focus on the difference vector -→ v boy,girl and make two observations. first, the norm of -→ v boy,girl has a 5.8% relative change while the norms of other difference vectors show much smaller changes. for example, the norm of -→ v man,woman only changes by 1.8%. second, the cosine similarities between -→ v boy,girl and other difference vectors also show more significant change, as highlighted by the red bounding box in figure 1a . as we can see, the frequency change of "boy" leads to deviation of the gender direction captured by -→ v boy,girl . we observe similar phenomenon when we change the frequency of the word "daughter" and present these results in figure 1b . based on these observations, we conclude that word frequency plays an important role in gender debiasing despite being overlooked by previous works. ## method in this section, we first summarize the terminology that will be used throughout the rest of the paper, briefly review the hard debias method, and provide background on the neighborhood evaluation metric. then we introduce our proposed method: double-hard debias. ## experiments in this section, we compare our proposed method with other debiasing algorithms and test the functionality of these debiased embeddings on word analogy and concept categorization task. experimental results demonstrate that our method effectively reduces bias to a larger extent without degrading the quality of word embeddings. ## conclusion we have discovered that simple changes in word frequency statistics can have an undesirable impact on the debiasing methods used to remove gender bias from word embeddings. though word frequency statistics have until now been neglected in previous gender bias reduction work, we propose double-hard debias, which mitigates the negative effects that word frequency features can have on debiasing algorithms. we experiment on several benchmarks and demonstrate that our double-hard debias is more effective on gender bias reduction than other methods while also preserving the quality of word embeddings suitable for the downstream applications and embedding-based word analogy tasks. while we have shown that this method significantly reduces gender bias while preserving quality, we hope that this work encourages further research into debiasing along other dimensions of word embeddings in the future. embeddings top 100 top 500 top 1000 word2vec 100.0 99.3 99.3 hard-word2vec 79.5 74.3 79.8 double-hard word2vec 71.0 52.3 56.7 we also apply double-hard debias on word2vec embeddings @xcite which have been widely used by many nlp applications. as shown in figure 4 , our algorithm is able to identify that the eighth principal component significantly affects the debiasing performance. similarly, we first project away the identified direction u from the original word2vec embeddings and then apply hard debias algorithm. we compare embeddings debiased by our method with the original word2vec embeddings and hard-word2vec embeddings. we further evaluate the debiasing outcome with weat test. similar to experiments on glove em to summarize, experiments on word2vec embeddings also support our conclusion that the proposed double-hard debiasing reduces gender bias to a larger degree while is able to maintain the semantic information in word embeddings.