Sociocultural knowledge is needed for selection of shots in hate speech detection tasks (2024)

Abstract: We introduce HATELEXICON, a lexicon of slurs and targets of hate speech for Brazil, Germany, India and Kenya, to aid model development and interpretability. First, we demonstrate how HATELEXICON can be used to interpret model predictions, showing that models developed to classify extreme speech rely heavily on target group names. Further, we propose a culturally-informed method to aid shot selection for training in low-resource settings. In few-shot learning, shot selection is of paramount importance to model performance and we need to ensure we make the most of available data. We work with HASOC German and Hindi data for training and the Multilingual HateCheck (MHC) benchmark for evaluation. We show that selecting shots based on our lexicon leads to models performing better than models trained on shots sampled randomly. Thus, when given only a few training examples, using HATELEXICON to select shots containing more sociocultural information leads to better few-shot performance. With these two use-cases we show how our HATELEXICON can be used for more effective hate speech detection.

## introduction to curb the spread and dissemination of hate speech online, the research and industry communities have focused on the collection of hate speech data from social media and the development of models to automatically filter out harmful content. while there have been efforts to cover multiple languages @xcite , most work is still conducted for english settings @xcite . concurrently, it has been shown that cross-lingual transfer capabilities of models are limited in this domain @xcite , potentially due to the heavily culture-specific and subjective nature of the data. thus, leveraging high-resource languages to aid performance in low-resource ones is not a reliable option. instead, methods need to be developed to better utilize the available data. towards efforts for more inclusive hate speech research, we are introducing hatelexicon, a lexicon of slurs and target group denotations that can be used as an aid to model training and interpretability. curated in collaboration with members familiar with sociopolitical balances in the examined countries (brazil, germany, india and kenya), hatelexicon aims to bring cultural knowledge to hate speech model development. models often rely on keywords for predictions @xcite . while this can be an effective tactic in developing baselines (e.g., keyword-based models), it can have undesirable effects, such as associating generally innocuous terms with extreme speech; e.g., a negative interpretation of the term 'muslim'. this erroneous association between target group names and hate speech may lead to further marginalization of vulnerable groups, misclassifying text mentioning these terms with hate speech and consequently filtering them out @xcite . further, seemingly innocuous terms have been appropriated by extreme speech peddlers and may not be picked up by models, such as the term 'goldstücke' in german (originally meaning 'gold pieces' and appropriated to refer to refugees in a derogatory manner). models unable to recognize these keywords as hateful in certain contexts will lead to hate speech falling through the cracks. this is especially salient in few-shot settings, where the wide range of targets and slurs might not be adequately captured in annotated datasets. further, it has been shown that model performance fluctuates a lot depending on the selection of training shots @xcite . therefore, we need a better strategy to make the most out of the available data to select shots more conducive to model performance. motivated by the above problems, we propose hatelexicon, a lexicon aiming to (i) aid model interpretability by providing ground-truth labels on common terms and (ii) improve shot selection in low-resource settings by better coverage of key terms such as targets and slurs. to create hatelex-icon, we collaborated with annotators from our examined countries, who provided a list of keywords and marked them as target groups, slurs, neutral words or any combination of these labels. our contributions, in short, are the following: ## related work hate speech detection. nascent efforts to tackle hate speech focused on the curation of generalpurpose, english datasets @xcite , later expanding into more granular annotation @xcite . most work is performed on datasets of thousands of examples, allowing for straightforward finetuning of models. in our work, we focus on low-resource settings where only a few examples are available for training and thus traditional finetuning techniques cannot be applied. recently, work has been conducted to cover a larger range of languages @xcite . in our work, we continue previous efforts into multilingual hate speech detection by proposing a lexicon of terms (pertinent to the domain hate speech) for brazilian portuguese, english, german, hindi and swahili. analysis has taken place both on the model and the dataset level @xcite . further, hate speech datasets have been examined for presence and reproduction of bias @xcite . we continue in this direction by proposing a lexicon that can aid in interpretability and model analysis efforts. previous work has uncovered annotator bias @xcite , with work conducted to propose frameworks of ethical data curation @xcite . to mitigate bias in our work, we are directly working with community-embedded members. @xcite proposed a benchmark for unified evaluation of hate speech detection models in english, subsequently expanded into the multilingual hatecheck (mhc) benchmark for multiple languages @xcite , used in our work. few-shot learning. large language models exhibit zero-and few-shot capabilities (brown et al., @xcite . a challenge with finetuning large language models (and few-shot learning in particular) is inconsistency: the selection of training data greatly affects performance @xcite . since in few-shot learning settings only a few examples are available, any noise in the data can exacerbate training issues @xcite . in our work we propose a lexicon-based approach to shot selection that consistently improves performance. on prompt-based training schick and schütze (2021a); fu et al. (2022); shin et al. (2020); logan iv et al. (2022); zhao and schütze (2021). tunstall et al. (2022) introduced a prompt-free approach to learning from small datasets (set-fit). through the use of sentencebert and its siamese-network training paradigm (reimers and gurevych, 2019), setfit generates pairs of training examples and learns to minimize the distance of training example representations of the same class and, conversely, to maximize the distance for examples from different classes. this process results in a model that can generate strong sentence embeddings, which can be then used to train a classification head on a task. in our work, we use set-fit to train a multilingual sentencebert model on german and hindi. ## methodology to showcase the usefulness of hatelexicon in hate speech model development, we examine two use cases: model interpretability and few-shot model development, showcasing how hatelexi-con can be utilized to improve both processes in the hate speech domain. ## interpretability through a cultural lens 4.1 lime analysis to showcase the usefulness of hatelexicon in hate speech detection model interpretability, we analyze predictions (as reported by the authors) of xtremespeech. as part of their study, @xcite conduct an interpretability analysis of mbert predictions for a three-way classification task to identify the extremity of text (derogatory, exclusionary or dangerous). using lime, they identify the top-10 words contributing the most to mbert's predictions (shown in in brief, the authors conclude that target group names (such as religious groups) and slurs contribute prominently to model predictions. this exercise was performed in close collaboration with the annotators, who had to manually examine the identified top-contributing words. this process requires significant annotator effort and thus does not scale to practical settings. with hatelexicon, we can automate the process, significantly reducing cost and time consumption. we find that in brazil, there are 5 slurs; in germany, 1 slur and 4 targets; in india, 2 slurs and 5 targets and in kenya, 1 slur and 3 targets. it is obvious that the model relies on the presence of slurs to make decisions, since slurs are predominantly used in hateful contexts. the model, though, also relies heavily on target group denotations when making predictions. due to the (naturally) heightened presence of target groups in hate speech training data, models might learn to associate these otherwise innocuous terms with hate ## conclusion in our work, we curate hatelexicon, a lexicon of slurs and targets of hate speech for the countries of brazil, germany, india and kenya, with the goal of improving model development. with our lexicon, we show how models rely on slurs and target group denotations when mak-ing predictions in hate speech tasks. the overreliance on target group names may lead to further marginalization of targets of hate speech, with models flagging as hateful innocuous text containing these terms. with hatelexicon, this erroneous behavior is unveiled and researchers can focus on mitigating this bias. we also demonstrate how hatelexicon can be used for few-shot learning. we evaluate on the german and hindi subsets of the multilingual hatecheck benchmark @xcite and show that selecting training shots with a culturallyinformed process (e.g., our lexicon of slurs and targets) can aid the development of hate speech classifiers. namely, training sets sampled using hatelexicon perform better than training sets sampled at random. more abstractly, we provide evidence that curating sociocultural knowledge bases (e.g., lexicons) is pivotal in developing hate speech detection models. sociocultural information is vital in contextualizing hate speech, and without it we risk developing models detached from the reality and experiences of the most vulnerable. thus, we advocate for a greater focus on bridging the knowledge gap between researchers and affected communities for the development of models better geared towards protecting target groups.