Fine-tuned Large Language Models (LLMs): Improved Prompt Injection Attacks Detection
On the map: LLM safety and security → Prompt injection and agent security
Abstract (arXiv)
Large language models (LLMs) are becoming a popular tool as they have significantly advanced in their capability to tackle a wide range of language-based tasks. However, LLMs applications are highly vulnerable to prompt injection attacks, which poses a critical problem. These attacks target LLMs applications through using carefully designed input prompts to divert the model from adhering to original instruction, thereby it could execute unintended actions. These manipulations pose serious security threats which potentially results in data leaks, biased outputs, or harmful responses. This project explores the security vulnerabilities in relation to prompt injection attacks. To detect whether a prompt is vulnerable or not, we follows two approaches: 1) a pre-trained LLM, and 2) a fine-tuned LLM. Then, we conduct a thorough analysis and comparison of the classification performance. Firstly, we use pre-trained XLM-RoBERTa model to detect prompt injections using test dataset without any fine-tuning and evaluate it by zero-shot classification. Then, this proposed work will apply supervised fine-tuning to this pre-trained LLM using a task-specific labeled dataset from deepset in huggingface, and this fine-tuned model achieves impressive results with 99.13% accuracy, 100% precision, 98.33% recall and 99.15% F1-score thorough rigorous experimentation and evaluation. We observe that our approach is highly efficient in detecting prompt injection attacks.
Key facts. Cited by 4 papers in the map (data through 7 Oct 2026). Placed in Prompt injection and agent security, one of 12 directions in LLM safety and security. Builds on 17 of its 39 references that are in the map. First posted on arXiv 28 Oct 2024.
Builds on
17 of 39 references.
Closest ancestors · 3
Same direction, newest first
- 2024Applying Pre-trained Multilingual BERT in Embeddings for Improved Malicious Prompt Injection Attacks Detection20 Sep
- 2023Prompt Injection attack against LLM-integrated Applications8 Jun
- 2023Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection23 Feb
Other references · 14
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2023GPT-4 Technical Reportcited by 18,132
- 2022Training language models to follow instructions with human feedbackcited by 15,712
- 2023Sparks of Artificial General Intelligence: Early experiments with GPT-4cited by 2,579
- 2023PaLM 2 Technical Reportcited by 1,154
- 2022Ignore Previous Prompt: Attack Techniques For Language Modelscited by 760
- 2023Whose Opinions Do Language Models Reflect?cited by 759
- 2023GPTEval: A Survey on Assessments of ChatGPT and GPT-4cited by 73
- 2018A Survey on Natural Language Processing for Fake News Detectioncited by 67
- 2022Exploring the Universal Vulnerability of Prompt-based Learning Paradigmcited by 56
- 2019Learning Hierarchical Discourse-level Structure for Fake News Detectioncited by 28
- 2023Embedding Democratic Values into Social Media AIs via Societal Objective Functionscited by 25
Built on by
Citing papers per year: 2025: 3; 2026: 1.
4 papers.
- 2025RTBAS: Defending LLM Agents Against Prompt Injection and Privacy Leakagecited by 64
- 2025Red Teaming the Mind of the Machine: A Systematic Evaluation of Prompt Injection and Jailbreak Vulnerabilities in LLMscited by 34
- 2025Evaluating the Robustness of Retrieval-Augmented Generation to Adversarial Evidence in the Health Domaincited by 5
- 2026SkillMutator: Benchmarking and Defending Language-and-Code Cross-modal Attacks on LLM Agent Skillscited by 5
- 2026SkillMutator: Benchmarking and Defending Language-and-Code Cross-modal Attacks on LLM Agent Skills12 Jun 2026
- 2025Evaluating the Robustness of Retrieval-Augmented Generation to Adversarial Evidence in the Health Domain4 Sep 2025
- 2025Red Teaming the Mind of the Machine: A Systematic Evaluation of Prompt Injection and Jailbreak Vulnerabilities in LLMs7 May 2025
- 2025RTBAS: Defending LLM Agents Against Prompt Injection and Privacy Leakage13 Feb 2025