Prompt Injection Detection Using Ensemble of BERT and LSTM with GloVe Embeddings

Md. Main Oddin Chisty, Abu Noman Sakib, Md Somir Khan, Md. Badiuzzaman Shuvo · 2024

The main contribution of this work is a new approach to prompt injection detection in NLP, done by ensembling BERT with LSTMs on top of GloVe embeddings that enhance them. We first show the efficiency of our approach on DeepSet Prompt Injections by comparing the performances of the models used in our study to the state-of-the-art on this dataset. Indeed, we obtained a final accuracy of $92.24 \%$ for an AUC-ROC of 0.994. Our approach leverages the strength of transformer-based models, besides better RNNs and larger vocabulary coverage, backed by pre-trained word embeddings that enable the learning of semantic relationships. We further extend the performance evaluation of individual components and their synergistic effect in the ensemble for a deeper analysis of results showing our approach with the use of the ensemble method beating single models, hence providing a robust solution for prompt injection detection. We discuss the implications of our findings for improving the security of AI-driven conversational systems and indicate likely future directions of research in this important area of AI safety.

Read the paper · More papers on PaperTik