arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2603.25176cs.CL
收藏

基于LLM-as-a-Judge和混合模型的提示攻击检测

Prompt Attack Detection with LLM-as-a-Judge and Mixture-of-Models

GovTech, Singapore(新加坡政府科技局)

Hieu Xuan Le, Benjamin Goh, Quy Anh Tang

AI总结:

本文探讨轻量级通用LLM在真实生产环境中作为安全判断者的可靠性,通过结构化推理过程检测提示攻击,实验表明Gemini-2.0-Flash-Lite-001等模型可有效用于实时防护,同时评估混合模型对攻击检测的提升效果。

摘要:

提示攻击,包括 jailbreaks 和 prompt injections,对大型语言模型(LLM)系统构成重大安全风险。在生产环境中,guardrails 必须在严格低延迟约束下缓解这些攻击,导致部署差距:轻量级分类器和基于规则的系统难以在分布偏移下泛化,而高容量 LLM-based 判决者则因太慢或成本高而无法实时执行。本文研究轻量级通用 LLM 是否能在真实生产约束下可靠地作为安全判断者。通过精心设计的提示和输出,轻量 LLM 被引导进行包含显式意图分解、安全信号验证、危害评估和自我反思的结构化推理过程。我们评估了结合真实世界聊天机器人良性查询和通过自动化红队行动(ART)生成的对抗性提示的定制数据集。结果表明,通用 LLM 如 Gemini-2.0-Flash-Lite-001 可作为有效低延迟判决者用于实时防护。此配置目前部署在新加坡公共服务聊天机器人中的集中式防护服务中。我们还评估了混合模型(MoM)设置,以评估聚合多个 LLM 判决者是否能提高提示攻击检测性能,相对于单模型判决者,仅观察到适度的提升。

英文摘要:

Prompt attacks, including jailbreaks and prompt injections, pose a critical security risk to Large Language Model (LLM) systems. In production, guardrails must mitigate these attacks under strict low-latency constraints, resulting in a deployment gap in which lightweight classifiers and rule-based systems struggle to generalize under distribution shift, while high-capacity LLM-based judges remain too slow or costly for live enforcement. In this work, we examine whether lightweight, general-purpose LLMs can reliably serve as security judges under real-world production constraints. Through careful prompt and output design, lightweight LLMs are guided through a structured reasoning process involving explicit intent decomposition, safety-signal verification, harm assessment, and self-reflection. We evaluate our method on a curated dataset combining benign queries from real-world chatbots with adversarial prompts generated via automated red teaming (ART), covering diverse and evolving patterns. Our results show that general-purpose LLMs, such as gemini-2.0-flash-lite-001, can serve as effective low-latency judges for live guardrails. This configuration is currently deployed in production as a centralized guardrail service for public service chatbots in Singapore. We additionally evaluate a Mixture-of-Models (MoM) setting to assess whether aggregating multiple LLM judges improves prompt-attack detection performance relative to single-model judges, with only modest gains observed.

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

↑