B ias W ipe: Mitigating Unintended Bias in Text Classifiers through Model Interpretability (2024)

Abstract: Toxic content detection plays a vital role in addressing the misuse of social media platforms to harm people or groups due to their race, gender or ethnicity. However, due to the nature of the datasets, systems develop an unintended bias due to the over-generalization of the model to the training data. This compromises the fairness of the systems, which can impact certain groups due to their race, gender, etc.Existing methods mitigate bias using data augmentation, adversarial learning, etc., which require re-training and adding extra parameters to the model.In this work, we present a robust and generalizable technique BiasWipe to mitigate unintended bias in language models. BiasWipe utilizes model interpretability using Shapley values, which achieve fairness by pruning the neuron weights responsible for unintended bias. It first identifies the neuron weights responsible for unintended bias and then achieves fairness by pruning them without loss of original performance. It does not require re-training or adding extra parameters to the model. To show the effectiveness of our proposed technique for bias unlearning, we perform extensive experiments for Toxic content detection for BERT, RoBERTa, and GPT models. .

## introduction the rise in popularity of social media platforms has transformed them into new avenues to negatively influence as well as to harass and intimidate others. this kind of conduct appears in content that seeks to harm people or groups due to their race, gender, or ethnicity. there is always a group associated with all the negativity, which is termed as vulnerable/target/protected groups. in its most severe form, hate speech, a form of harmful expression, can contribute to real-world incidents of violence. this conduct frequently undermines the ability of marginalized groups to freely express their opinions and further isolates them. therefore, researchers have explored many techniques to identify such type of hate/toxic contents for their removal. researchers found that systems can develop unintended bias towards these groups due to distribution of the data. @xcite investigated unintended bias in text classifier, which occurs due to the over-generalization of models from training data. this bias is known as false positive bias/lexical bias. nowadays, pre-trained transformer-based models have achieved remarkable success in almost every field of natural language processing (nlp). several studies demonstrated the bias in these pre-trained language models (plms) @xcite and also their societal harms @xcite . there have been attempts to reduce biases in the models via (i). data correction and filtering @xcite and @xcite . debiasing training of the models @xcite . all these techniques add the additional cost of either re-training the system or addition of more components to the model. other lines of work have focused on the interpretability of transformer-based plms. attempts have been made to understand the linguistic information captured by these contextual representations @xcite and different self-attention layers @xcite . in our work, we introduce biaswipe as an innovative approach to mitigate unintended bias within text classification systems. biaswipe operates by unlearning biased features inherent in the model, thereby reducing the impact of bias on its performance and ensuring fairness. biaswipe initiates by pinpointing the neuron weights that contribute to unintended social bias. by isolating these weights, we aim to diminish the influence of social bias on the model's predictions. we achieve this reduc-tion by selectively removing the identified weights responsible for perpetuating bias. to showcase the effectiveness of our proposed approach, we evaluate it on the toxic content detection for an english language dataset consisting of wikipedia comments. we first evaluate the bias in systems trained using bert, roberta and gpt models for toxic content detection. we observed that these models have different biased behaviour towards different demographic entities. after bias identification, we prune a few neuron weights to remove the bias from the model. the ability to avoid retraining models is a major advantage of our proposed technique due to the large computational cost of fine-tuning language models. to the best of our knowledge, this is the first attempt to build a robust and fair system by measuring and reducing social bias utilizing neuron weight pruning without the need of re-training. unlike most bias mitigation strategies that aim to tackle bias by improving the training data distribution, our method stands out for its capability to operate even in situations where access to the training data is limited or unavailable. the main contributions of our current work can be summarized as follows: ## experimental setup all implementations utilize pytorch, a widely used python deep-learning framework. experiments are executed on an nvidia geforce rtx 2080 ti gpu 2 . ## baselines our proposed technique is a post-processing technique. there are no other baselines with similar objectives that employ post-processing bias mitigation techniques in nlp. therefore, we compare our proposed bias mitigation strategy with the following baselines: ## experimental results and analysis this section includes a full explanation of the experimental results. for bert and roberta models, we employ three sequential unlearning steps. in the first step of unlearning (unlearn 1), we utilize false positive samples of the gay entity for unlearning and prune 100 (top k) biased weights. we observe that unlearning bias due to the gay entity significantly reduces bias of the other entities as well. this behavior is illustrated in figures 2 and 3 . similarly, the second (unlearn 2) and third steps (unlearn 3) of unlearning help the model reduce bias due to homosexual and lesbian entities. likewise, the gpt2 model employs two unlearning steps (unlearn 1 and unlearn 2) to address bias stemming from homosexual and gay entities. our proposed technique significantly reduces the fpr for biased entities without significantly compromising performance on the test set, and without additional re-training. keyword fpr 0.00 0.25 0.50 0.75 1.00 lgbtq straight female nonbinary african african black white hispanic latino latina latinx canadian american asian indian middle chinese japanese christian buddhist catholic sikh taoist old older young younger millennial middle elderly paralyzed protestant european teenage bisexual male jewish lgbt blind trans transgender mexican heterosexua muslim lesbian queer deaf gay homosexual gpt unlearn 1 unlearn 2 figure 3: false positive rate for all entities for gpt2 model. there is a significant decrease in fped and fned on the template set. the effectiveness of biaswipe in reducing bias illustrates that our technique can effectively detect neurons weights responsible for bias in the network and can reduce bias by pruning only small fractions of biased weights. we conduct experiments with various weight pruning values to assess their impact on the fairness of the model. figures 4 and 5 illustrate the results for bert and roberta models, respectively, focusing on the third (final) unlearning step. the initial two steps involve debiasing the model for gay and homosexual entities, while the third step targets bias associated with the lesbian entity. our observations reveal that pruning biased ## conclusion we proposed a novel technique biaswipe to enhance the fairness of toxic classification systems. our proposed post-processing technique utilizes model interpretability to mitigate within the model. it effectively detected the neuron weights responsible for unintended bias in the model and pruned them to ensure fairness. our proposed technique mitigated the bias without additional re-training or components. we demonstrated the effectiveness and generalizability of the proposed method for bert, roberta, and gpt models. to illustrate the effectiveness of biaswipe qualitatively, we used model explainability to explain how it helped the model in unlearning bias. in the future, we plan to extend this work to other classification tasks involving other monolingual and code-mixed languages. we believe that our proposed approaches can also be used to reduce the bias of the systems in code-mixed settings.