Unmasking the Mask -- Evaluating Social Biases in Masked Language Models

Masahiro Kaneko, Danushka Bollegala
4/15/2021
93 citations
cs.CL

Official code: kanekomasahiro/evaluate_bias_in_mlm (13 stars, Python, MIT, last commit 2021-12-01).

Abstract

Masked Language Models (MLMs) have shown superior performances in numerous downstream NLP tasks when used as text encoders. Unfortunately, MLMs also demonstrate significantly worrying levels of social biases.

Show full abstract

We show that the previously proposed evaluation metrics for quantifying the social biases in MLMs are problematic due to following reasons: (1) prediction accuracy of the masked tokens itself tend to be low in some MLMs, which raises questions regarding the reliability of the evaluation metrics that use the (pseudo) likelihood of the predicted tokens, and (2) the correlation between the prediction accuracy of the mask and the performance in downstream NLP tasks is not taken into consideration, and (3) high frequency words in the training data are masked more often, introducing noise due to this selection bias in the test cases. To overcome the above-mentioned disfluencies, we propose All Unmasked Likelihood (AUL), a bias evaluation measure that predicts all tokens in a test case given the MLM embedding of the unmasked input. We find that AUL accurately detects different types of biases in MLMs. We also propose AUL with attention weights (AULA) to evaluate tokens based on their importance in a sentence. However, unlike AUL and AULA, previously proposed bias evaluation measures for MLMs systematically overestimate the measured biases, and are heavily influenced by the unmasked tokens in the context.

View on arXivView PDF

Code Implementations(1)

MIT
133PythonApr 3, 20215 years agoMIT

Similar Papers

Cite this paper

@article{kaneko2021unmasking,
  title  = {Unmasking the Mask -- Evaluating Social Biases in Masked Language Models},
  author = {Masahiro Kaneko and Danushka Bollegala},
  year   = {2021},
  eprint = {2104.07496},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2104.07496}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2104.07496.svg)](https://codeofpaper.com/paper/2104.07496)

Discussion