Large Language Models (LLMs) are increasingly utilized across a wide range of artificial intelligence applications, but their growing adoption also introduces security concerns related to malicious prompts that may manipulate model behavior. This study investigates an optimized Word2Vec-BiLSTM approach for detecting binary malicious prompts using the Malicious Prompt Detection Dataset (MPDD). Four deep learning configurations, namely FastText-BiLSTM, FastText-BiGRU, Word2Vec-BiLSTM, and Word2Vec-BiGRU, were evaluated alongside a TF-IDF combined with Logistic Regression (LogReg) baseline under consistent experimental conditions and across three random seeds. Bayesian Optimization was applied to identify effective hyperparameter configurations and quantify performance differences between manually configured and optimized models. The models were evaluated using precision, recall, F1-score, accuracy, false-positive rate (FPR), false-negative rate (FNR), precision-recall area under the curve (PR-AUC), and computational cost. The optimized Word2Vec-BiLSTM with seed 128 achieved the highest overall performance across the primary classification metrics: 97.03% precision, 96.86% recall, 96.89% F1-score, and 96.89% accuracy, along with an FPR of 0.0070, an FNR of 0.0557, and a PR-AUC of 99.39%. The optimized deep learning models generally outperformed the TF-IDF + LogReg baseline and exhibited relatively similar computational characteristics across the evaluated deep learning configurations. These findings demonstrate that Bayesian hyperparameter optimization can improve the performance of the Word2Vec-BiLSTM model for binary malicious prompt detection within the MPDD-based experimental setting.
Copyrights © 2026