arXiv:2603.25176cs.CL2026-03被引 1

用轻量大模型做实时安全检测,有效识别提示词攻击

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

  • 设计结构化推理流程,让小模型分步判断意图与危害
  • 在真实数据集上实现低延迟高准确率的攻击检测
  • 已部署于新加坡公共服务聊天系统,适合生产环境

提示词攻击(如越狱和注入)对大语言模型系统构成重大安全威胁。在实际部署中,防护机制需在严格低延迟要求下运行,导致轻量级分类器和规则系统在分布偏移下泛化能力差,而高容量大模型法官因速度慢或成本高难以用于实时防护。本文研究轻量通用大模型是否可在真实生产环境中可靠充当安全审查员。通过精心设计的提示与输出格式,引导轻量模型进行显式意图分解、安全信号验证、危害评估与自我反思的结构化推理过程。我们在一个融合真实聊天数据与自动化红队生成对抗性提示的精选数据集上评估方法,涵盖多样且持续演化的攻击模式。结果表明,通用大模型如 gemini-2.0-flash-lite-001 可作为低延迟的有效实时审查工具。该方案目前已部署为新加坡公共服务聊天机器人的集中式防护服务。此外,我们还评估了多模型集成(MoM)设置,发现其相对于单模型仅带来小幅性能提升。

原文摘要 · Abstract (English)

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.

大模型安全提示攻击轻量模型实时检测

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。