Cyberbullying Detection in Social Media Text using Transformer based Learning Models

Authors

  • Zahid Mehmood Department of Applied Computing Technologies, UCP, Lahore, Pakistan. Email: L1F23MSDS0001@ucp.edu.pk
  • Ali Saeed Department of Software Engineering, FOIT, UCP, Lahore, Pakistan Email: Ali.saeed@ucp.edu.pk

DOI:

https://doi.org/10.63163/jpehss.v3i4.970

Abstract

Cyberbullying on social media isn't a monolithic problem; it strikes people from all sides, including age, gender, ethnicity, and religion. As a result, moderation workflows clearly need fine-grained detection. Using the cyberbullying_tweets dataset (47,692 samples in stratified 70/15/15 splits), this paper benchmarks transformer-based learning models in the space of 6-class cyberbullying detection. The comparison examines two different paths. There's supervised fine-tuning via a QLoRA-style recipe with LoRA adapters and 4-bit NF4 quantization. Second is few-shot in-context learning based on chain-of-thought prompting and 12 examples per class (72 overall). This was done in eight instruction-tuned LLMs, including Qwen2.5 7B/8B, DeepSeek 7B/8B, Llama-3 7B/8B, Mistral-7B, and Mixtral-8x7B. Macro-F1 scores under supervised fine-tuning ranged from 0.809 to 0.857, which are identical to the accuracy range. The excellent model Mixtral-8x7B-Instruct reached macro-F1 0.857, with MCC 0.808, AUPRC 0.911, and a small calibration error (ECE 0.021). Few-shot prompting wasn't far behind, with macro-F1 between 0.770 and 0.820. The difference is usually only 0.03-0.04 compared to fine-tuning, but it significantly reduces training compute. In general, these results assess the trade-off between cost and performance and establish a reproducible baseline for transformer-based moderation.

Downloads

Published

2025-12-25

How to Cite

Cyberbullying Detection in Social Media Text using Transformer based Learning Models. (2025). Physical Education, Health and Social Sciences, 3(4), 801-816. https://doi.org/10.63163/jpehss.v3i4.970