Cracking the Code: Enhancing Implicit Hate Speech Detection through Coding Classification (2025)

Abstract: The internet has become a hotspot for hate speech (HS), threatening societal harmony and individual well-being. While automatic detection methods perform well in identifying explicit hate speech (ex-HS), they struggle with more subtle forms, such as implicit hate speech (im-HS). We tackle this problem by introducing a new taxonomy for im-HS detection, defining six encoding strategies named *codetypes*. We present two methods for integrating codetypes into im-HS detection: 1) prompting large language models (LLMs) directly to classify sentences based on generated responses, and 2) using LLMs as encoders with codetypes embedded during the encoding process. Experiments show that the use of codetypes improves im-HS detection in both Chinese and English datasets, validating the effectiveness of our approach across different languages.

## introduction in the current socio-cultural context, the identification of hate speech (hs) has become increasingly important @xcite @xcite . numerous studies highlight the negative impact of toxic language and hs, not only on the directly targeted individuals @xcite @xcite @xcite but also on the society as a whole @xcite @xcite @xcite . hs has the potential to exacerbate divisions and conflicts @xcite , and in extreme cases, can threaten community stability @xcite . metaphor irony pun idiom argot txl是社会问题，应该有人管，而不是当透明人 i go to school in xian, uyghur ultra-leftist male, pink patriotic maggot 本人西安上学维吾尔族极左普信男粉红爱国蛆 人家可是高贵的小仙女，可不能惹捏。 she is a noble little fairy and cannot be messed with. ## related work implicit hate speech taxonomy. within existing datasets, hs divisions are generally conducted from two perspectives: 1) the sentiment conveyed by the text, e.g., @xcite categorized hs into hateful, offensive, provocative, and neutral; 2) the target groups, e.g., @xcite subdivided the targets of hs into 13 categories including black, mexican, physically disabled, lgbtq+, and others. these taxonomies mainly focus on distinguishing between hate and not hate, with very few studies proposed for im-hs. for im-hs, elsherief et al. (2021) classified sentences into seven groups based on social science and nlp literature: grievance, incitement, inferiority, irony, stereotypical, threatening, and other. however, this taxonomy lacks a unified classification criterion, making it unclear how these categories are related, and difficult to apply to other datasets. ## codetype strategy we define codetypes as hate speech encoding strategies for classifying the type of im-hs an instance belongs to. as there is no unanimous conclusion in socio-linguistics regarding the encoding methods for im-hs due to the diversity of coding objects and language forms, we propose a taxonomy of six critical encoding strategies based on our observations of similarities in the expression of emotions and internal rhetoric across different languages. we find these encoding strategies in both chinese and english datasets, which implies the existence of cross-linguistic commonalities. ## implicit hate speech detection with codetypes we show the effectiveness of the proposed codetype taxonomy with llms for im-hs detection in two different ways, as shown in figure 4 : ## experiments we first introduce the datasets and models, and then evaluate the effectiveness of our proposed codetypes on the im-hs detection task. ## conlusions our research introduces a novel strategy for detecting im-hs, proposing a codetype taxonomy that encompasses various strategies encoding implicit hateful intentions. we develop a systematic process to finalize the six codetype categories. additionally, to validate the performance improvements brought by the introduction of codetypes, we propose two methods: prompt-based method and embeddingbased method. the two methods are tested on three models trained on both chinese and english corpora, using different combinations of codetypes to evaluate the effectiveness. in our experimental result analysis, we compare the performance improvements between the two methods and further analyze the strengths and weaknesses of different models, codetype combinations, and embeddingbased methods. experimental results from both chinese and english datasets establish the efficacy of incorporating codetype information into llms, enhancing the effectiveness of im-hs detection.