Is W ikipedia succeeding in reducing gender bias? Assessing changes in gender bias in W ikipedia using word embeddings (2020)

Abstract: Large text corpora used for creating word embeddings (vectors which represent word meanings) often contain stereotypical gender biases. As a result, such unwanted biases will typically also be present in word embeddings derived from such corpora and downstream applications in the field of natural language processing (NLP). To minimize the effect of gender bias in these settings, more insight is needed when it comes to where and how biases manifest themselves in the text corpora employed. This paper contributes by showing how gender bias in word embeddings from Wikipedia has developed over time. Quantifying the gender bias over time shows that art related words have become more female biased. Family and science words have stereotypical biases towards respectively female and male words. These biases seem to have decreased since 2006, but these changes are not more extreme than those seen in random sets of words. Career related words are more strongly associated with male than with female, this difference has only become smaller in recently written articles. These developments provide additional understanding of what can be done to make Wikipedia more gender neutral and how important time of writing can be when considering biases in word embeddings trained from Wikipedia or from other text corpora.

## introduction word embeddings are vectors that represent the meaning of words and their relation. they are the cornerstone of many nlp techniques. for example, word embeddings can be used to search in documents, to analyze sentiment and to classify documents @xcite @xcite . these embeddings are typically created using unsupervised learning from a large corpus of text @xcite . large corpora of text used for training word embeddings may contain stereotypical biases. word embeddings can then inherit these biases @xcite @xcite . for example, stereotypical words such as 'marriage' can be more strongly associated with female words than male words. in fact, changes in word embedding can be useful for detecting minor changes in the meaning of words at small time scales @xcite . biases in word embeddings may, in turn, have unwanted consequences in applications. @xcite show that when embeddings are used to improve search results, biased embeddings can lead to biased results. as an example, scientific research with male names may be ranked higher if male names have a stronger association with the scientific search words @xcite . another example of a downstream application with unwanted gender bias consequences is machine translation. when translating a sentence from a language with a gender neutral pronoun to english, a sentence about a nurse may be translated with a female pronoun while a sentence with the word engineer may be translated with a male pronoun @xcite . such stereotypical translations can be avoided by using a more gender neutral embedding @xcite . @xcite have already proposed a method for debiasing word embeddings. however, it has been hypothesized that debiasing covers up biases instead of removing them @xcite . stereotypical words remain clustered in the debiased embeddings and thus there is still a risk for algorithmic discrimination @xcite . a more robust debiasing procedure is yet to be proposed. gender bias, as measured in word embeddings trained on books, has been shown to decrease over time up to the year 2000 @xcite . whether the decreasing trend has con-tinued in more recent years has not been tested. if bias has continued to decrease, a straightforward way to obtain less biased word embeddings would be to train word embeddings on more recent corpora of text. to investigate this issue, we will measure gender bias in one of the largest openly available text corpora: wikipedia. @xcite already showed the presence of gender bias in wikipedia. the editors of wikipedia have actively tried to reduce this bias since 2013 @xcite . our research can be used to evaluate the effectiveness of these efforts, and may inspire new strategies to reduce bias further. towards that end, we will answer the question: 'how does gender bias in word embeddings from wikipedia develop over the years 2006-2020?'. contributions: 1. we extend the work of @xcite and @xcite by looking at more recent years and applying their methods to the corpus of wikipedia. ## gender bias in wikipedia in 2011, a big survey on the demographics of wikipedia editors showed that less than 15% of wikipedia editors are female @xcite . this led to further investigations into the impact on content of wikipedia considering different dimensions of gender bias. two important dimensions of gender bias as researched by @xcite are coverage bias and lexical bias. coverage bias means that notable women are not covered as well as notable men. for example, a smaller percentage of notable women have their own wikipedia page or these pages may be less extensive. @xcite looked at three data sets of notable people and found no coverage bias. however, later research by @xcite did show a small glass ceiling effect. google search trends were used to assess the notability of people covered on wikipedia. women on wikipedia were found to be more notable than men on average, which suggests that women have to be more notable to be covered on wikipedia. the efforts of wikipedia editors have mostly focused on this coverage bias, specifically by making lists of missing notable women and creating articles for these women @xcite . in terms of gender associations in word embeddings, this may have caused words that are commonly used in these biographies to have become more female associated. lexical bias relates to the words used on pages written about women and men. @xcite found two significant differences. words related to family and relationships are more present in female articles compared to male articles. an article about a divorced person is 4.4 times more likely to be about a woman. the second difference is a stronger emphasis on gender. articles about women contain more words that are genderspecific, such as 'female' or 'woman'. this can cause biases in the word embeddings. when biographies about women for example contain phrases as 'female scientist', whereas men are referred to as 'scientist', the word scientist would be more closely associated to female, despite there being both male and female scientists. besides this, there has also been research to the development of the gender proportion in the wikipedia biographies. this has been recorded since 2014 and since 2017 this has also been measured by occupation (see figure 1 ) @xcite . the biggest change can be seen for the occupation 'manager', for which the percentage of female biographies increased with more than 5% in the last 3 years. however, this is still below average. the occupation artist has a female percentage far above average with almost 30%. furthermore, the overall fraction of female biographies has increased steadily towards around 18% @xcite . thus matters are improving, but women are generally still less represented in wikipedia. ## word embedding association test as proposed by @xcite , we use the word embedding association test (weat) to quantify gender bias. this test uses four categories that are considered stereotypical towards gender: arts, science, family and career @xcite . these categories have shown significant bias towards male or female words in embeddings from google news corpora @xcite , google books @xcite , as well as a 'common crawl' corpus @xcite . each category c has a set of eight words and there are two sets (m and f ) of target words relating to male and female respectively ( the weat score is computed as follows: the association between a pair of words with vectors v 1 and v 2 is measured by the cosine similarity: let v c denote a word from category c, v m a malespecific word (e.g. "he" or "his") and v f a femalespecific word (e.g. "she" or "her"). first, the gender bias per word is calculated using equation 2. we chose to use weat since it is a popular way to measure bias in word embeddings and it allows us to compare our results to those of @xcite . this test will show whether these words contain differences in association with male and female, but how these differences relate to negative consequences in different applications is not precisely known. the results should be interpreted in this general sense, as it shows the existence of bias, but not how problematic the gender bias is. ## experimental setup all code and the models used for the experiments are made publicly available foot_0 . ## results gender bias scores over time. the gender biases for wikipedia over time are shown in figure 2a for the different word categories. the box plots indicate the distribution of weat scores for random words, which changes little over time and whose mean seems close to zero, indicating that random words are almost unbiased on average. career, arts and family seem to have strong biases since they fall outside the box plots, while biases in science seem milder, as its weat score is comparable to those of random sets of words. figure 2b and the p-values for the slope tests in weat scores of random words. the histograms of the slopes found from random word sets are given in figure 3 . the mean slope is 4.8 • 10 -5 , with a standard deviation of 6.3 • 10 -4 . we conclude that the whole vocabulary of wikipedia has on average not become a lot more male or female biased over time. this is confirmed by the fact that the box plots in figure 2a do not shift over time. the slope for random words has a larger vari-ance when looking at only the new articles. random word sets have a mean slope of 2.3 • 10 -4 with a standard deviation of 1.0 • 10 -3 in the word embeddings from recent articles. this shows that the larger slopes seen in the category words for recent articles might be partly caused by larger changes seen in all word embeddings (see figure 3b ). results of new articles are therefore less reliable, also due to a smaller corpus and less time points. the p-values can be found in effect of number of word2vec iterations. we ran the training procedure of the word embeddings and computed the bias for each word category for one, five, ten and twenty iterations. the results are given in the quality of the word embeddings also changed little after 5 iterations (see deviation within a word category. the means and standard deviations for the categories at three time points are given in ## discussion and future work since societal gender bias is decreasing @xcite , we expected that using text written more recently would result in less gender biased word embeddings. we have shown that stereotypical gender bias in the categories family and science is indeed decreasing, but these changes are not significant in comparison to random word sets. words related to career did not seem to change since 2006. bias in arts has significantly increased, also in comparison to random words. further research, maybe on a longer time period, is necessary to conclude what causes these changes and how significant the changes are. the vast majority of biographies in wikipedia are about men @xcite . this discrepancy has decreased a little since 2017. this is confirmed by the fact that a lot more articles contain words from our male set than from our female set. however, we do not observe that random words are more associated with male words. this could also be seen in the fact that science words are more female associated in 2020, despite less than 15% of the scientists with biographies being female. a possible reason for this is that articles about women contain more gender-specific words @xcite , for example: 'female scientist'. the expected gender goes without saying, whereas the minority gender is explicitly specified @xcite . this causes words to become more female-associated than expected from the ratio of biographies. wikipedia may inform its contributors about this skew in female biographies in the hope that this bias will be reduced. to reduce gender bias in family further, our results suggest that a focus on equal representation in the topics of marriage and children would be most beneficial. it is unclear why the arts category is becoming more and more female biased. when word embeddings are used in downstream tasks such as classification, our research shows it is important to consider the time of retrieval of a corpus. for example, if one wants to have a gender neutral word embedding related to science, one may best use the corpus of 2018. such effects may also occur in other corpora. more research is needed to further understand the quality of word embeddings as measured by performance in downstream tasks and unwanted biases in such tasks. new articles are not gender neutral either. they have similar developments, but more strongly and also significant in comparison to random words. we could not completely determine if new articles are the cause for changes in gender bias, since we did not consider changes in existing articles. little statistics are known relating to gender bias of wikipedia. this makes it difficult to place our results in a wider context. since our work indicates biases are currently increasing further for some categories, current strategies to reduce bias may need to be changed. to further improve the editing strategies of wikipedia, more automated measures of biases may provide necessary insights. compared to the historical embeddings (1800-2000) from the study of @xcite , we find several differences but also agreements. in contrast, we find that art related words are becoming more biased towards female. the bias of family is decreasing in their study as well, however, they find less steep slopes. the decrease they found in the career category was not found as clearly in our results, this may also be due to the shorter time span. it is hard to say where the differences stem from: perhaps due to different societal changes or because of a different platform? one limitation of this research is the fact that no backups of wikipedia were available between 2010 and 2014. moreover, we did not look at what text was written exactly when. this information could provide more insight in the developments of gender bias. the current version of wikipedia still contains text written in 2001, and thus biases in the full corpus of wikipedia may not represent development of societal biases precisely. the analysis on only new articles may give a better estimate in that respect. however, due to the unreliability of using page ids, this still does not give a perfect representation. the weat-score is not a perfect measure of gender bias of its underlying content. one of the problems is interpretability: where do the biases come from? to that end, wikipedia's content should also be looked at in more detail. we tried to make this connection using word counts over all wikipedia pages, but a more elaborate analysis is necessary to complement our analysis. another option is to use the technique of @xcite to find the most bias influencing articles. this will give further clues how to make wikipedia more gender neutral. hamilton et al. @xcite discovered laws of semantic shift by looking at word embeddings over large time spans. these laws could explain some of our observed changes in gender bias. the most relevant law is the law of conformity: frequent words change embedding location more slowly. this might be taken to imply that the arts category, whose words are most used on wikipedia (see figure 4 ), would change bias the least. however, the opposite is the case, as arts has one of the steepest slopes. sadly, we cannot compare our rates of change to those found by hamilton et. al. since we cannot find the raw rates of change per year in their work. this could be used to place changes of weat-scores over time in context. we note, however, that the slopes of the categories are already (crudely) placed in context when they are compared against the slopes of random words. here a further correction could be made with word frequencies to take the law of conformity into account. on the other hand, since our work focuses on a much shorter time scale, we can assume that such changes are negligible, especially for the weat words which are generally frequently used and therefore less likely to have major changes in meaning within 20 years. word embeddings were shown to be surprisingly unstable over restart with different random initialisation @xcite . in that work, stability was defined as the fraction of the 10 nearest neighbours of each word that are the same before and after the restart. thus, this is a measure of local stability. the weat score is determined, however, over larger distances of word embeddings. thus, local instability does not directly imply that weat scores would also be unstable. to mitigate this potential instability, we initialized each model with the same seed. while a more elaborate investigation of the stability of weat to multiple random restarts is out of the scope of this work, we think it is an important point to investigate in order to verify that our results and those of @xcite and @xcite are robust. we considered the four default word sets as provided by the weat test, to allow comparison to @xcite . remarkably, these word sets include two male names: einstein and shakespeare. einstein is on average about 0.04 above the category mean of science, and shakespeare approximately 0.03 above the mean of arts, influencing the category means positively, making them more male-biased. it is expected that the names einstein and shakespeare co-occur more with male words such as 'he' or 'him'. however, this may not be representative of the rest of science or arts words in general, and thus may overestimate male bias in these subjects. we realize that einstein and shakespeare were and still are very influential in the fields of science and arts respectively. however, if our goal is that articles about more important individuals (which might be read by more people) have higher impact on the bias calculation we could weigh articles based on notability @xcite at the embedding learning stage. to further understand the (perhaps unwanted) effects of using these two words, we believe that more research in the choice of words of weat is necessary. ## conclusion in this paper, we used word embeddings to estimate changes in gender bias in wikipedia articles over time. we found evidence that gender bias is decreasing for science and family, while increasing for arts. biases in the male associated category career seems constant. further analysis of these results provides insights that can potentially lead to new practices to reduce gender bias in wikipedia even more in the future.