[Paper Review] Hate Speech and Offensive Language Detection using an Emotion-aware Shared Encoder
This paper proposes a multi-task learning framework that jointly detects hate speech and offensive language using BERT and mBERT as shared encoders, integrating external emotion features to improve performance on imbalanced datasets. The model achieves a 3% performance boost in hate speech detection and significantly reduces false positives by leveraging shared representations and emotional knowledge.
The rise of emergence of social media platforms has fundamentally altered how people communicate, and among the results of these developments is an increase in online use of abusive content. Therefore, automatically detecting this content is essential for banning inappropriate information, and reducing toxicity and violence on social media platforms. The existing works on hate speech and offensive language detection produce promising results based on pre-trained transformer models, however, they considered only the analysis of abusive content features generated through annotated datasets. This paper addresses a multi-task joint learning approach which combines external emotional features extracted from another corpora in dealing with the imbalanced and scarcity of labeled datasets. Our analysis are using two well-known Transformer-based models, BERT and mBERT, where the later is used to address abusive content detection in multi-lingual scenarios. Our model jointly learns abusive content detection with emotional features by sharing representations through transformers' shared encoder. This approach increases data efficiency, reduce overfitting via shared representations, and ensure fast learning by leveraging auxiliary information. Our findings demonstrate that emotional knowledge helps to more reliably identify hate speech and offensive language across datasets. Our hate speech detection Multi-task model exhibited 3% performance improvement over baseline models, but the performance of multi-task models were not significant for offensive language detection task. More interestingly, in both tasks, multi-task models exhibits less false positive errors compared to single task scenario.
Motivation & Objective
- Address the challenge of data scarcity and class imbalance in hate speech and offensive language detection using multi-task learning.
- Improve model generalization and reduce overfitting by sharing representations across related tasks (abusive content and emotion classification).
- Investigate the effectiveness of external emotional features as auxiliary signals to enhance detection performance in low-resource and imbalanced settings.
- Evaluate the performance of BERT and mBERT as shared encoders in both mono- and multi-lingual contexts for abusive language detection.
- Demonstrate that emotion-aware multi-task learning leads to fewer false positive errors compared to single-task baselines.
Proposed method
- Employ a shared transformer encoder (BERT or mBERT) to extract contextual representations for both hate speech and offensive language detection tasks.
- Integrate emotion classification as an auxiliary task using external emotion-labeled corpora to provide additional supervision and improve data efficiency.
- Train the model end-to-end in a multi-task learning setup, where the shared encoder learns joint representations across abusive content and emotional features.
- Use early stopping and learning rate scheduling to optimize training and prevent overfitting, especially on imbalanced datasets.
- Apply weighted cross-entropy loss to handle class imbalance in both hate speech and offensive language datasets.
- Compare the performance of multi-task models (MTL) against single-task baselines (STL) using standard NLP metrics such as F1-macro and accuracy.

Experimental results
Research questions
- RQ1Can integrating emotion features as an auxiliary task improve the performance of hate speech and offensive language detection models on imbalanced datasets?
- RQ2How does multi-task learning with a shared encoder compare to single-task learning in terms of classification accuracy and false positive rates?
- RQ3Does the use of mBERT as a shared encoder improve cross-lingual generalization in hate and offensive language detection compared to monolingual BERT?
- RQ4To what extent do emotional features reduce misclassification errors, especially false positives, in abusive content detection?
- RQ5How do different pre-trained models (BERT vs. mBERT) perform when jointly learning abusive content and emotion classification tasks?
Key findings
- The multi-task model achieved a 3% performance improvement in hate speech detection compared to single-task baseline models, with F1-macro scores of 0.9288 and 0.9204 for BERT and mBERT respectively.
- Despite the performance gain in hate speech detection, the improvement in offensive language detection was not significant, likely due to high class imbalance (91% offensive samples in Davidson-OFF dataset).
- The mBERT-MTL model demonstrated fewer false positive errors than the BERT-based ensemble model in hate speech detection, particularly in the minority class (hate speech), indicating better robustness.
- In offensive language detection, the BERT-MTL model achieved a true positive rate of 98.94% and a false positive rate of only 1.06%, significantly lower than the BERT-STL model’s 14.40%.
- The confusion matrices confirmed that multi-task models consistently reduced misclassification errors across both tasks, especially in reducing false positives.
- Emotional knowledge helped improve classification performance in both tasks, even with highly imbalanced datasets, suggesting that affective features provide useful inductive bias for abusive language detection.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.