arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2506.06384cs.CLcs.AI
收藏

融合预训练模型与启发式特征工程的提示注入检测方法

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

Zhengzhou University(郑州大学)

Yi Ji, Runzhi Li, Baolei Mao

AI总结:

针对提示注入攻击跨模型检测难题,本文提出融合DeBERTa-v3-base语义特征与启发式结构特征的DMPI-PMHFE双通道框架,提升检测性能并降低主流LLM攻击成功率。

摘要:

随着大型语言模型(LLM)的广泛应用,提示注入攻击已成为一项重大安全威胁。现有防御机制往往在有效性与泛化能力之间面临关键权衡,这凸显出迫切需要适用于多种LLM的高效提示注入检测方法。为应对这一挑战,我们提出DMPI-PMHFE,这是一种双通道特征融合检测框架。它将预训练语言模型与启发式特征工程相结合,用于检测提示注入攻击。具体而言,该框架采用DeBERTa-v3-base作为特征提取器,将输入文本转换为富含上下文信息的语义向量。同时,我们基于已知攻击模式设计启发式规则,以提取攻击中常见的显式结构特征。随后,来自两个通道的特征被融合,并通过全连接神经网络生成最终预测。这种双通道方法缓解了仅依赖DeBERTa提取特征的局限。在多个基准数据集上的实验结果表明,DMPI-PMHFE在准确率、召回率和F1分数方面优于现有方法。此外,在实际部署时,它显著降低了GLM-4、LLaMA 3、Qwen 2.5和GPT-4o等主流LLM上的攻击成功率。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑