UHH-LT at SemEval-2020 Task 12: Fine-Tuning of Pre-Trained Transformer Networks for Offensive Language Detection

Gregor Wiedemann, Seid Muhie Yimam, Chris Biemann

TL;DR

The authors secured 1st place in the SemEval-2020 Offensive Language Detection shared task (Task A, English) by rejecting a massive dataset's noisy "weak labels" and instead using the text for unsupervised domain adaptation. By performing Masked Language Modeling (MLM) further pre-training on just a 5% sample of the 9-million-tweet corpus, their RoBERTa-based ensemble achieved state-of-the-art performance, a result they later surpassed using ALBERT.

What Problem Does This Paper Address?

Automating the detection of hate speech, cyber-bullying, and offensive language on social media is a critical but notoriously difficult NLP task. Subtle linguistic shifts, sarcasm, or simply adding a positive word like "love" can easily fool standard classifiers.

For the OffensEval 2020 shared task, the organizers did not provide a new, cleanly labeled manual dataset for English. Instead, they released a massive corpus of roughly 9 million tweets "weakly labeled" by an ensemble of five classifiers trained on the previous year's data (OLID 2019). The core challenge was determining how to extract value from this massive but inherently noisy dataset without letting the weak labels degrade model performance.

Methods

The authors took a counterintuitive but highly effective approach: they completely ignored the weak labels. Reasoning that a machine learning system cannot learn more from weak labels than from the original dataset used to generate them, they relied strictly on the clean 2019 OLID dataset for supervised fine-tuning.

However, they didn't throw away the 2020 dataset entirely. Instead, they leveraged the raw text for unsupervised domain adaptation via Masked Language Modeling (MLM) further pre-training. Due to severe hardware limitations (training on all 9 million tweets would take an estimated 40 days on a single GPU), they randomly sampled just 5% of the dataset (approx. 436,000 tweets) after stripping URLs and user mentions.

They evaluated several state-of-the-art transformer architectures:

  • BERT (Base and Large)
  • RoBERTa (Base and Large)
  • XLM-RoBERTa
  • ALBERT (Large and XXLarge, versions 1 and 2)

To maximize robustness and smooth out random initialization effects, they utilized ensembling strategies, including majority voting and 10-fold cross-validation.

Datasets

  • OLID 2019 (Offensive Language Identification Dataset): 14,100 manually labeled Twitter tweets used for supervised training and validation.
  • OffensEval 2020 Dataset: 9 million weakly labeled tweets. The authors used a cleaned 5% sample exclusively for unsupervised MLM pre-training.

Key Insights and Ideas

  • Data over Labels: Noisy labels from teacher models don't add information, but the in-domain text distribution itself is incredibly valuable. Using the unlabeled text to bridge the domain gap via MLM proved to be the winning strategy.
  • Efficiency in Sampling: You don't need a supercomputer cluster to benefit from massive datasets. Further pre-training on a tiny 5% slice of the corpus was enough to adapt the model's language representations to the specific nuances of 2020 Twitter data.
  • ALBERT's Superiority: While RoBERTa-large was their choice for the official submission, post-competition experiments revealed that ALBERT-xxlarge architectures yielded even better parameter efficiency and raw performance for binary text classification.

Key Results

The authors' official submission—an ensemble of MLM further pre-trained RoBERTa-large models—won 1st place out of 84 teams in Task A (Offensive Language Detection) with a Macro F1-score of 92.04%.

Post-competition experiments on the OLID test set showed that an ensemble of two ALBERT-xxlarge models achieved the highest overall performance with a Macro F1-score of 92.25%, outperforming the single pre-trained baselines.

Performance of baselines, single models, and ensemble models on the OLID test set

For the hierarchical sub-tasks, the system achieved 6th place out of 42 for Task B (categorizing offense type) and 3rd place out of 38 for Task C (target identification), as detailed below:

Official results of UHH-LT OffensEval 2020 test set submissions

Limitations and Future Work

The primary bottleneck highlighted by the authors was compute constraints, which forced them to downsample the 9-million-tweet dataset significantly.

Furthermore, while the models excelled at binary classification (Task A), their performance suffered in the fine-grained sub-tasks (Tasks B and C). The confusion matrices reveal a severe bias toward the majority classes (e.g., predicting "TIN" over "UNT" in Task B), driven by the stark class imbalance inherent in the OLID dataset. The authors note that explicitly accounting for this class imbalance will be crucial for future iterations of the system.

Figure 2: Confusion matrices from the submitted UHH-LT ensemble predictions.

Summary updated

Abstract

Fine-tuning of pre-trained transformer networks such as BERT yield state-of-the-art results for text classification tasks. Typically, fine-tuning is performed on task-specific training datasets in a supervised manner. One can also fine-tune in unsupervised manner beforehand by further pre-training the masked language modeling (MLM) task. Hereby, in-domain data for unsupervised MLM resembling the actual classification target dataset allows for domain adaptation of the model. In this paper, we compare current pre-trained transformer networks with and without MLM fine-tuning on their performance for offensive language detection. Our MLM fine-tuned RoBERTa-based classifier officially ranks 1st in the SemEval 2020 Shared Task~12 for the English language. Further experiments with the ALBERT model even surpass this result.
BibTeX
@inproceedings{wiedemann2020uhh,
  author = {Gregor Wiedemann and Seid Muhie Yimam and Chris Biemann},
  title = {{UHH-LT at SemEval-2020 Task 12: Fine-Tuning of Pre-Trained Transformer Networks for Offensive Language Detection}},
  booktitle = {International Conference on Computational Linguistics},
  year = {2020},
}
Figure