Legally Enforceable Hate Speech Detection for Public Forums (2023)

Abstract: Hate speech causes widespread and deep-seated societal issues. Proper enforcement of hate speech laws is key for protecting groups of people against harmful and discriminatory language. However, determining what constitutes hate speech is a complex task that is highly open to subjective interpretations. Existing works do not align their systems with enforceable definitions of hate speech, which can make their outputs inconsistent with the goals of regulators. This research introduces a new perspective and task for enforceable hate speech detection centred around legal definitions, and a dataset annotated on violations of eleven possible definitions by legal experts. Given the challenge of identifying clear, legally enforceable instances of hate speech, we augment the dataset with expert-generated samples and an automatically mined challenge set. We experiment with grounding the model decision in these definitions using zero-shot and few-shot prompting. We then report results on several large language models (LLMs). With this task definition, automatic hate speech detection can be more closely aligned to enforceable laws, and hence assist in more rigorous enforcement of legal protections against harmful speech in public forums.

## introduction hate speech is regarded as "a denial of the values of tolerance, inclusion, diversity and the very essence of human rights norms and principles." 2 the internet and public forums are global assets that facilitate interaction between people, but the ease of communication also enables hate speech to travel rapidly and spread on a large scale, causing serious societal and security issues @xcite . to ensure compliance with hate 1 the code for this paper is publicly available at https: //github.com/chufeiluo/legalhatespeech 2 https://www.un.org/en/hate-speech/impact-andprevention/why-tackle-hate-speech figure 1 : a visualization of our proposed method to ground hate speech to specialized legal definitions. a legal professional reads external legal resources and makes a judgement on some hate speech input, then identifies offences according to our definitions and makes a judgement on violations. definitions of hate speech can vary to the point that two datasets are inconsistent with each other @xcite . possibly due to these divergences in hate speech definitions, previous works find that models trained on one dataset often perform poorly when evalu-ated on another @xcite . @xcite note this is due to intersubjectivity in annotated datasets -there is high variability in annotator opinions on highly complex tasks, including hate speech detection. this subjectivity is not specific to computer science; hate speech is a highly debated topic, with definitions varying significantly across regions and organizations @xcite . previous works try to remove these variations with modelling strategies like contrastive learning @xcite or data perspectivism for de-biasing @xcite . however, they define hate speech concepts that have not been explicitly aligned to legal definitions. when models are not trained with awareness of the law, the output is likely irrelevant and not in line with the accepted and enforceable legal definitions under concern. in this work, we introduce a new task formulation grounded in eleven definitions of hate speech curated from criminal law, human rights codes, and hateful conduct policies from public forums. we provide a gold label dataset for violations of these hate speech definitions, annotated by legal experts. statements that could lead to punitive consequences are generally rare, so we augment the positive class with edited samples from our expert annotators, and employ data filtering methods to increase the size. due to the expense of domain expert annotation, instruction-tuned llms are a reasonable candidate for hate speech detection. they have shown promising results on legal tasks with prompting @xcite , and increasingly long context windows allow models to process longer pieces of text @xcite . we report baseline performance using our definitions to prompt the state-of-the-art llms, and we also use parameter-efficient tuning @xcite and self training to improve the performance of smaller llms. additionally, we construct a silver dataset with automatically generated labels. the contributions of our research are summarized as follows: hate speech hate speech has significant societal impact. automatic hate speech detection is essential in regulating large online communities such as social media @xcite . however, there are significant issues with dataset quality @xcite @xcite due to the inherent subjectivity of hate speech @xcite . hate speech is also highly complex, and various works choose to focus on one component. elsherief et al. (2021) target implicit hate speech, and yu et al. (2022) demonstrate that context can often change the degree of hate in a statement. there are several strategies to mitigate intersubjectivity, forming three approximate groups: task definition, model training, and data pre-processing. for task definition, the research introduced in khurana et al. (2022); zufall et al. (2022) is the only work to our knowledge that defines a detailed annotation framework in collaboration with legal experts and social scientists. zufall et al. (2022) propose a framework around the eu's definition of hate speech, which is the minimum standard in europe. modelling strategies like contrastive learning @xcite reduce variance in the embeddings, and few-shot methods reduce requirements for training data @xcite . finally, @xcite propose a data-level de-biasing method to reduce biases between annotators based on their demographics. in contrast, our work attempts to reconcile multiple legal definitions of hate speech within one jurisdiction. prompting prompting has shown great success in zero-shot and few-shot settings @xcite . although there are concerns to the efficacy of prompts @xcite , incorporating natural language instructions in the input text is a common strategy to improve zero-shot performance @xcite . @xcite show llms can obtain reasonable performance based on task definitions for specialized tasks in law. with the emergence of instruction-tuned language models trained on human feedback, large language models have seen emergent capabilities in zeroshot settings with instruction prompting @xcite . however, there is a distinction between a model's ability to understand language and reason @xcite . early studies show that large language models are still insufficient on many high-stakes tasks @xcite . additionally, the imprecision of natural language outputs often hinders non-generative tasks like classification. hallucinations occur when a model is uncertain of its decision but does not know how to express itself, or does not have proper reasoning for the task @xcite . to this end, many works attempt closer supervision of the model's thought process, including chain-ofthought prompting @xcite and process supervision @xcite . parameter-efficient tuning many previous studies observe that a fine-tuned model performs better than zero-shot or few-shot prompting @xcite . llms like chatgpt @xcite or llama @xcite require significant computational resources to update parameters. this makes parameter-efficient tuning methods highly desirable to increase the efficiency of model training. llms such as llama with 7 billion parameters @xcite , can be tuned on consumer hardware with low-rank adaptation (lora) @xcite . ## enforceable hate speech detection our research aims to detect hate speech statements that violate at least one legally enforceable definition of hate speech, which we call enforceable hate speech. this is illustrated in figure 1 . we utilize eleven definitions of hate speech from three legal sources, which are applicable to language and conduct published on public forums. for legal details, please refer to appendix a.1. each definition is comprised of two components: a description of unacceptable behaviour or conduct, and a list of protected groups under their policy. human rights codes describe a violation as any statement "likely to expose an individual or class of individuals to hatred or contempt," whereas hateful conduct policies protect against content that "targets a protected group." while these are phrased distinctly, the offending behaviours detailed in these policies are very similar to each other, so the primary distinction between most of our definitions is in their protected groups. as illustrated in figure 2 , there are more common protected groups, like race, sex/gender, or caste (family status), and rarer groups like veteran status or serious disease. the criminal code describes more severe offences of promoting genocide or public incitements of hatred that are "likely to lead to a breach in peace." ## conclusion in this work, we introduce a new task formulation for hate speech detection grounded in enforceable legal definitions and release a gold label dataset annotated by legal experts. the strictness of these definitions results in a lower positive rate compared to previous annotated datasets. we augment the data with expert edits and automatic data augmentation. then, we establish baseline performance on the state-of-the-art llms and tune encoder-based models. finally, we tune with our silver data to further improve performance. we observe that llms perform impressively, but closer inspection of their explanations shows they lack reasoning. this work addresses the importance of legally enforceable hate speech, and we urge future work in this area.