arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2510.14005cs.CRcs.LG
收藏

PIShield: 通过内在LLM特性检测提示注入攻击

PIShield: Detecting Prompt Injection Attacks via Intrinsic LLM Features

Pennsylvania State University(宾夕法尼亚州立大学);Duke University(杜克大学)

Wei Zou, Yupei Liu, Yanting Wang, Ying Chen, Neil Gong, Jinyuan Jia

AI总结:

PIShield通过利用指令微调LLM的内部表示,高效检测提示注入攻击,显著优于现有方法。

摘要:

集成大语言模型的应用容易受到提示注入攻击的影响,攻击者通过污染输入来注入恶意指令,导致LLM按照攻击者的意图而非原始用户的意图执行。现有的提示注入检测方法往往性能不佳或计算开销大。在本文中,我们提出了PIShield,一种基于观察到的指令微调LLM内部编码可区分信号的高效检测方法。PIShield利用残差流表示和一个简单的线性分类器来检测提示注入,无需昂贵的模型微调或响应生成。我们在多样化的短文本和长上下文基准上进行了广泛评估。结果表明,PIShield始终实现了低的误报率和误检率,显著优于现有基线。这些发现表明,指令微调LLM的内部表示为现实应用中的提示注入检测提供了强大而实用的基础。

英文摘要:

LLM-integrated applications are vulnerable to prompt injection attacks, where an attacker contaminates the input to inject malicious instructions, causing the LLM to follow the attacker's intent instead of the original user's. Existing prompt injection detection methods often have sub-optimal performance and/or high computational overhead. In this work, we propose PIShield, an effective and efficient detection method based on the observation that instruction-tuned LLMs internally encode distinguishable signals for prompts containing injected instructions. PIShield leverages residual-stream representations and a simple linear classifier to detect prompt injection, without expensive model fine-tuning or response generation. We conduct extensive evaluations on a diverse set of short- and long-context benchmarks. The results show that PIShield consistently achieves low false positive and false negative rates, significantly outperforming existing baselines. These findings demonstrate that internal representations of instruction-tuned LLMs provide a powerful and practical foundation for prompt injection detection in real-world applications.

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

↑