Detection Method for Prompt Injection by Integrating Pre-trained Model and Heuristic Feature Engineering
On the map: LLM safety and security → Prompt injection and agent security
Abstract (arXiv)
With the widespread adoption of Large Language Models (LLMs), prompt injection attacks have emerged as a significant security threat. Existing defense mechanisms often face critical trade-offs between effectiveness and generalizability. This highlights the urgent need for efficient prompt injection detection methods that are applicable across a wide range of LLMs. To address this challenge, we propose DMPI-PMHFE, a dual-channel feature fusion detection framework. It integrates a pretrained language model with heuristic feature engineering to detect prompt injection attacks. Specifically, the framework employs DeBERTa-v3-base as a feature extractor to transform input text into semantic vectors enriched with contextual information. In parallel, we design heuristic rules based on known attack patterns to extract explicit structural features commonly observed in attacks. Features from both channels are subsequently fused and passed through a fully connected neural network to produce the final prediction. This dual-channel approach mitigates the limitations of relying only on DeBERTa to extract features. Experimental results on diverse benchmark datasets demonstrate that DMPI-PMHFE outperforms existing methods in terms of accuracy, recall, and F1-score. Furthermore, when deployed actually, it significantly reduces attack success rates across mainstream LLMs, including GLM-4, LLaMA 3, Qwen 2.5, and GPT-4o.
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 21 of its 25 references that are in the map. First posted on arXiv 5 Jun 2025.
Builds on
21 of 25 references.
Closest ancestors · 8
Same direction, newest first
- 2024InjecGuard: Benchmarking and Mitigating Over-defense in Prompt Injection Guardrail Models30 Oct
- 2024Applying Pre-trained Multilingual BERT in Embeddings for Improved Malicious Prompt Injection Attacks Detection20 Sep
- 2024StruQ: Defending Against Prompt Injection with Structured Queries9 Feb
- 2024Security and Privacy Challenges of Large Language Models: A Survey30 Jan
- 2023Jatmo: Prompt Injection Defense by Task-Specific Finetuning29 Dec
- 2023Formalizing and Benchmarking Prompt Injection Attacks and Defenses19 Oct
- 2023LLM Self Defense: By Self Examination, LLMs Know They Are Being Tricked14 Aug
- 2023Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection23 Feb
Other references · 13
- 2023GPT-4 Technical Reportcited by 18,132
- 2022Training language models to follow instructions with human feedbackcited by 15,712
- 2023Direct Preference Optimization: Your Language Model is Secretly a Reward Modelcited by 7,916
- 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,304
- 2017Deep reinforcement learning from human preferencescited by 3,846
- 2021DeBERTaV3: Improving DeBERTa using ELECTRA-Style Pre-Training with Gradient-Disentangled Embedding Sharingcited by 1,219
- 2022Ignore Previous Prompt: Attack Techniques For Language Modelscited by 760
- 2023MusicLM: Generating Music From Textcited by 442
- 2023A Survey on Large Language Model (LLM) Security and Privacy: The Good, the Bad, and the Uglycited by 380
- 2023AudioGPT: Understanding and Generating Speech, Music, Sound, and Talking Headcited by 264
- 2021Understanding the Capabilities, Limitations, and Societal Impact of Large Language Modelscited by 159
- 2024Understanding Large-Language Model (LLM)-powered Human-Robot Interactioncited by 43
Built on by
Citing papers per year: 2026: 4.
4 papers.
- 2026SkillMutator: Benchmarking and Defending Language-and-Code Cross-modal Attacks on LLM Agent Skillscited by 5
- 2026Zero-Shot Embedding Drift Detection: A Lightweight Defense Against Prompt Injections in LLMscited by 2
- 2026CrackedPDFs: A Controlled Benchmark for Hidden Prompt Injection in PDFscited by 0
- 2026Prompt Injection Detection for Email Agents Through Attack Chain Modelingcited by 0
- 2026Prompt Injection Detection for Email Agents Through Attack Chain Modeling25 Sep 2026
- 2026CrackedPDFs: A Controlled Benchmark for Hidden Prompt Injection in PDFs3 Jul 2026
- 2026SkillMutator: Benchmarking and Defending Language-and-Code Cross-modal Attacks on LLM Agent Skills12 Jun 2026
- 2026Zero-Shot Embedding Drift Detection: A Lightweight Defense Against Prompt Injections in LLMs18 Jan 2026