Mitigating Imbalance in Portuguese Toxicity Classification via LLM Augmentation and Cross-Dataset Label Propagation
Resumo
The automated detection of fine-grained hate speech subclasses, such as sexism, homophobia, and fatphobia, is essential for cultivating safer online ecosystems and developing tailored content moderation policies. However, state-of-the-art NLP models face bottlenecks when dealing with minority toxic categories due to extreme class imbalance. In this work, we address this limitation within the context of the Portuguese language by implementing a comprehensive framework combining Large Language Model (LLM)-based data augmentation with domain-adapted transformer fine-tuning. Using the multi-labeled HateBR dataset as our base corpus, we employ Google’s Gemini model to perform targeted text generation, synthesizing high-quality training instances exclusively for underrepresented subclasses. We then fine-tune BERTabaporu, a language model pre-trained specifically for Portuguese social media text. Our empirical evaluation across multiple independent random seeds shows that LLM-based data augmentation yields a 31.2% relative improvement in Macro-F1 score (increasing from 0.3905 to 0.5124) over the original HateBR baseline, driven by substantial performance gains in challenging minority classes like fatphobia (+0.5171) and homophobia (+0.3467). Furthermore, we validate the out-of-domain transferability of our optimal model via a cross-dataset pseudo-labeling pipeline. By applying strict confidence and low-entropy criteria, the classifier successfully propagated fine-grained taxonomic labels onto three external binary Portuguese datasets. This automated curation effort yielded an expanded, high-certainty multiclass corpus consisting of 8,726 annotated instances. Our findings demonstrate that integrating generative datacentric AI with specialized encoders offers a powerful, scalable paradigm for mitigating data scarcity and advancing fine-grained toxicity detection in low-resource contexts.
Referências
Assis, G., Amorim, A., Carvalho, J., Ferro, M., De Oliveira, D., Vianna, D., and Paes, A. (2024). Explorando técnicas de aprendizado em modelos de linguagem para classificação de discurso de Ódio e ofensivo em português. Linguamática, 16(2):91–113. 1Anonymous repository accessible at: [link]
da Costa, P., Pavan, M., dos Santos, W., da Silva, S., and Paraboni, I. (2023). Bertabaporu: Assessing a genre-specific language model for portuguese nlp. In Proceedings of the Conference Recent Advances in Natural Language Processing - Large Language Models for Natural Language Processings, pages 217–223. INCOMA Ltd., Shoumen, BULGARIA.
da Silva Oliveira, A., de Carvalho Cecote, T., Alvarenga, J. P. R., de Souza Freitas, V. L., and da Silva Luz, E. J. (2024). Toxic speech detection in portuguese: A comparative study of large language models. In Proceedings of the International Conference on Computational Processing of Portuguese (PROPOR 2024). Association for Computational Linguistics.
Garg, T., Masud, S., Suresh, T., and Chakraborty, T. (2023). Handling bias in toxic speech detection: A survey. ACM Computing Surveys, 55(13s):1–32.
Mnassri, K., Farahbakhsh, R., Chalehchaleh, R., Rajapaksha, P., Jafari, A. R., Li, G., and Crespi, N. (2024). A survey on multi-lingual offensive language detection. PeerJ Computer Science, 10:e1934.
R. Neto, F. A., Anchiêta, R. T., Moura, R. S., and Santana, A. M. (2024). Abordagem semi-supervisionada para anotação de linguagem tóxica. In Anais do XIII Brazilian Workshop on Social Network Analysis and Mining (BraSNAM 2024), pages 116–129. Sociedade Brasileira de Computação - SBC.
Requena, J. V. S. C., Ribeiro, J. V. A., and Berton, L. (2026). A multimodal framework for financial fake news detection for brazilian portuguese. In Proceedings of the 17th International Conference on Computational Processing of Portuguese (PROPOR 2026)-Vol. 1, pages 234–239.
Vargas, F., Carvalho, I., Rodrigues de Góes, F., Pardo, T., and Benevenuto, F. (2022). HateBR: A large expert annotated corpus of Brazilian Instagram comments for offensive language and hate speech detection. In Calzolari, N., Béchet, F., Blache, P., Choukri, K., Cieri, C., Declerck, T., Goggi, S., Isahara, H., Maegaard, B., Mariani, J., Mazo, H., Odijk, J., and Piperidis, S., editors, Proceedings of the Thirteenth Language Resources and Evaluation Conference, pages 7174–7183, Marseille, France. European Language Resources Association.
