T o K en: Task Decomposition and Knowledge Infusion for Few-Shot Hate Speech Detection (2022)

Abstract: Hate speech detection is complex; it relies on commonsense reasoning, knowledge of stereotypes, and an understanding of social nuance that differs from one culture to the next. It is also difficult to collect a large-scale hate speech annotated dataset. In this work, we frame this problem as a few-shot learning task, and show significant gains with decomposing the task into its “constituent” parts. In addition, we see that infusing knowledge from reasoning datasets (e.g. ATOMIC2020) improves the performance even further. Moreover, we observe that the trained models generalize to out-of-distribution datasets, showing the superiority of task decomposition and knowledge infusion compared to previously used methods. Concretely, our method outperforms the baseline by 17.83% absolute gain in the 16-shot case.

## introduction disclaimer: due to the nature of this work, some examples contain offensive text and hate speech. this does not reflect authors' values, however our aim is to help detect and prevent the spread of such harmful content. the task of automatically detecting hate speech (hs) is becoming increasingly important given the rapid growth of social media platforms, and the severe social harms associated with the spread of hateful content. however, building good systems for automated hs detection is challenging due to the complex nature of the task. it requires the system to understand social nuance, such as which groups are being targeted by the hateful content. prior work has shown that even humans cannot achieve a high agreement on whether or not a social media post constitutes hs @xcite . in this work, we explore whether decomposing hs detection into subtasks that correspond * equal contribution to the definitional criteria of what constitutes hs (i.e. the offensiveness of a post and whether it targets a group or an individual) @xcite would lead to systems that are more accurate and robust. in particular, we show that task decomposition leads to more sample-efficient systems for hs detection, by showing improved results in the few-shot setting. moreover, we demonstrate that infusing commonsense knowledge by fine-tuning on the atomic 20 20 @xcite and stereoset @xcite datasets improve performance even further. specifically, we observe an absolute improvement of 17.83% in the 16-shot case over the baseline model ( §5.2). further, we show that the resulting models are more robust, and are able to achieve better performance than baseline methods in outof-distribution settings ( §5.3). explainability is an important aspect for being able to identify and fix failure modes of hs systems @xcite . to that end, we show that task decomposition of hs detection moves us a step closer towards explainable systems, allowing us to identify the problematic subtasks that may be the bottleneck for improving overall performance for hs detection. we then show that explicitly targeting to improve the problematic subtask leads to improved overall performance ( §5.1.1). the remainder of the paper is structured along four axes. we first present the importance of (1) task decomposition and (2) knowledge infusion for training better few-shot hs detection models. specifically, we compare our method against a baseline that only outputs a binary prediction for hs. thus showing the significance of decomposing the prediction into several subtasks and prefinetuning the model on two different reasoning datasets that instill in the model a degree of commonsense reasoning and knowledge of stereotypes. we evaluate our experiments across 10 seeds each of which uses a different sampled dataset with sizes ranging from 16 to 1024 samples. our method, token, show significant improvements foot_0 over the baseline. the trained models can also (3) generalize better to three out-of-distribution datasets, and are more (4) robust to training data and hyperparameters. we demonstrate this by measuring the variance across different seeds, data partitions and hyperparameters and show that it is significantly smaller for the token models compared to the baseline. ## few-shot hate speech detection collecting a high quality large-scale dataset for hs is difficult since it is a relatively rare phenomenon, which makes it hard to sample social media posts containing hs without relying on keywords that may be indicative of it @xcite . however, despite being rare, its effects are of significant harm. further, since hs is a complex phenomenon, relying on keywords may result in datasets with low coverage that are not effective in capturing more subtle forms of hs @xcite . this further results in building models that are less generalizable and can exhibit racial biases @xcite . motivated by these, we frame hs detection as a few-shot learning task, where the model is given a limited number of examples to learn what constitutes hs, and explore whether we can build robust hs detection models that can generalize well in cases where we do not have a lot of training data. in particular, we show that our trained token models are more generalizable by measuring the performance on out-of-distribution hs datasets, and are more robust by measuring the variance in performance of hs detection across different randomly sampled few-shot datasets and hyperparameters. to construct few-shot training sets, we perform a stratified sampling of data from the sbic corpus, up to a target size n. we sample n 4 examples containing inoffensive posts, n 4 examples containing offensive, but non-hs posts. the remaining budget of n 2 samples is used for posts containing hs, spread evenly across different targeted groups to ensure diversity. we create datasets of varying sizes from 16 samples up to 1024, ensuring each smaller dataset is a proper subset of the larger datasets. we sample 10 different datasets for each target size n using 10 different random seeds. ## results in this section, we report the mean binary f1-scores on the testing set across 10 different seeds for each dataset size for the hs detection task. specifically, we compare the baseline model, which directly predicts a binary label of whether the post is hs or not, with the token model that employ task de-composition and knowledge infusion as described in the previous section. ## analysis in this section, we explore whether the order of the subtasks matter or not, the scale of the model and if adding an additional subtask that requires the model to generate natural language explanations as to why the post is considered hs helps improve the overall hs performance. the results reported here were done across only 5 seeds. in addition, we show a few examples that the baseline model was not able to capture but the token model got correctly. ## related work social media provides a platform for users to connect with people all over the world and engage in ways that were not previously possible. recent surveys show that 41% of internet users experienced some form of harassment online, with a third of these cases being identity-related (i.e. race, gender, sexual orientation, etc.) @xcite . the sheer scale of content shared on social media platforms makes manual moderation untenable and necessitates automated methods for detecting hateful content @xcite . this has led to an increased interest in automated hate speech detection, both in terms of collecting corpora @xcite as well as improved methods for hate speech detection @xcite . early work in hate speech detection has treated the problem as a binary classification task, requiring annotators to simply indicate whether or not a given post constitutes hate speech @xcite @xcite . however, recent work has shown that eliciting binary judgments for hate speech is unreliable and leads to poor inter-annotator agreement @xcite . this has lead to increased work in collecting hate speech annotation with more complex annotation schemas. @xcite propose a threelevel annotation schema that identifies both the type and target of offensiveness in social media posts. another line of work proposes a hierarchical annotation schema where the task of determining hate speech is broken down into subtasks, in an effort to eliminate some of the subjectivity @xcite . rahman et al. the focus of the limited prior work on few-shot hate speech detection has been to explore zeroshot/few-shot crosslingual transfer from a source language (such as english) with sufficient hate speech data to a target language with limited data @xcite . in contrast, our work explores how task decomposition and knowledge infusion can help even when there is not sufficient hate speech data in english. ## conclusion in this work, we propose token , a method to train language models for detecting hs in the few-shot setting. we show that it significantly outperforms comparable baseline models that predicts the hs label directly instead of decomposing it into its constituent parts. we further show that task decomposition not only improves the performance, but also allows for fine-grained inspection of the model's behavior. since hs is a complex phenomenon that requires a set of reasoning skills not readily available in such pre-trained models, we pre-finetune the bart large on both the atomic 20 20 and stereoset datasets to equip the model with commonsense reasoning and knowledge of stereotypes that we show leads to further improvement in hs detection performance. we show that the token models generalize better to three out-of-distribution datasets in the few-shot setting as well as being significantly more robust to training setups. we further analyze the model's behavior in terms of the order in which the hs labels appears, the scale of the model and the performance when adding an additional subtask that explains the implied stereotype of the post. in future work, we plan on investigating the role of task decomposition, knowledge infusion and the additional subtask of explaining the implication behind the post in large language models as well as explore the token method in low-resource languages, where it is expected to be most beneficial.