Advanced Toxic Comment Classification Using Multi-Architecture Generative AI Techniques
-
https://doi.org/10.14419/ty9xvz92
Received date: July 5, 2025
Accepted date: August 9, 2025
Published date: August 17, 2025
-
Toxic Comment Classification; Generative AI; GPT-2; Text-to-Text Classification; DistilGPT-2; Synthetic Data Augmentation -
Abstract
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.
-
References
- Y. Mao, Q. Liu, and Y. Zhang, “Sentiment analysis methods, applications, and challenges: A systematic literature review,” Journal of King Saud University - Computer and Information Sciences, vol. 36, no. 4. Springer Science and Business Media LLC, p. 102048, Apr. 2024. https://doi.org/10.1016/j.jksuci.2024.102048.
- S. Sushma, S. K. Nayak and M. V. Krishna, "A Comprehensive Review of Sentiment Analysis: Trends, Challenges, and Future Directions," 2024 5th International Conference on Data Intelligence and Cognitive Informatics (ICDICI), Tirunelveli, India, 2024, pp. 1175-1181, https://doi.org/10.1109/ICDICI62993.2024.10810919.
- N. Punetha and G. Jain, “Advancing sentiment classification through a population game model approach,” Scientific Reports, vol. 14, no. 1. Springer Science and Business Media LLC, Sep. 04, 2024. https://doi.org/10.1038/s41598-024-70766-z.
- N. A. Semary, W. Ahmed, K. Amin, P. Pławiak, and M. Hammad, “Enhancing machine learning-based sentiment analysis through feature extrac-tion techniques,” PLOS ONE, vol. 19, no. 2. Public Library of Science (PLoS), p. e0294968, Feb. 14, 2024. https://doi.org/10.1371/journal.pone.0294968.
- Jency Jose and Simritha R, “Sentiment Analysis and Topic Classification with LSTM Networks and TextRazor,” International Journal of Data In-formatics and Intelligent Computing, vol. 3, no. 2. Prisma Publications, pp. 42–51, Jun. 16, 2024. https://doi.org/10.59461/ijdiic.v3i2.115.
- Y. Cai, X. Li, Y. Zhang, J. Li, F. Zhu, and L. Rao, “Multimodal sentiment analysis based on multi-layer feature fusion and multi-task learning,” Scientific Reports, vol. 15, no. 1. Springer Science and Business Media LLC, Jan. 16, 2025. https://doi.org/10.1038/s41598-025-85859-6.
- L. P. Thomas, J. Thomas, V. A. Menon and T. K. Sateesh Kumar, "Sentiment Analysis of Telegram App Reviews Using Text Classification Mod-els," 2025 4th International Conference on Sentiment Analysis and Deep Learning (ICSADL), Bhimdatta, Nepal, 2025, pp. 158-163, https://doi.org/10.1109/ICSADL65848.2025.10933302.
- A. Y. Alsalem and S. I. Abudalfa, "Empirical Analysis for Arabic Target-Dependent Sentiment Classification Using LLMs," 2024 International Conference on Innovation and Intelligence for Informatics, Computing, and Technologies (3ICT), Sakhir, Bahrain, 2024, pp. 170-176, https://doi.org/10.1109/3ict64318.2024.10824564.
- X. Fan and Z. Zhang, "A fine-grained sentiment analysis model based on multi-task learning," 2024 4th International Symposium on Computer Technology and Information Science (ISCTIS), Xi’an, China, 2024, pp. 157-161, https://doi.org/10.1109/ISCTIS63324.2024.10698954.
- X. He, "Sentiment Classification of Social Media User Comments Using SVM Models," 2024 5th International Seminar on Artificial Intelligence, Networking and Information Technology (AINIT), Nanjing, China, 2024, pp. 1755-1759, https://doi.org/10.1109/AINIT61980.2024.10581547.
- K. B. Nelatoori and H. B. Kommanti, “Multi-task learning for toxic comment classification and rationale extraction,” Journal of Intelligent Infor-mation Systems, vol. 60, no. 2. Springer Science and Business Media LLC, pp. 495–519, Aug. 20, 2022. https://doi.org/10.1007/s10844-022-00726-4.
- B. R. Naidu et al., “Toxic Comment Classification using Deep Learning,” International Journal on Recent and Innovation Trends in Computing and Communication, vol. 11, no. 7. Auricle Technologies, Pvt., Ltd., pp. 93–104, Sep. 01, 2023. https://doi.org/10.17762/ijritcc.v11i7.7834.
- N. Reddy, “Toxic Comments Classification,” International Journal for Research in Applied Science and Engineering Technology (IJRASET), vol. 10, no. 6, pp. 2839–2846, Jun. 30, 2022. https://doi.org/10.22214/ijraset.2022.44500.
- A. Vinod, A. K V, M. M, R. Riyaz, and Mr. A. N, “Toxic Comment Detection and Classifier,” IJARCCE, vol. 13, no. 4. Tejass Publishers, Apr. 30, 2024. https://doi.org/10.17148/IJARCCE.2024.134174.
- H. Fan et al., “Social Media Toxicity Classification Using Deep Learning: Real-World Application UK Brexit,” Electronics, vol. 10, no. 11. MDPI AG, p. 1332, Jun. 01, 2021. https://doi.org/10.3390/electronics10111332.
- J. K. Giustino and Y. P. Santosa, “Toxic Comment Classification Comparison between LSTM, BILSTM, GRU, AND BIGRU,” Proxies : Jurnal Informatika, vol. 7, no. 2. Soegijapranata Catholic University, pp. 115–127, Aug. 29, 2024. https://doi.org/10.24167/proxies.v7i2.12471.
- Z. Zhao, Z. Zhang, and F. Hopfgartner, “Utilizing subjectivity level to mitigate identity term bias in toxic comments classification,” Online Social Networks and Media, vol. 29. Elsevier BV, p. 100205, May 2022. https://doi.org/10.1016/j.osnem.2022.100205.
- A. Bonetti, M. Martínez-Sober, J. C. Torres, J. M. Vega, S. Pellerin, and J. Vila-Francés, “Comparison between Machine Learning and Deep Learn-ing Approaches for the Detection of Toxic Comments on Social Networks,” Applied Sciences, vol. 13, no. 10. MDPI AG, p. 6038, May 14, 2023. https://doi.org/10.3390/app13106038.
- A. Abbasi, A. R. Javed, F. Iqbal, N. Kryvinska, and Z. Jalil, “Deep learning for religious and continent-based toxic content detection and classifica-tion,” Scientific Reports, vol. 12, no. 1. Springer Science and Business Media LLC, Oct. 19, 2022. https://doi.org/10.1038/s41598-022-22523-3.
- A. Shinde, P. Shankar, A. Atul, and S. Rallabandi, “Bidirectional LSTM with convolution for toxic comment classification,” Proceedings of the 1st International Conference on Artificial Intelligence, Communication, IoT, Data Engineering and Security, IACIDS 2023, 23-25 November 2023, Lavasa, Pune, India. EAI, 2024. https://doi.org/10.4108/eai.23-11-2023.2343140.
- G. Xie, “An ensemble multilingual model for toxic comment classification,” International Conference on Algorithms, Microchips and Network Ap-plications. SPIE, p. 38, May 06, 2022. https://doi.org/10.1117/12.2636419.
- M. Shahid, M. Umair, M. A. Iqbal, M. Rashid, S. Akram, and M. Zubair, “Leveraging deep learning for toxic comment detection in cursive lan-guages,” PeerJ Computer Science, vol. 10. PeerJ, p. e2486, Dec. 13, 2024. https://doi.org/10.7717/peerj-cs.2486.
- S. Tsai and L. Shi, "Chinese Text Sentiment Classification Model Based on FastText and Multi-scale Deep Pyramid Convolutional Neural Net-work," 2022 International Conference on Computation, Big-Data and Engineering (ICCBE), Yunlin, Taiwan, 2022, pp. 75-77, https://doi.org/10.1109/ICCBE56101.2022.9888185.
- D. A. Kristiyanti, R. Aulianita, D. A. Putri, L. A. Utami, F. Agustini and Z. I. Alfianti, "Sentiment Classification Twitter of LRT, MRT, and Transjakarta Transportation using Support Vector Machine," 2022 International Conference of Science and Information Technology in Smart Ad-ministration (ICSINTESA), Denpasar, Bali, Indonesia, 2022, pp. 143-148, https://doi.org/10.1109/ICSINTESA56431.2022.10041651.
- Y. Yang, X. Sun, Q. Lu, R. Sutcliffe and J. Feng, "A Sentiment and Syntactic-Aware Graph Convolutional Network for Aspect-Level Sentiment Classification," ICASSP 2023 - 2023 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), Rhodes Island, Greece, 2023, pp. 1-5, https://doi.org/10.1109/ICASSP49357.2023.10096326.
- Y. Rong and B. Liu, "Research on Opinion Mining for Sentiment Classification of Micro-blog Text Based on DeBERTa," 2022 34th Chinese Con-trol and Decision Conference (CCDC), Hefei, China, 2022, pp. 5337-5340, https://doi.org/10.1109/CCDC55256.2022.10033688.
- S. Sushma et al., “Enhanced toxic comment detection model through Deep Learning models using Word embeddings and transformer architec-tures”, futech, vol. 4, no. 3, pp. 76–84, May 2025. https://doi.org/10.55670/fpll.futech.4.3.8.
- A. Lakshmanarao, A. Srisaila and T. S. R. Kiran, "Twitter Sentiment Classification with Deep Learning LSTM for Airline Tweets," 2022 8th Inter-national Conference on Advanced Computing and Communication Systems (ICACCS), Coimbatore, India, 2022, pp. 520-524, https://doi.org/10.1109/ICACCS54159.2022.9785208.
- https://www.kaggle.com/c/jigsaw-multilingual-toxic-comment-classification/data.
-
Downloads
-
How to Cite
Sushma , S. ., Nayak , S. K. ., & Krishna , D. M. V. . (2025). Advanced Toxic Comment Classification Using Multi-Architecture Generative AI Techniques. International Journal of Basic and Applied Sciences, 14(4), 499-507. https://doi.org/10.14419/ty9xvz92
