Legally Enforceable Hate Speech Detection for Public Forums

Chu Fei Luo, Rohan V Bhambhoria, Samuel Dahan, Xiaodan ZhuEMNLP 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

Most automated hate speech detection systems today rely on datasets where "hate" is defined by the subjective feelings of crowdsourced annotators. This approach leads to significant inconsistency between datasets and a lack of alignment with actual legal standards. For a platform or regulator, a system that flags merely "offensive" comments is insufficient if those comments do not meet the legal threshold for intervention.

This research argues for enforceable hate speech detection—systems grounded in criminal codes, human rights acts, and specific platform policies. The challenge lies in the fact that legal definitions are precise and require identifying specific "protected groups" and "prohibited conducts," a task far more complex than simple sentiment analysis.

Methodology

The researchers defined 11 specific legal categories derived from three primary sources: the Canadian Criminal Code (e.g., advocating genocide), Human Rights Codes from various Canadian provinces, and Hateful Conduct Policies (Terms of Service) from five major social media platforms (Twitter, Reddit, YouTube, Meta, TikTok).

Overview of the legally grounded hate speech detection framework.

To build a robust benchmark, ten legal professionals provided "gold standard" labels and reasoning for a dataset of 2,204 samples. Because legal violations are rare in general web text, the team employed "label-flipping," where experts edited neutral posts to become clear legal violations. They also mined a "Challenge Set" of 100,000 Reddit posts to find "hard negatives"—posts that appear toxic but do not technically meet legal definitions of hate speech.

Results and Discussion

The study reveals a significant gap between general toxicity and legal illegality. In the initial expert review of existing "toxic" datasets, only 4.5% of samples actually violated a law, suggesting that current AI systems may be over-flagging content that is offensive but legally protected.

Performance comparison of various LLMs across coarse-grained and fine-grained tasks.

As shown in the performance table, GPT-4 emerged as the clear benchmark, achieving a Macro-F1 of 41.4 on coarse-grained classification. Smaller models like Llama 2-13b and Falcon-7b struggled significantly, often performing near or below random guessing. Furthermore, smaller models exhibited high hallucination rates (14% to 24%) when asked to provide legal reasoning, whereas GPT-4 remained stable with a hallucination rate of only 0.04%.

Despite GPT-4's relative success, a "reasoning gap" remains. Even when correctly classifying a violation, GPT-4’s reasoning only achieved a Jaccard score of 38.4% when matching the specific protected groups identified by legal experts. This indicates that while the model can identify that a post is problematic, it does not yet fully grasp the underlying legal logic.

Conclusion

While LLMs like GPT-4 show promise in aligning with enforceable laws, several hurdles remain. Legal definitions vary globally, and the cost of expert legal annotation makes scaling these datasets difficult. Future work will focus on expanding definitions to other jurisdictions and improving the "chain-of-thought" reasoning capabilities of smaller, more efficient models to ensure they can provide reliable legal justifications for their classifications.

Summary updated

BibTeX
@inproceedings{luo2023legally,
  author = {Chu Fei Luo and Rohan V Bhambhoria and Samuel Dahan and Xiaodan Zhu},
  title = {{Legally Enforceable Hate Speech Detection for Public Forums}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2023},
  url = {https://openreview.net/forum?id=KEH6Cqjdw2},
}
Figure