[Paper Review] MIPT-NSU-UTMN at SemEval-2021 Task 5: Ensembling Learning with Pre-trained Language Models for Toxic Spans Detection
This paper presents an ensemble approach using BERT-based models fine-tuned in two stages for toxic spans detection in social media texts. The method leverages domain-specific pre-training on Jigsaw data followed by token-level classification, with ensemble strategies improving F1-score to 67.55% on the SemEval-2021 test set, outperforming the average by nearly 10%.
This paper describes our system for SemEval-2021 Task 5 on Toxic Spans Detection. We developed ensemble models using BERT-based neural architectures and post-processing to combine tokens into spans. We evaluated several pre-trained language models using various ensemble techniques for toxic span identification and achieved sizable improvements over our baseline fine-tuned BERT models. Finally, our system obtained a F1-score of 67.55% on test data.
Motivation & Objective
- Address the challenge of identifying specific toxic spans in social media comments, which is more granular than whole-text toxicity detection.
- Improve performance on low-resource, span-level toxic language detection by leveraging transfer learning with pre-trained language models.
- Investigate the effectiveness of multi-stage fine-tuning and ensemble learning for better generalization and robustness in toxic span detection.
- Overcome data sparsity and annotation ambiguity in the shared task by using domain-adapted pre-training and post-processing strategies.
Proposed method
- Fine-tune BERT-base-uncased on a large-scale Jigsaw dataset with toxicity scores ≥0.5 as positive samples and a 3:1 ratio of negative samples to improve domain alignment.
- Perform a second fine-tuning step on the SemEval-2021 training and validation data for token-level binary classification of toxic spans.
- Apply multiple ensemble strategies: hard voting (span intersection and union), soft voting with weighted probabilities, and meta-classifier training on validation data.
- Use the Hugging Face Transformers library for model training and inference, with token-level classification head predicting toxicity per token.
- Post-process model outputs by grouping consecutive predicted toxic tokens into spans using rule-based merging based on token offsets.
- Optimize ensemble performance using a single hold-out validation set to select the best combination of models and voting strategy.
Experimental results
Research questions
- RQ1Does two-stage fine-tuning—first on a large general toxic comment dataset and then on the target span-level task—improve performance on toxic span detection?
- RQ2Which ensemble strategy (hard voting, soft voting, or meta-classifier) yields the best F1-score for span-level toxicity detection?
- RQ3How does domain-adaptive pre-training on Jigsaw data affect the model’s ability to detect subtle or contextually toxic spans?
- RQ4To what extent do annotation ambiguities and sarcasm in the dataset affect model generalization and performance?
- RQ5Can ensemble methods mitigate over-prediction on non-toxic posts where no toxic spans are annotated?
Key findings
- The two-stage fine-tuning approach significantly improved performance over baseline BERT models, with the best F1-score reaching 67.55% on the test set.
- The model achieved an average F1-score of 0.6714 across five cross-validation folds during the second training stage on the combined train and trial sets.
- The span intersection ensemble strategy yielded the best performance, outperforming both hard voting with union and soft voting methods.
- The system exceeded the average F1-score of 57.81% across all 91 participating teams by nearly 10 percentage points, ranking 27th out of 91 teams.
- The model struggled with posts that had no toxic span annotations, often detecting false positives in sarcastic or contextually toxic but unannotated expressions.
- Several test examples revealed potential annotation credibility issues, such as inconsistent or overly broad span labeling, which may have contributed to performance limitations.
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.