Advanced Toxic Comment Classification Using Multi-Architecture Generative AI Techniques

S. Sushma, Sasmita Kumari Nayak, M. Vamsi Krishna · International Journal of Basic and Applied Sciences · 2025

The proliferation of user-generated content on online platforms has led to a significant rise in toxic and harmful comments, ‎necessitating the development of robust and scalable detection systems. In this study, a comprehensive methodology is ‎proposed for toxic comment classification using the Jigsaw Toxic Comment dataset. Initially, baseline models were implemented to establish reference performance levels. A Logistic Regression model combined with TF-IDF feature extraction achieved an accuracy of 93.00%, while a shallow single-layer neural network reached an accuracy of 94.00%. Building upon these baselines, a novel Generative AI (GenAI) driven approach was employed, integrating four distinct stages: ‎synthetic data generation using GPT-2, fine-tuning GPT-2 for supervised classification, lightweight classification using ‎DistilGPT-2, and text-to-text classification using T5-small. Synthetic toxic and non-toxic comments were generated using ‎GPT-2, enriching the training data and enhancing model generalization. Subsequently, GPT2ForSequenceClassification ‎was fine-tuned both with and without class imbalance adjustments, achieving an accuracy of 96.22% and a toxic F1-score ‎of 97.90%. DistilGPT-2 was then fine-tuned to provide a lightweight alternative, achieving slightly lower but competitive ‎performance with an accuracy of approximately 96.00% and a toxic F1-score of 97.50%. Further, a T5-small model was ‎fine-tuned by reframing toxic comment classification as a text-to-text task, achieving the best results with approximately ‎‎97.00% accuracy and a toxic F1-score of 98.10%. The results demonstrate that combining data augmentation with multi-‎architecture Generative AI fine-tuning significantly improves toxic comment detection performance, outperforming traditional machine learning and shallow neural network baselines. This work highlights the effectiveness of leveraging generative models for both data enhancement and supervised learning, offering a comprehensive and scalable solution for mitigating toxic behavior online‎.

Read the paper · More papers on PaperTik