Tailored Large Language Models for Spam Detection: From Model Customization to Benchmarking Effectiveness
Amani Shatnawi, Anas Alsobeh, Izzat Mahmoud Alsmadi, Bilal I. Al-Ahmad · 2025
Spam detection remains a critical cybersecurity challenge as spam threats grow increasingly sophisticated. This research systematically customizes and benchmarks tailored Large Language Models (LLMs), including Spam-T5, across twelve diverse spam datasets. Our experiments achieve near-perfect results with 99.98% accuracy, precision, recall, and F1-score. Comparative analyses using regression models (Random Forest, Gradient Boosting, Linear Regression) further validate the predictive effectiveness of tailored LLMs, substantially outperforming traditional machine learning baselines. Explainable AI (XAI) techniques, specifically SHAP analysis, reveal F1-score and recall as the dominant predictors of model performance. The findings highlight the role of dataset diversity and feature balancing in achieving robust, interpretable spam detection models.