Toward Quantum NLP: A Transfer Learning Based BERT Transformer- QML Framework for Spam Text Semantics Modeling
摘要
Large Language Models (LLMs) create new challenges in detecting harmful text. Their generative abilities can mimic patterns found in spam or smishing messages which puts users at risk. This paper introduces a hybrid quantum-classical method for SMS spam detection. The approach combines bert transformer-based language models with variational quantum circuits. Different BERT-based models have been evaluated on the Smish text to extract rich contextual embeddings. These embeddings are fed into a quantum state, which is then processed by a parameterized quantum circuit designed using a VQC ansatz with full entanglement. The circuit learns to classify spam using Pauli-Z measurement outcomes over multiple runs. The proposed model achieved a significantly higher F1-score, performing approximately 10–15% better than classical baselines such as DistilBERT, standard BERT and LSTM-based models. These results highlight the potential of hybrid quantum systems in addressing natural language tasks especially in resource constrained or low-data scenarios. Future work will explore scaling the architecture with deeper quantum layers and alternative feature maps such as quantum kernels. Additionally, deploying the model on noisy intermediate-scale quantum (NISQ) hardware and extending the approach to multiclass and multilingual sentiment analysis represent promising directions for further research.