TL;DR
This paper introduces HateBERT, a BERT model specifically retrained on a large dataset of English Reddit comments from banned communities. HateBERT significantly outperforms general BERT models on abusive language detection tasks, demonstrating the effectiveness of domain-specific pre-training for nuanced language understanding.
What Problem Does This Paper Address?
The automatic detection of abusive language, including offensive language, abusive language, and hate speech, is a critical area in NLP. While pre-trained language models like BERT have achieved state-of-the-art results, they are often trained on general-purpose text and struggle with the specific linguistic nuances and domain-specific varieties found in online discourse. This limitation hinders their effectiveness in accurately identifying and classifying various forms of abusive language. The paper addresses this by proposing a domain-specific BERT model, HateBERT, trained on a dataset curated from communities banned for abusive content, aiming to improve performance and portability across different abusive language detection tasks.
Methods
The core methodology involves further pre-training a general-purpose BERT base-uncased model. This process, often referred to as domain adaptation, uses a large corpus of domain-specific text to fine-tune the model's existing representations. The authors created a new dataset, RAL-E (Reddit Abusive Language English dataset), by collecting posts from Reddit communities banned for offensive, abusive, or hateful content. This dataset, comprising over 1.4 million messages, was used to retrain BERT using the Masked Language Model (MLM) objective. The retrained model, HateBERT, was then evaluated on three existing English datasets for abusive language detection: OffensEval 2019, AbusEval, and HatEval.
Datasets
- RAL-E (Reddit Abusive Language English dataset): A newly curated dataset of 1,492,740 Reddit comments from communities banned for offensive, abusive, or hateful content. This dataset was used for pre-training HateBERT.
- OffensEval 2019: A dataset of 14,100 tweets annotated for offensive language.
- AbusEval: A dataset derived from OffensEval 2019, with an added layer of abusive language annotation, defining abusive language as a specific case of offensive language.
- HatEval: The English portion of a dataset containing 13,000 tweets annotated for hate speech against migrants and women.
Key Insights and Ideas
- Domain-specific pre-training is highly effective: Retraining BERT on a corpus of abusive language significantly boosts its performance on related detection tasks. This highlights that general language understanding is not always sufficient for specialized domains.
- Abusive language phenomena exist on a spectrum: The paper visually represents and empirically demonstrates that offensive, abusive, and hate speech phenomena are related but differ in specificity. This understanding is crucial for interpreting model portability.
- Portability is influenced by specificity: Models fine-tuned on more general abusive language tend to transfer better to more specific tasks, and vice-versa, the transfer is less effective. This suggests that the alignment of annotated phenomena across datasets plays a key role.
- HateBERT offers improved robustness: The retrained model not only improves performance on positive classes but also on negative classes, indicating a more nuanced understanding of language.
Key Results
- In-dataset evaluation: HateBERT consistently outperformed the generic BERT model across all three evaluated datasets (OffensEval 2019, AbusEval, and HatEval). For instance, on AbusEval, HateBERT achieved a macro F1 score of .765±.006, compared to BERT's .727±.008.
- State-of-the-art performance: HateBERT achieved competitive results, ranking highly on OffensEval and HatEval, and achieving the second-best F1 score on the positive class for HatEval.
- Portability: HateBERT demonstrated better portability than generic BERT, especially when transferring knowledge from general abusive language to more specific categories.
- Qualitative analysis: The MLM task with template sentences like "[someone] is a(n)/are [MASK]" showed that HateBERT consistently filled the mask with profanities or abusive terms, unlike the generic BERT, which rarely did so.
Limitations and Future Work
- Bias in training data: The authors acknowledge that the RAL-E dataset, derived from banned subreddits, inherently contains biases. While efforts were made to mitigate privacy risks by removing metadata, the inherent nature of the data means HateBERT is an intrinsically biased model.
- Contextual understanding: Current datasets often lack the full context of a message, leading to superficial linguistic cues being used for labeling. This limits the models' ability to fully grasp nuances.
- Future Work: The authors plan to investigate the extent to which HateBERT's embedding representations differ from general BERT and explore the connections between various abusive language phenomena more deeply. They also aim to extend HateBERT with additional data to address existing biases.
Summary updated