arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2312.10766cs.CR
收藏

JailGuard:面向基于 LLM 提示攻击的通用检测框架

JailGuard: A Universal Detection Framework for LLM Prompt-based Attacks

Xiaoyu Zhang, Cen Zhang, Tianlin Li, Yihao Huang, Xiaojun Jia, Ming Hu, Jie Zhang, Yang Liu, Shiqing Ma, Chao Shen

AI总结:

本文提出 JailGuard 通用检测框架,通过变异文本与图像输入并比较目标模型响应差异,识别越狱和劫持等提示攻击,显著提升跨模态检测准确率。

摘要:

由大型语言模型(LLM)和多模态大型语言模型(MLLM)驱动的系统与软件已在众多场景中发挥关键作用。然而,当前 LLM 系统容易受到基于提示的攻击:越狱攻击会使 LLM 系统生成有害内容,而劫持攻击则操纵 LLM 系统执行攻击者期望的任务,这凸显了检测工具的必要性。遗憾的是,现有检测方法通常是为特定攻击定制的,导致其在检测跨不同模态的各类攻击时泛化能力较差。为解决该问题,我们提出 JailGuard,这是一个部署在 LLM 系统之上的通用检测框架,用于检测文本和图像模态中基于提示的攻击。JailGuard 的工作原理是攻击样本本质上不如良性样本稳健。具体而言,JailGuard 会变异不可信输入以生成变体,并利用这些变体在目标模型上响应的差异,将攻击样本与良性样本区分开。我们为文本和图像输入实现了 18 个变异器,并设计了变异器组合策略,以进一步提高检测泛化能力。在包含 15 种已知攻击类型的数据集上的评估表明,JailGuard 在文本和图像输入上分别取得了 86.14%/82.90% 的最佳检测准确率,比最先进方法高出 11.81%-25.73% 和 12.20%-21.40%。

英文摘要:

The systems and software powered by Large Language Models (LLMs) and Multi-Modal LLMs (MLLMs) have played a critical role in numerous scenarios. However, current LLM systems are vulnerable to prompt-based attacks, with jailbreaking attacks enabling the LLM system to generate harmful content, while hijacking attacks manipulate the LLM system to perform attacker-desired tasks, underscoring the necessity for detection tools. Unfortunately, existing detecting approaches are usually tailored to specific attacks, resulting in poor generalization in detecting various attacks across different modalities. To address it, we propose JailGuard, a universal detection framework deployed on top of LLM systems for prompt-based attacks across text and image modalities. JailGuard operates on the principle that attacks are inherently less robust than benign ones. Specifically, JailGuard mutates untrusted inputs to generate variants and leverages the discrepancy of the variants' responses on the target model to distinguish attack samples from benign samples. We implement 18 mutators for text and image inputs and design a mutator combination policy to further improve detection generalization. The evaluation on the dataset containing 15 known attack types suggests that JailGuard achieves the best detection accuracy of 86.14%/82.90% on text and image inputs, outperforming state-of-the-art methods by 11.81%-25.73% and 12.20%-21.40%.

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

↑