arXiv:2608.17556cs.CRcs.CL2026-08

本地低延迟检测恶意提示,37.6毫秒完成安全过滤。

Reflex-Guard: A Low-Latency Guardrail for LLM Prompt Safety Using Dense Semantic Embeddings

论文配图:Reflex-Guard: A Low-Latency Guardrail for LLM Prompt Safety Using Dense Semantic Embeddings
图 1 · 摘自论文原文
  • 用语义嵌入和七种快速分类器实现本地实时安全检测
  • 95.9%召回率下仅需37.6毫秒,远快于现有方案
  • 可识别编码攻击与结构化攻击,适合高实时性场景

大型语言模型在实际应用中常面临精心设计的绕过安全控制的提示攻击。现有防护方法如LLM作为裁判或云端安全API虽能检测不安全内容,但每请求延迟达250-900毫秒,难以满足实时性要求(通常需<100毫秒)。此外,通过外部审核接口路由用户提示也带来数据隐私风险。本文提出Reflex-Guard,一种轻量级本地运行的防护机制,结合狱中突破感知预处理、紧凑句向量嵌入及七个快速二分类器,实现高精度安全过滤。在由五个互补来源构建的30,568样本策略平衡数据集上评估显示,其端到端延迟仅为37.6毫秒,对有害提示召回率达95.9%。相比Llama Guard 2(255毫秒)和SafeDecoding(723毫秒)显著更快。默认阈值下可100%检测GCG后缀攻击和Base64编码提示;而针对DrAttack结构化提示,需将阈值降至0.03以获最优检测效果,因其产生独特概率分布。该方法取得高达16.79的反射效率得分(RES),显著优于Llama Guard 2(11.90)和SafeDecoding(9.80),揭示不同攻击类型在嵌入概率空间中占据不同区域。

原文摘要 · Abstract (English)

Large Language Models (LLMs) in real-world applications often face the risks of specially crafted prompts designed to bypass the safety controls. Existing guardrail methods, such as LLM-as-a-judge and cloud-based safety APIs are able to detect unsafe content. However, they often add a delay of about 250-900 ms to each request. This delay is too high for real-time applications, when the system usually needs to respond in less than 100 ms. Furthermore, routing user prompts through external moderation endpoints raises significant data privacy concerns. This paper introduces Reflex-Guard, a lightweight guardrail that runs locally. It uses jailbreak-aware preprocessing, compact sentence-transformer embeddings, and seven fast binary classifiers. Together, these components enable high-accuracy prompt safety filtering with much lower latency than existing solutions. Through systematic evaluation on a strategically balanced dataset of 30,568 samples drawn from five complementary sources, we demonstrate that Reflex-Guard achieves 95.9% recall on harmful prompts at 37.6 ms end-to-end latency. It is faster than existing baselines, including Llama Guard 2 at 255 ms and SafeDecoding at 723 ms. It can detect 100% of GCG suffix attacks and Base64-encoded prompts using the default threshold. However, DrAttack structured prompts required lowering the threshold to 0.03 for optimal detection, as they produced a distinct probability distribution. Reflex-Guard achieves Reflex Efficiency Score (RES) scores up to 16.79, significantly outperforming Llama Guard 2 (11.90) and SafeDecoding (9.80). This analysis offers practical deployment advice and shows that different attack types occupy distinct regions in the embedding probability space.

安全防护低延迟嵌入技术提示攻击

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