Multilingual H ate C heck: Functional Tests for Multilingual Hate Speech Detection Models (2022)

Abstract: Hate speech detection models are typically evaluated on held-out test sets. However, this risks painting an incomplete and potentially misleading picture of model performance because of increasingly well-documented systematic gaps and biases in hate speech datasets. To enable more targeted diagnostic insights, recent research has thus introduced functional tests for hate speech detection models. However, these tests currently only exist for English-language content, which means that they cannot support the development of more effective models in other languages spoken by billions across the world. To help address this issue, we introduce Multilingual HateCheck (MHC), a suite of functional tests for multilingual hate speech detection models. MHC covers 34 functionalities across ten languages, which is more languages than any other hate speech dataset. To illustrate MHC’s utility, we train and test a high-performing multilingual hate speech detection model, and reveal critical model weaknesses for monolingual and cross-lingual applications.

## introduction hate speech detection models play a key role in online content moderation and also enable scientific analysis and monitoring of online hate. traditionally, models have been evaluated by their performance on held-out test sets. however, this practice risks painting an incomplete and misleading picture of model quality. hate speech datasets are prone to exhibit systematic gaps and biases due to how they are sampled @xcite @xcite and annotated @xcite @xcite . therefore, models may perform deceptively well by learning overly simplistic decision rules rather than encoding a generalisable understanding of the task (e.g. @xcite @xcite . further, aggregate and thus abstract performance metrics such as accuracy and f1 score may obscure more specific model weaknesses @xcite . for these reasons, recent hate speech research has introduced novel test sets and methods that allow for a more targeted evaluation of model functionalities @xcite @xcite . however, these novel test sets, like most hate speech datasets so far, focus on english-language content. a lack of effective evaluation hinders the development of higher-quality hate speech detection models for other languages. as a consequence, billions of non-english speakers across the world are given less protection against online hate, and even the largest social media platforms have clear language gaps in their content moderation @xcite . as a step towards closing these language gaps, we introduce multilingual hatecheck (mhc), which extends the english hatecheck functional test suite for hate speech detection models @xcite to ten more languages. functional testing evaluates models on sets of targeted test cases @xcite . @xcite first applied this idea to structured model evaluation in nlp, and @xcite used it to diagnose critical model weaknesses in english hate speech detection models. we create novel functional test suites for arabic, dutch, french, german, hindi, italian, mandarin, polish, portuguese and spanish. 1 to our knowledge, mhc covers more languages than any other hate speech dataset. the functional tests for each language in mhc broadly match those of the original hatecheck, which were selected based on interviews with civil society stakeholders as well as a review of hate speech research. in each language, there are be-tween 25 and 27 tests for different kinds of hate speech (e.g. dehumanisation and threatening language) as well as contrasting non-hate, which may lexically resemble hate speech but is clearly nonhateful (e.g. counter speech). these contrasts make the test suites particularly challenging to models that rely on overly simplistic decision rules and thus enable more accurate evaluation of model functionalities @xcite . for each functional test, native-speaking language experts hand-crafted targeted test cases with clear gold standard labels, using the english cases as a starting point but adapting them to retain realism and cultural compatibility in the target language. we demonstrate mhc's utility as a diagnostic tool by evaluating a multilingual xlm-t model @xcite fine-tuned on a combination of three widely-used hate speech datasets in spanish, italian and portuguese. this model achieves strong performance on the respective held-out test sets. however, testing with mhc reveals that the model is 1) overly sensitive to key words and key phrases, 2) biased in its target coverage and 3) error-prone and inconsistent in cross-lingual transfer, in both zero-and many-shot settings. if this model was used to moderate content, these critical weaknesses could cause serious harm, leaving some users unprotected from hate while others are restricted in their freedom of expression. we hope that by revealing such weaknesses, mhc can play a key role in the development of better multilingual hate speech detection models. 2 definition of hate speech following @xcite , we define hate speech as abuse that is targeted at a protected group or at its members for being a part of that group. protected groups are groups based on age, disability, gender identity, race, national or ethnic origins, religion, sex or sexual orientation, which broadly reflects western legal consensus, particularly the us 1964 civil rights act, the uk's 2010 equality act and the eu's charter of fundamental rights. based on these definitions, we approach hate speech detection as the binary classification of content as either hateful or non-hateful. content warning this article contains examples of hateful and abusive language. all examples are taken from mhc in their original language, to illustrate mhc's composition. 2 we make mhc available on github. ## limitations the limitations of the original hatecheck also apply to mhc. first, mhc diagnoses specific model weaknesses rather than generalisable model strengths, and should be used to complement rather than substitute evaluation on held-out test sets of real-world hate speech. second, mhc does not test functionalities related to context outside of individual documents or modalities other than text. third, mhc only covers a limited set of protected groups and slurs across languages, but can easily be expanded using the provided case templates. the multilingual nature of mhc creates additional considerations. first, comparisons of performance between languages are not strictly like-forlike, because cases in different languages are not literal translations of each other. this limitation is compounded for arabic and mandarin, which have unique functional tests for spelling variations. second, even though mhc includes a diverse set of ten languages, these languages still only make up a fraction of languages spoken across the world. to our knowledge, mhc covers more languages than any other hate speech dataset, but hundreds of other languages remain neglected and should be considered for future expansions of mhc. third, the selection of functional tests in mhc is based on hatecheck, which was informed in part by interviews in an anglo-centric setting. we worked with native-speaking language experts and created additional tests to account for non-latin scripts in arabic and mandarin, but future research may consider additional interviews or other languagespecific steps to inform expansions of mhc. lastly, individual languages, like the ten included in mhc, are not monolithic but vary between speakers, especially across geographic regions and sociodemographic groups. we use widely-spoken dialects for the ten languages in mhc (see §1), but cannot cover all variations. non-english hate speech data english is by far the most common language for hate speech datasets, as recent reviews by @xcite and @xcite confirm. encouragingly, more and more non-english datasets are being created, particularly for shared tasks (e.g. @xcite @xcite @xcite . however, very few datasets cover more than one language @xcite , and to our knowledge no dataset covers as many languages as mhc. ## conclusion in this article, we introduced multilingual hatecheck (mhc), a suite of functional tests for multilingual hate speech detection models. mhc expands the english-language hatecheck @xcite to ten additional languages: arabic, dutch, french, german, hindi, italian, mandarin, polish, portuguese and spanish. to our knowledge, mhc covers more languages than any other hate speech dataset. across the languages, native-speaking language experts created 36,582 test cases, which provide contrasts between hateful and non-hateful content. this makes mhc challenging to hate speech detection models and allows for a more effective evaluation of model quality. we demonstrated mhc's utility as a diagnostic tool by testing a high-performing multilingual transformer model, which was fine-tuned on three widely-used hate speech datasets in three different languages. mhc revealed the model to be 1) overly sensitive to key words and key phrases, 2) biased in its target coverage and 3) error-prone and inconsistent in cross-lingual transfer, in both zeroand many-shot settings. so far, hate speech research has primarily focused on english-language content and thus neglected billions of non-english speakers across the world. we hope that mhc can contribute to closing this language gap and that by diagnosing specific model weaknesses across languages it can support the development of better multilingual hate speech detection models in the future. a. curation rationale the goal of our research was to construct mhc, a multilingual suite of functional tests for hate speech detection models. for this purpose, our team of nativespeaking language experts generated a total of 36,582 short text documents in ten different languages, by hand and by using simple templates for group identifiers and slurs ( §2.3). each document corresponds to one functional test and a binary gold standard label (hateful or non-hateful). b. language variety mhc covers ten languages: arabic, dutch, french, german, hindi, italian, mandarin, polish, portuguese and spanish. c. speaker demographics all test cases across the ten languages in mhc were handcrafted by native-speaking language experts -one per language. all ten had previously worked on hate speech as researchers and/or annotators. six out of ten experts identify as women, the rest as men. four out of ten identify as non-white. d. annotator demographics more than 120 annotators provided annotations on mhc, with at least 12 annotators per language. annotators were recruited on appen, a crowdworking provider. appen gave no demographic information beyond guaranteeing that annotators were native speakers of the languages in which they completed their work. in setting up the annotation task and communicating with annotators, we followed guidance for protecting and monitoring annotator wellbeing provided by @xcite . e. speech situation all test cases were created between november 2021 and january 2022. f. text characteristics the composition of the dataset is described in detail in §2.2 and §2.3 of the article.