Skip to content
#machine learning #cybersecurity Preprint Open access

Prompt Injection Detection using DeBERTa-v3: A Position-Neutral Dataset for AI Security

Mirza Akhi
Nov 2026
Machine Learning Cybersecurity

Abstract

Prompt injection attacks attempt to override application-provided instructions and redirect Large Language Models (LLMs) towards attacker-specified behaviour, posing an Artificial Intelligence (AI) security threat. Defending against these attacks commonly involves classifiers that distinguish malicious from benign prompts. However, existing classifiers often achieve high accuracy on datasets whose training and test samples share attack categories or textual patterns. This overlap obscures whether a model learns malicious intent or recognises familiar patterns. To address the limitation, this research proposes a synthetic prompt injection dataset spanning 16 categories, in which each prompt's class is defined by the intent of its instruction rather than its position or attack vocabulary (e.g., ignore). Benign and malicious instructions appear within and outside the quoted content block. This position-neutral design ensures that an instruction's location alone cannot determine whether a prompt is benign or malicious. The proposed dataset also includes hard negatives, benign prompts that contain attack terminology. To evaluate generalisation beyond known threats, an attack-type-held-out strategy excludes obfuscation, payload splitting, and multilingual attacks from training. This research fine-tunes a DeBERTa-v3-base classifier, which achieves 75.5% accuracy under that strategy. The same model configuration, trained on a random 90:10 split, scores 100% on its test portion. An ablation study traces this gap to attack-type exposure, which affects detection more than training-set size or model capacity. On the public deepset/prompt-injections dataset, the fine-tuned and ProtectAI classifiers each detect fewer than half the injections. These results demonstrate that classifier-based cybersecurity defences for LLM-integrated applications depend on the attack types covered in training.

View source

Similar papers

#artificial intelligence Preprint Jul 2024

The Llama 3 Herd of Models

It is found that Llama 3 delivers comparable quality to leading language models such as GPT-4 on a plethora of tasks, and performs competitively with the state-of-the-art on image, video, and speech recognition tasks.

Aaron Grattafiori, Abhimanyu Dubey, Abhinav Jauhri et al. · 21,082 citations · ⚡3,832
#artificial intelligence Conference Open access Jun 2018

Gibson Env: Real-World Perception for Embodied Agents

This paper investigates developing real-world perception for active agents, proposes Gibson Environment for this purpose, and showcases a set of perceptual tasks learned therein.

F. Xia, Amir Zamir, Zhi-Yang He et al. · 1,069 citations · ⚡112
#machine learning Review Open access Oct 2014

Software development in startup companies: A systematic mapping study

The results indicate that software engineering work practices are chosen opportunistically, adapted and configured to provide value under the constrains imposed by the startup context.

Nicolò Paternoster, Carmine Giardino, M. Unterkalmsteiner et al. · 394 citations · ⚡54

Diffusion models as plug-and-play priors

The possibility of inferring high-dimensional data inference in a model that consists of a prior and an auxiliary differentiable constraint given some additional information is considered, thereby allowing a range of potential applications in adapting models to new domains and tasks.

Alexandros Graikos, Esmeralda S. Whitammer, N. Jojic et al. · 316 citations · ⚡15

Trajectory Balance: Improved Credit Assignment in GFlowNets

It is proved that any global minimizer of the trajectory balance objective can define a policy that samples exactly from the target distribution, and empirically demonstrate the benefits of the trajectories balance objective for GFlowNet convergence, diversity of generated samples, and robustness to long action sequenc...

Esmeralda S. Whitammer, Moksh Jain, Emmanuel Bengio et al. · 302 citations · ⚡60

Related blog posts

Microsoft Research Blog Nov 3, 2026

Learn the rules: The hacker mindset

Research Manager Mike Walker reflects on a career spanning hacker culture, cybersecurity, and AI, sharing lessons about trust, teamwork, leadership, and why solving difficult problems requires curiosity, judgment, agility—and an understanding of the rules. The post Learn the rules: The hacker mindset appeared first on Microsoft Research.

Microsoft Research Blog Nov 30, 2026

Forgotten, or just hidden? Stress testing how AI models unlearn

When AI “forgets,” is the information really gone? Standard tests can suggest an AI model has successfully forgotten specific information. A controlled Microsoft Research study found a different picture when researchers changed the questions and used strategic prompts. The findings point to a gap between looking like information is forgotten and making it resistant to recovery. The post Forgotten, or just hidden? Stress testing how AI models unlearn appeared first on Microsoft Research.

MIT News · Artificial Intelligence Nov 17, 2026

Learning the language of machine learning

By studying the computational foundations of language learning, Associate Professor Jacob Andreas builds intelligent systems that can communicate effectively with humans.

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.