Measuring Gender Bias in W est S lavic Language Models (2023)

Abstract: Pre-trained language models have been known to perpetuate biases from the underlying datasets to downstream tasks. However, these findings are predominantly based on monolingual language models for English, whereas there are few investigative studies of biases encoded in language models for languages beyond English. In this paper, we fill this gap by analysing gender bias in West Slavic language models. We introduce the first template-based dataset in Czech, Polish, and Slovak for measuring gender bias towards male, female and non-binary subjects. We complete the sentences using both mono- and multilingual language models and assess their suitability for the masked language modelling objective. Next, we measure gender bias encoded in West Slavic language models by quantifying the toxicity and genderness of the generated words. We find that these language models produce hurtful completions that depend on the subject’s gender. Perhaps surprisingly, Czech, Slovak, and Polish language models produce more hurtful completions with men as subjects, which, upon inspection, we find is due to completions being related to violence, death, and sickness.

## introduction the societal impact of large pre-trained language models including the nature of biases they encode remains unclear @xcite . prior research has shown that language models perpetuate biases, gender bias in particular, from the training corpora to downstream tasks @xcite . however, @xcite and @xcite identify two issues within the gender bias landscape as a whole. firstly, most of the research focuses on highresource languages such as english, chinese and spanish. limited research exists in further languages. french, portuguese, italian, and romanian @xcite have received some attention, as have danish, swedish, and norwegian language models @xcite . research into slavic languages has been limited to covering gender bias in slovenian and croatian word embeddings @xcite . to the best of our knowledge, we present the first work on gender bias in west slavic language models. due to the nature of west slavic languages as gendered languages, results from prior work on non-gendered languages might not apply, which deems it as a relevant research direction. secondly, most of the gender-related research focuses on gender as a binary variable @xcite . while we recognise that including the full gender spectrum might be challenging, moving away from binary to include neutral language and non-binary language is strongly desirable @xcite . this work addresses both of these limitations. we focus on west slavic languages, i.e., czech, slovak and polish, with the intention of answering the following research questions: our main contribution is a set of templates with masculine, feminine, neutral and non-binary subjects, which we use to assess gender bias in language models for czech, slovak, and polish. first, we generate sentence completions using mono-and multilingual language models and test their suitability for the masked language modelling objective for west slavic languages. next, we quantify gender bias by measuring the toxicity (honest; @xcite ) and valence, arousal, and dom-inance (vad; mohammad 2018) scores. we find that czech and slovak models are likely to produce completions containing violence, illness and death for male subjects. finally, we do not find substantial differences in valence, arousal, or dominance of completions. ## gender bias in language models gender bias refers to the tendency to make judgments or assumptions based on gender, rather than objective factors or individual merit @xcite . for high-resource languages, there is a respectable amount of research on automatic biases detection and mitigation including investigating stereotypical bias of contextualised word embedding @xcite , amplification of datasetlevel bias by models @xcite , gender bias in the translation of neutral pronouns @xcite , and gender bias mitigation @xcite . @xcite proposed querying the underlying language model as a method for measuring bias in contextualised word embeddings. similarly, @xcite rely on a simple template structure to quantify bias in multilingual language models for 7 languages. @xcite find that english bert reflects the real-world gender bias of typical professions based on gender and are able to fine-tune the model to reduce this bias. additionally, @xcite show that methods effective for english language models are not necessarily effective for other languages, in particular german. recently, @xcite curate template sentences to evaluate biases, including racial and gender ones, while @xcite transform this dataset into french while incorporating culture-specific issues into the templates. subsequently, the specific task of exploring gender bias in lower resource languages was investigated for scandinavian languages @xcite . in this paper, we aim to quantify gender bias in west slavic language models based on the sentence completion task. ## method we investigate three monolingual -czert @xcite , slovakbert @xcite , and polbert @xcite ) -and two multilingual language models -multilingual bert (m-bert; @xcite , and xlm-roberta template gender we measure the internal bias of the selected language models using the template-filling task as the monolingual language models for west slavic languages were pre-trained using the cloze-style masked language model objective. in particular, we directly query the model to generate a word for the masked token in order to then, measure bias in the generated word. we use simple template sentences containing the target word for bias, i.e., a gendered subject such as man, women, or non-binary person. ## experiments and results first, we analyse template completions using both mono-and multilingual language models to evaluate their suitability for use in west slavic languages (rq1). next, we quantify gender bias in language models for west slavic languages based on the toxicity, and valance, arousal, and dominance of the words they generate (rq2). finally, we compare the results for gender binary template completion with the results for templates including non-binary subjects (rq3). ## conclusions in this paper, we present the first study of gender bias in west slavic language models, czert, slovak-bert, and polbert. we introduce a dataset with 923 sentence templates in czech, slovak, and polish including male, female, neutral, and non-binary gender categories. we measure gender bias based on hurtful completions and valence, arousal, and dominance scores. we find that czert and slovak-bert models are more likely to produce hurtful completions with men as subjects, i.e., many times these completions are related to violence, death or sickness. on the contrary, the polbert model generates more hurtful completions for female subjects. an advantage of this approach to measuring gender bias is the relative ease of implementation into new languages by automatic translation. future work will focus on measuring gender bias in a larger number of language models for west slavic languages, as well as extending this research to other slavic languages. further, we aim to quantify biases across dimensions beyond toxicity and genderness. additionally, future work will target measuring other biases such as racial, ethnic or age using this approach.