Towards Equal Gender Representation in the Annotations of Toxic Language Detection (2021)

Abstract: Classifiers tend to propagate biases present in the data on which they are trained. Hence, it is important to understand how the demographic identities of the annotators of comments affect the fairness of the resulting model. In this paper, we focus on the differences in the ways men and women annotate comments for toxicity, investigating how these differences result in models that amplify the opinions of male annotators. We find that the BERT model associates toxic comments containing offensive words with male annotators, causing the model to predict 67.7% of toxic comments as having been annotated by men. We show that this disparity between gender predictions can be mitigated by removing offensive words and highly toxic comments from the training data. We then apply the learned associations between gender and language to toxic language classifiers, finding that models trained exclusively on female-annotated data perform 1.8% better than those trained solely on male-annotated data, and that training models on data after removing all offensive words reduces bias in the model by 55.5% while increasing the sensitivity by 0.4%.

## introduction toxic language detection has attracted significant research interest in recent years as the volume of toxic user-generated online content has grown with the expansion of the internet and social media networks @xcite . as toxicity is such a subjective measure, its definition can vary significantly between different domains and annotators, leading to many contrasting approaches to toxicity detection such as evaluating the constructiveness of comments @xcite or examining the benefits of taking into account the context of comments @xcite . detecting and appropriately moderating toxic comments has become crucial to online platforms to keep people engaged in healthy conversations rather than letting hateful comments drive people away from discussions. in addition, it has become increasingly important to ensure a user's right to free speech and only remove comments that violate the policies of the platform. human annotators are the most effective way to filter toxic comments. however, they are costly and unscalable to the generated data. as such, toxic language classifiers are trained on datasets composed of comments annotated by humans as an efficient way of detecting toxic language @xcite . one of the main issues with this approach is that any biases held by the pool of annotators are propagated in the classifier, which can lead to nontoxic comments from certain identity groups being mislabelled as toxic, an effect known as false positive bias @xcite . while many papers have acknowledged the potential for bias in their datasets, with some proposing novel ways of measuring this bias @xcite , very little has been done to examine the differences in the ways that distinct groups of annotators perceive comments and investigate how these differences affect the classification results. this paper is motivated by the lack of understanding of the impact of annotator demographics on bias in toxic language detection. we investigate how the annotators' demographics affect the toxicity scores/labels and the trained models. we analyse the chosen corpus by grouping the annotations by the gender of the annotator as it is the most addressed demographic variable in the literature and constitutes the largest groups of data in the corpus. we then tailor the state-of-the-art bert model to the tasks of toxicity and gender classification, using training and test sets built independently using the annotations of different genders to investigate bias. for the gender classification models, we use ex-plainable machine learning methods to analyse the comments in the test set in order to gain further insights into the associations between gender and language made by the model that contribute to the biased classifications towards male annotators. we then explore how modifying the training data of the models based on these learned associations affects the bias present. we examine the role offensive language plays in male and female annotations and investigate the robustness of models trained independently on gender-specific data once offensive language has been removed. the main contributions of this work are: i) revealing the bias of bert-based toxic language detection models towards male annotators, ii) recognising the learned associations between male annotators and offensive language in the model, iii) demonstrating methods to reduce the bias in the model without reducing the sensitivity. ## bias statement in this work, we explore gender bias present in toxic language detection systems due to associations between offensive language and annotator gender amplified by the model. we define gender bias in this context as the disproportionate influence of the opinions of one gender over another in the model's output. we acknowledge that by treating gender as binary in this study, we exclude those who identify as non-binary, which may cause representational harm @xcite . this choice was made due to the scarcity of annotators who identify as non-binary affecting the generalisability of the results. this work demonstrates that toxic comments containing offensive words are associated with male annotators, resulting in female annotators predicted as being male. this leads to toxicity classifiers that are overly reliant on the opinions of annotators perceived to be male in order to make a classification. the resulting systems create representational harm by overlooking the diverse opinions of female annotators, leading to comments that women may consider toxic not being removed. ## related work previous research into gender bias in toxic language detection caused by the demographic makeup of annotators explored superficial differences between male and female annotators, but only reflected on the ethical considerations in-volved rather than thoroughly investigating the differences between annotator groups and attempting to minimise bias in the model. @xcite presented different methods for detecting potential bias by building classifiers trained on comments whose annotators belong to different genders. they reported differences in average toxicity scores and inter-annotator agreement between the groups. similar work by @xcite in the field of racial bias examined toxicity scores given to twitter corpora, where the white annotators in the majority give higher toxicity scores to tweets exhibiting an african american english dialect, demonstrating how annotator opinions can propagate bias throughout the model. some studies focused on gender bias in specific tasks in natural language processing such as coreference resolution. the aim of those studies is to eliminate under-representation bias by applying gender-swapping and name anonymisation to a corpus to balance the use of gender-specific words @xcite . @xcite highlights this technique as an effective way of debiasing models and measuring gender bias in predictions, using the false positive equality distance (fped) and false negative equality distance (fned) metrics @xcite to measure the difference in performance for gender-swapped sentences. another common source of bias is the word embeddings, which can form associations between identity groups and stereotypical terms based on their prevalence in the literature used to train the language model. @xcite demonstrated the presence of gender bias in occupations in the word embeddings of a language model and proposed a system to debias those models by isolating the gender subspace before utilising hard or soft debiasing to remove the gender bias from terms identified as being gender neutral. this was further extended by @xcite to encompass racial bias, transforming the binary classification task of identifying gender-specific and gender neutral terms into a multiclass debiasing problem. related studies into the aggregation of crowdworker annotations highlight that many models are skewed towards the opinions of workers who agree with the majority vote, which can lead to the opinions of other annotators being disregarded even when there is low inter-annotator agreement @xcite . a solution to this, proposed by @xcite and adopted by @xcite , uses disaggregated data and transforms the problem from the binary classification of toxicity to the prediction of the proportion of annotators who would classify a comment as toxic. in practice, the effectiveness of crowdsourcing appears to be mixed for much of the literature, with @xcite noting that expert annotators only agree with the majority opinion of the crowdsourced annotations 87% of the time in the context of evaluating the constructiveness of comments. this verdict is also reached by @xcite , who concludes that workers on the amazon mechanical turk platform exhibit a much worse inter-annotator agreement than the in-house annotators for the task of abuse classification. this highlights the need to thoroughly examine the annotations in corpora before they are applied to a classification task. we note that that the majority of the research into bias in toxic language detection does not reflect on the bias caused by the pool of annotators, and yet research into crowdsourcing demonstrates poor inter-annotator agreement in many corpora and how the results of classification models are skewed by annotator opinions that may not reflect society as a whole. for the few papers that do examine the role of annotators in toxic language detection, no practical suggestions have been made that aim to reduce the identified bias in the implemented model, which is the main contribution of this paper. ## data we use the toxicity corpus foot_0 from the wikipedia detox project @xcite , which contains over 160k comments from english wikipedia annotated with toxicity scores and the demographic information of the annotators, where each comment has been labelled by approximately 10 annotators using the toxicity categories displayed in this corpus has been widely used in recent literature developing deep learning approaches to toxic language detection @xcite and investigating bias, such as @xcite using the comments to propose metrics that evaluate bias based on the identity terms present in the data. as such, this corpus was selected for the comparability of results it provides, in addition to it being the only toxic language cor-pus to provide the genders of the annotators. @xcite demonstrates methods to explore potential bias in this corpus without further investigating the cause of the bias or attempting to reduce bias in the model, finding that male annotators in the corpus have a significantly higher inter-annotator agreement than female annotators, leading to male test data performing better than female test data. @xcite uses this corpus to investigate how the implemented model became skewed towards the scoring of annotators with the majority opinion, favouring the opinion of the largest group for each demographic variable. @xcite then attempts to mitigate this bias by balancing the dataset for each demographic variable, which we discover is not enough to prevent bias is the model due to the learned associations between the demographic variable and the language in the comments. we hypothesise based on previous research that models trained on this corpus will likely value the opinions of male annotators over female annotators. this is due to the fact that male annotators were found to have a greater inter-annotator agreement than female annotators, meaning that they are likely to hold the majority opinion, and so it follows that the model will place a greater importance on the scores of male annotators when deciding the toxicity of a comment. ## discussion toxic language detection is a highly subjective task, with majority opinions and levels of agreement varying within and between demographic groups. we highlight this by analysing the annotations of different genders in the chosen corpus, noting that the number of female annotators is outweighed by the number of male annotators, and that the fe-male annotators are more likely to label a comment as toxic than their male counterparts. this information could be leveraged by moderation systems by taking into account the demographic group the reader of a comment belongs to before determining the toxicity threshold at which a comment is removed from the system. our findings indicate that the bert-based model associates comments that contain offensive words with male annotators, despite the data showing that both male and female annotators label comments containing high numbers of offensive words as toxic. we demonstrate that the most offensive words are attributed to male annotators, which causes the model to output skewed predictions indicating that most comments have been annotated by men despite the training data being balanced between both genders. we note that the male annotators in this corpus display a greater level of inter-annotator agreement than the female annotators which may contribute to the tendency of the model to predict the gender of an annotator as male. this bias indicates that toxicity models trained on this corpus will be more influenced by the opinions of male annotators, as the diversity of views given by the female annotators makes them unlikely to hold the majority opinion, and those who label comments containing offensive words as toxic are perceived to be male by the model. we find that removing the offensive words from the training data produces a model that demonstrates less bias overall than the original model but exhibits the most variation in the results of any of the implemented models. we find that removing the most toxic data in addition to removing the offensive words in the training data produces the model with the least bias, showing that comments containing high numbers of offensive words are far less attributed to male annotators than in the original model. applying the discovered associations between gender and offensive language to models tasked with classifying the toxicity of comments, we find that toxic comments annotated by men are easier to classify than those annotated by women. conversely, we find that models trained exclusively on female-annotated data display a better performance than models trained entirely on male-annotated data. this is in part due to the associations between male annotators and offensive language distracting the model from other aspects of toxic comments. finally, we show that while it is harder to correctly classify toxic data after the removal of offensive words, models trained on this data show a comparable performance to models trained on unmodified data. combining these results with those of the gender predicting models, we see that removing offensive words from the training data of a model is an effective way of reducing the bias towards the opinions of male annotators without compromising the performance of the model on toxic data. we note that this approach does not remove all bias in the model, for example we did not address the male bias present in the model due to the contextual relationships between words found in the training data @xcite . however, this paper provides an insight into the gender associations that can be present in a model and the methods that can be used to investigate and minimise bias in any classification system reliant on annotators. we recommend that the demographics of the annotators be collected and reported as part of labelled datasets. this is particularly relevant in problems which rely on the subjective opinion of the annotator like toxic language detection. ## conclusion in this paper we seek to quantify the gender bias in toxic language detection systems present as a result of differences in the opinions held by distinct demographic groups of annotators in the corpus and aim to minimise this bias without compromising the performance of the model. we identify differences between the annotation styles of men and women in the chosen corpus and determine that this causes a bias towards the opinions of men. we discover associations between the male bias and the use of offensive language in toxic comments, applying this knowledge to a toxic language classifier to demonstrate an effective way to reduce gender bias without compromising the performance of the model. future work on annotator bias should examine other demographic variables present in the pool of annotators such as race, age or level of education and analyse the extent to which certain groups may be excluded or have their opinions overlooked by the model. this could be extended by researching the connection between the demographic identities of annotators and the identities referenced in comments to see where prejudice occurs. those implementing toxic language detection systems would be advised to consider the types of bias present in their model and personalise moderation based on the identities of those authoring or viewing comments.