To address prompt injection threats in LLMs, we propose DMPI-PMHFE, a dual-channel feature fusion framework that integrates DeBERTa with heuristic feature engineering. The framework transforms input text into semantic vectors while extracting explicit structural features through attack-pattern-based heuristic rules. Features from both channels are fused via fully connected networks for final classification. This approach mitigates limitations of single-channel feature extraction. Experimental results demonstrate that DMPI-PMHFE outperforms existing methods in accuracy, recall, and F1-score across diverse benchmark datasets. When deployed on mainstream LLMs (GLM-4, LLaMA 3, Qwen 2.5, and GPT-4o), it significantly reduces attack success rates.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Detection Method for Prompt Injection by Integrating Pre-trained Model and Heuristic Feature Engineering

  • Yi Ji,
  • Runzhi Li,
  • Baolei Mao

摘要

To address prompt injection threats in LLMs, we propose DMPI-PMHFE, a dual-channel feature fusion framework that integrates DeBERTa with heuristic feature engineering. The framework transforms input text into semantic vectors while extracting explicit structural features through attack-pattern-based heuristic rules. Features from both channels are fused via fully connected networks for final classification. This approach mitigates limitations of single-channel feature extraction. Experimental results demonstrate that DMPI-PMHFE outperforms existing methods in accuracy, recall, and F1-score across diverse benchmark datasets. When deployed on mainstream LLMs (GLM-4, LLaMA 3, Qwen 2.5, and GPT-4o), it significantly reduces attack success rates.