TheNorth at SemEval-2020 Task 12: Hate Speech Detection Using RoBERTa

Pedro Alonso, Rajkumar Saini, György KovácsSemEval @ COLING 2020 · DOI

Introduction

Hate speech and offensive language on social media represent a "moving target," as the linguistic patterns of online toxicity evolve rapidly. Static detection systems often fail to keep pace with these changes. This paper details the participation of team TheNorth in the SemEval-2020 Task 12 (OffensEval) challenge, specifically Sub-task A. The goal was to categorize English tweets as either "Offensive" (OFF) or "Not Offensive" (NOT).

The primary challenge of this task was the scale and nature of the data: a training set of over 9 million tweets. Unlike traditional datasets with binary labels, these tweets were annotated with continuous scores (mean and standard deviation), requiring a strategy to bridge the gap between probabilistic regression and binary classification.

Methods

The authors explored Transformer-based architectures, specifically RoBERTa and DistilBERT, to handle the linguistic complexities of the dataset.

Preprocessing

To reduce noise, regular expressions were used to replace specific Twitter handles with @USER and links with URL. Notably, the team chose to entirely remove emojis, hashtags, and emoticons. Preliminary analysis suggested that emoji count did not correlate significantly with offensive scores, and their removal helped create a more uniform input for the model.

Table showing the original tweets and the resulting preprocessed text after removing emojis and standardizing handles.

Regression and Thresholding

Instead of standard cross-entropy classification, the models were trained for regression using the mean offensive scores provided in the dataset. To convert continuous outputs back into binary labels, the team utilized the smaller, manually labeled OLID dataset to find an optimal classification threshold. For instance, a predicted score above a specific threshold (e.g., 0.44 or 0.45) would result in an "Offensive" label.

Training Strategy

Due to hardware constraints, the team utilized only the first 1 million samples of the 9 million available. They employed early stopping to prevent overfitting and found that training for very few epochs (sometimes as low as 0.18 of an epoch) on such a massive dataset often yielded the best results, as the model encountered sufficient variety early in the process.

Datasets

  • OffensEval 2020: The primary training set containing 9,089,140 tweets with continuous scores.
  • OLID (Offensive Language Identification Dataset): A manually labeled dataset of 13,241 tweets used for validation and threshold optimization.

Results and Discussion

RoBERTa consistently outperformed DistilBERT in capturing the nuances of offensive speech. The team's performance was highly competitive, achieving an initial macro F1-score of 0.9087 during the competition. Post-competition refinement of hyperparameters and the train/dev split pushed this score to 0.9166.

Table summarizing RoBERTa performance across different thresholds on the OLID and OffensEval test sets.

Error analysis revealed that while the model is robust, it still struggles with self-referential language (e.g., a user calling themselves "ignorant") or common slang that is not directed as an attack. Despite using only ~11% of the available training data, the team's score was only 0.02 behind the top-performing global entry.

Conclusion

The results demonstrate that RoBERTa is highly effective for hate speech detection even under hardware-limited conditions. Future work will focus on ensemble modeling to improve robustness and developing better contextual sensitivity to distinguish between offensive words used neutrally versus targeted abuse.

Summary updated

BibTeX
@inproceedings{alonso2020thenorth,
  author = {Pedro Alonso and Rajkumar Saini and György Kovács},
  title = {{TheNorth at SemEval-2020 Task 12: Hate Speech Detection Using RoBERTa}},
  booktitle = {SemEval @ COLING},
  year = {2020},
  doi = {10.18653/v1/2020.semeval-1.292},
}
Figure