ReBERT at HSD-2Lang 2024: Fine-Tuning BERT with AdamW for Hate Speech Detection in Arabic and Turkish
Paper · 2024 · Utku Yagci, Egemen Iscan and Ahmet Kolcak
Summary
The authors present their entry to the HSD-2Lang 2024 shared task, which asks for binary hate speech classification of tweets in Turkish (Subtask A) and Arabic (Subtask B). They used only the organisers' data: 9140 labelled tweets for Turkish and 960 for Arabic. They first compared several Hugging Face checkpoints without any fine-tuning and kept the strongest ones, TurkishBERTweet and Arabertv02-twitter. Both were then fine-tuned with AdamW, and the team searched learning rate, batch size, epoch count and scheduler type. Input text was left almost untouched, and the Arabic training set was rebalanced by randomly removing part of its majority class. The Arabic system placed first on the private leaderboard with F1 0.74. The Turkish system placed second with F1 0.69, and both led the public leaderboard. The paper shows that careful hyperparameter tuning of domain-matched pretrained encoders is still a strong baseline. It also shows that model selection against a small public test slice can mislead, especially when training data is scarce and imbalanced.
Key points
- Data: Subtask A has 9140 training tweets with roughly 70/30 non-hate/hate labels. Subtask B has 960 tweets with roughly 90/10. For Subtask B, the team randomly kept only 80% of the negative examples.
- Turkish setup: TurkishBERTweet with its own preprocessing, which only turns URLs and emoticons into tags. Training ran on an A100 with batch 32, max length 256, learning rate 5e-5, epsilon 1e-8, and polynomial decay with 10% warmup.
- Unusually long training helped the Turkish model. Runs of 100 and 1000 epochs beat the usual 2–4 epochs by up to about 4%, and warmup also helped. An Adafactor run did clearly worse than the AdamW runs.
- Arabic setup: Arabertv02-twitter with no preprocessing, trained on a GTX 1070 with batch 8, max length 250, and linear decay without warmup. The best submitted run scored 0.89 public and 0.74 private F1.
- Tuning was guided only by the public test portion, which is 20% of the test data. In Table 1, one Arabic run with a lower public score (0.85) reached a higher private score (0.76) than the submitted model.
Interesting ideas
- I1. Before investing in fine-tuning, the authors ran each candidate pretrained checkpoint as-is on the training data and dropped the weaker ones, a cheap screen that saves compute.
- I2. Rather than aggressive balancing, they removed only a modest random share of majority-class examples, because the dataset was too small to lose much.
- I3. Preprocessing was kept minimal and reversible: URLs and emoticons were replaced by tags while punctuation and tone markers were kept.
- I4. The gap between public and private scores shows that choosing a model by a small visible test slice can pick the wrong configuration.
- I5. Choosing encoders pretrained on the same genre as the target text (tweets) mattered more than generic models.
For Mova
How these ideas could serve Mova, our small open language model — its files, stages and tests:
- I1 (tree): Candidate encoders for gparse could be screened by a quick frozen-feature or few-step probe on a UD treebank before committing to full training runs.
- I2 (learn): When building silver data where some labels dominate (e.g. frequent deprels or frame types), light undersampling of the dominant class could reduce bias without starving rare cases.
- I3 (tokens): The tokenizer in crate en could map URLs, emojis and handles to typed placeholder tokens, so the tagger sees a stable category while the original span stays recoverable for explanation.
- I4 (learn): Evaluation should keep a separate untouched held-out set and report variance across runs, so that repair rules or training choices are not overfitted to one dev slice.
- I5 (tree): Genre-matched pretraining or treebanks (e.g. web/social UD treebanks) could be used when gparse must handle informal text, instead of relying on a single news-trained model.
Institutions
Fields, topics and concepts
📚 Shelves 4The field of science this work belongs to (OpenAlex fields).Computer Science · 18,614 worksArtificial Intelligence · 17,965 worksArts and Humanities · 17,450 worksLanguage and Linguistics · 17,296 works
🧭 Topics 3Research subjects and languages the work is about.Sentiment & emotion · 1,035 worksSemitic languages · 3,066 worksBias, fairness & safety · 587 works
Cite
Cite as Utku Yagci, Egemen Iscan and Ahmet Kolcak. 2024. ReBERT at HSD-2Lang 2024: Fine-Tuning BERT with AdamW for Hate Speech Detection in Arabic and Turkish. Proceedings of the 7th Workshop on Challenges and Applications of Automated Extraction of Socio-political Events from Text (CASE 2024).
@inproceedings{yagci2024rebert,
title = {{ReBERT at HSD-2Lang 2024: Fine-Tuning BERT with AdamW for Hate Speech Detection in Arabic and Turkish}},
author = {Utku Yagci, Egemen Iscan and Ahmet Kolcak},
booktitle = {Proceedings of the 7th Workshop on Challenges and Applications of Automated Extraction of Socio-political Events from Text (CASE 2024)},
year = {2024},
doi = {10.18653/v1/2024.case-1.27},
url = {https://doi.org/10.18653/v1/2024.case-1.27}
}References
- Wissam Antoun, Fady Baly, and Hazem Hajj. AraBERT: Transformer-based Model for Arabic Language Understanding. In LREC 2020 Workshop Language Resources and Evaluation Conference 11–16 May 2020, page 9. ↗
- Noam Shazeer and Mitchell Stern. 2018. Adafactor: Adaptive learning rates with sublinear memory cost. arXiv preprint arXiv:1804.04235. ↗
- Iulia Turc, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. Well-read students learn better: On the importance of pre-training compact models. arXiv preprint arXiv:1908.08962. ↗
- Gökçe Uludoğan, Somaiyeh Dehghan, İnanç Arın, Elif Erol, Berrin Yanikoglu, and Arzucan Özgür. 2024. Overview of the Hate Speech Detection in Turkish and Arabic Tweets (HSD-2Lang) Shared Task at CASE 2024. In Proceedings of the 7th Workshop on Challenges and Applications of Automated Extraction of Socio-political Events from Text (CASE), Malta. Association for Computational Linguistics.
- Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. 2023. Attention is all you need. arXiv preprint arXiv:1706.03762. ↗
- Z. Xinxi. 2021. Single task fine-tune BERT for text classification. 11911:119111Z – 119111Z–6. find
- Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805. ↗
Updated
This page in Markdown → https://md.research.elamur.ai/free/en/papers/yagci-2024-rebert-hsd-2lang-2024-fine/