Generalizable Implicit Hate Speech Detection Using Contrastive Learning (2022)

Abstract: Hate speech detection has gained increasing attention with the growing prevalence of hateful contents. When a text contains an obvious hate word or expression, it is fairly easy to detect it. However, it is challenging to identify implicit hate speech in nuance or context when there are insufficient lexical cues. Recently, there are several attempts to detect implicit hate speech leveraging pre-trained language models such as BERT and HateBERT. Fine-tuning on an implicit hate speech dataset shows satisfactory performance when evaluated on the test set of the dataset used for training. However, we empirically confirm that the performance drops at least 12.5%p in F1 score when tested on the dataset that is different from the one used for training. We tackle this cross-dataset underperforming problem using contrastive learning. Based on our observation of common underlying implications in various forms of hate posts, we propose a novel contrastive learning method, ImpCon, that pulls an implication and its corresponding posts close in representation space. We evaluate the effectiveness of ImpCon by running cross-dataset evaluation on three implicit hate speech benchmarks. The experimental results on cross-dataset show that ImpCon improves at most 9.10% on BERT, and 8.71% on HateBERT.

## introduction warning: this paper contains contents that may be offensive or upsetting. hate speech is "any communication that disparages a target group of people based on some characteristic such as race, color, ethnicity, gender, sexual orientation, nationality, religion, or other characteristic" @xcite . recently, there are several attempts to detect hate speech or abusive text using lexicon-based methods @xcite @xcite or neural-based methods @xcite : "my world orbits around whites as it should . laughable moment though ." label : hate text (input) : "that is part of the white supremacy logic that native people are less than human . we aren't ." label : not hate text (input) : "send them back to the countries they came from" label : hate prior research @xcite incorporates contrastive learning into their fine-tuning process, resulting in better generalization ability in few-shot learning setup. motivated by this, we propose contrastive learning methods to improve the generalization ability of implicit hate detectors on crossdataset. contrastive learning makes positive pairs to be close together and negative pairs to be apart in the representation space @xcite . one of the key issues in contrastive learning is how to choose positive samples. depending on different choices of positive sampling, a model would learn different invariant features @xcite . here, we suggest two positive sampling strategies: 1) leveraging augmented posts as positive samples of given posts (augcon); 2) leveraging implications as positive samples of given hateful posts (impcon). for augcon, we first generate augmented posts which are lexically different but semantically similar with their original posts. impcon leverages implications as positive samples of hateful posts, since it contains concealed meaning of the hateful posts. in addition, a common implication is often shared by a group of hateful posts, as shown in figure 1 . by pulling an implication and its corresponding hateful posts close in representation space, the model can learn common features among a group of hateful posts sharing an implication. we evaluate the generalization ability of models trained using augcon and impcon. we conduct cross-dataset evaluation on three implicit hate ## conclusions we study the cross-dataset underperforming problem in implicit hate speech detection task. empirically, we confirm that the pre-trained language models fine-tuned on an implicit hate speech dataset show relatively low performance on crossdataset evaluation. we suggest leveraging contrastive learning when fine-tuning implicit hate speech detector to improve generalization ability.