Source-linked AI summary
HateBERT: Retraining BERT for Abusive Language Detection in English
Tommaso Caselli, Valerio Basile, Jelena Mitrović, Michael Granitzer
TL;DR
Abusive language online motivates models specialized to this domain despite limited representative data. The paper retrains BERT on Reddit communities banned for offensive, abusive, or hateful content, finding stronger in-dataset performance and portability patterns tied to phenomenon compatibility.
Problem
Abusive language phenomena are widespread online, while suitable and representative training-data collections are limited.
Method
The paper further pre-trains BERT using RAL-E, a large-scale English Reddit dataset from communities banned for offensive, abusive, or hateful content.
Results
HateBERT consistently outperforms generic BERT across offensive language, abusive language, and hate speech datasets, with portability affected by phenomenon specificity and compatibility.
Takeaways & Limitations
Further pre-training offers a fast, cheap route to domain- or language-variety-oriented models, while cross-dataset transfer should account for differences among annotated phenomena.
Takeaways & Limitations
HateBERT is intrinsically biased and inherits biases from manually annotated data, especially for offensive-language detection.
Abstract
from arXiv · showhide
In this paper, we introduce HateBERT, a re-trained BERT model for abusive language detection in English. The model was trained on RAL-E, a large-scale dataset of Reddit comments in English from communities banned for being offensive, abusive, or hateful that we have collected and made available to the public. We present the results of a detailed comparison between a general pre-trained language model and the abuse-inclined version obtained by retraining with posts from the banned communities on three English datasets for offensive, abusive language and hate speech detection tasks. In all datasets, HateBERT outperforms the corresponding general BERT model. We also discuss a battery of experiments comparing the portability of the generic pre-trained language model and its corresponding abusive language-inclined counterpart across the datasets, indicating that portability is affected by compatibility of the annotated phenomena.
1 Introduction
Abusive language detection spans heterogeneous phenomena and annotations, while general-purpose pre-trained models may be limited by domain-specific language. The paper addresses these issues by introducing HateBERT and examining portability across related phenomena.
- General-purpose pre-trained language models can be limited by the language varieties used in training when applied to domain-specific data.
- Abusive language spans microaggression, stereotyping, offense, abuse, hate speech, threats, and doxxing.
- Current approaches focus mainly on offensive language, abusive language, and hate speech, producing fragmented definitions and potentially incompatible annotations.
- Specificity distinguishes the three focal phenomena, with offensive language most generic, abusive language intermediate, and hate speech most specific.
- The paper introduces HateBERT, releases it with the RAL-E dataset, and evaluates portability while accounting for differences in phenomenon specificity.
2 HateBERT: Re-training BERT with Abusive Online Communities
The paper adapts BERT to abusive online language using further pre-training on Reddit communities banned for offensive, abusive, or hateful content. It constructs RAL-E, trains HateBERT from that corpus, and shifts the model toward social-media language and abusive polarity.
- Social-media data can produce fluctuating results, with preprocessing quality identified as a key factor in OffensEval 2019 comparisons.
- Further pre-training is presented as a fast, effective strategy for adapting BERT-like models to new language varieties or domains.
- RAL-E dataset: RAL-E contains 1,492,740 English Reddit messages and 43,820,621 tokens collected from communities banned for offensive, abusive, or hateful content.
- Creating HateBERT: HateBERT was trained by further pre-training English BERT base-uncased with the Masked Language Model objective on 1,478,348 RAL-E messages.
- Creating HateBERT: The resulting model shifts BERT along language-variety and polarity dimensions toward social media and offense-, abuse-, and hate-oriented text.
3 Experiments and Results
The experiments compare generic BERT and HateBERT across three English abusive-language datasets and evaluate both in-dataset performance and cross-dataset portability. HateBERT outperforms BERT in-domain and generally transfers better, especially from less specific to more specific phenomena.
- Datasets and setup: The evaluation uses OffensEval, AbusEval, and HatEval, whose annotations target offensive language, abusive language, and hate speech with differing specificity.AbusEval adds abusive-language annotations to OffensEval, while HatEval targets hate speech against migrants and women.
- Datasets and setup: Both models were fine-tuned with the same preprocessing steps and hyperparameters, using macro-averaged F1 for the positive and negative classes.Table 1 reports in-dataset results, while Table 2 reports cross-dataset portability results.
- In-dataset results: On every dataset, HateBERT largely outperforms the corresponding general BERT model, with improvements affecting both positive and negative classes.The authors interpret these class-level gains as evidence that HateBERT is more robust.
- Portability results: HateBERT achieves better portability than generic BERT, particularly when transferring from generic offensive language to more specific abusive language or hate speech.The portability experiments use the best model from each in-dataset experiment and show a general performance drop relative to in-dataset scores.
- Portability results: HateBERT obtains higher positive-class Precision than BERT in the reported portability comparisons, while maintaining a very low cost for Recall.The authors relate portability behavior to differences in specificity among the annotated phenomena.
- Comparison with prior results: HateBERT surpasses state-of-the-art results on AbusEval but achieves competitive results on OffensEval and HatEval.The paper notes that the authors did not replicate Liu et al.’s reported best-system results at OffensEval 2019.
4 Conclusion and Future Directions
The paper introduces HateBERT as an English abusive-language model and concludes that further pre-training can adapt language models to relevant language varieties. Its evaluations support robust representations and relationships among abusive-language phenomena, while future work will examine representation differences and generalizability.
- Conclusion: HateBERT is a pre-trained English language model for abusive-language phenomena, created through further pre-training of BERT.The paper presents it as the central model contribution.
- Conclusion: Further pre-training is presented as an effective and cheap strategy for porting pre-trained language models to other language varieties.The conclusion frames this as a broader methodological contribution beyond HateBERT itself.
- Conclusion: Across offensive language, abusive language, and hate speech, HateBERT consistently outperforms generic BERT in in-dataset evaluation.The conclusion also reports robust representations in cross-dataset experiments.
- Future directions: Future work will investigate how HateBERT’s embedding representations differ from general BERT and test its generalizability.These are the two directions explicitly identified by the authors.
Ethical Statement
HateBERT is further-pretrained from BERT on Reddit messages from communities banned for abusive content, with RAL-E made available to support research. The authors also emphasize benefits alongside bias, missing context, and the need for human supervision.
- Contribution: HateBERT further-pretrains BERT base-uncased on Reddit messages from communities banned for harassment, bullying, incitement of violence, hate, offense, and abuse.The authors describe this corpus as more ecologically representative of abusive-language expressions than manually annotated datasets.
- Dataset: RAL-E was generated from a publicly available Reddit collection and is intended to make natural interactions in online communities available for research.The authors state that RAL-E will be publicly released.
- Benefits: Monitoring abusive language with such models may reduce harmful-content exposure, support healthier interactions, and promote positive contagious behaviors.These benefits are presented as potential benefits of using abusive-language models in social media.
- Risks: HateBERT is intrinsically biased, and fine-tuned models inherit biases in manually annotated data, especially for offensive-language detection.The authors identify misrepresentation as a direct risk of deploying these systems.
- Deployment: Current datasets lack occurrence context and meaning nuances, so the authors argue that HateBERT-based tools require human supervision in real-world use.The authors link dataset limitations to labels based only on superficial linguistic cues.
Appendix A
Appendix A identifies the distribution of messages across banned communities in RAL-E and lists preprocessing steps used before retraining. The preprocessing normalizes mentions, URLs, emojis, hashtags, spacing, and blank lines.
- Dataset distribution: Appendix A presents the number of posts associated with each banned community composing RAL-E.The appendix labels this as the distribution of messages per banned community.
- Pre-processing before re-training: Before retraining, user mentions and URLs are replaced with placeholders, while emojis are converted to text.The listed placeholders are @USER and URL.
- Pre-processing before re-training: Before retraining, hashtag symbols are removed and extra spaces and blank lines are normalized or deleted.The appendix gives an example converting #kadiricinadalet to kadiricinadalet.
Appendix B
Appendix B describes minimal preprocessing before fine-tuning each dataset and reports the shared hyperparameters used for BERT and HateBERT fine-tuning.
- Pre-processing before fine-tuning: Before fine-tuning, each dataset receives minimal preprocessing that replaces mentions and URLs with placeholders and converts emojis to text.The listed placeholders are @USER and URL.
- Pre-processing before fine-tuning: Fine-tuning preprocessing removes hashtag symbols and replaces extra blank spaces with a single space.The appendix includes hashtag-symbol removal among the adopted preprocessing steps.
- Hyperparameters: Fine-tuning uses learning rate 1e-5, 5 epochs, Adam epsilon 1e-8, maximum sequence length 100, batch size 32, and zero warmup steps.These hyperparameters are reported for both BERT and HateBERT.