Reflex-Guard: A Low-Latency Guardrail for LLM Prompt Safety Using Dense Semantic Embeddings
作者: Istiaque Ahmed, Afia Anjum Borsha, Ranat Das Prangon, Abu-fuad Ahmad, Thi Hong Tran
分类: cs.CR, cs.CL, cs.LG
发布日期: 2026-08-18
💡 一句话要点
提出Reflex-Guard以解决LLM提示安全性问题
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 大型语言模型 提示安全 低延迟 本地处理 快速分类器 数据隐私 自然语言处理
📋 核心要点
- 现有的提示安全控制方法存在高延迟和数据隐私问题,无法满足实时应用需求。
- Reflex-Guard通过本地运行,结合监狱意识预处理和快速分类器,实现低延迟的提示安全过滤。
- 实验结果表明,Reflex-Guard在有害提示检测中实现了95.9%的召回率,延迟仅为37.6毫秒,性能优于现有方法。
📝 摘要(中文)
大型语言模型(LLMs)在实际应用中面临着特制提示绕过安全控制的风险。现有的保护方法,如LLM-as-a-judge和基于云的安全API,虽然能够检测不安全内容,但通常会导致每个请求延迟250-900毫秒,这对于实时应用来说过高。本文提出了Reflex-Guard,这是一种轻量级的本地保护措施,利用监狱意识预处理、紧凑的句子变换器嵌入和七个快速二元分类器,实现高准确率的提示安全过滤,且延迟显著低于现有解决方案。通过对30,568个样本的系统评估,Reflex-Guard在有害提示上实现了95.9%的召回率,端到端延迟为37.6毫秒,显著快于现有基线。
🔬 方法详解
问题定义:本文旨在解决大型语言模型在实际应用中因特制提示而导致的安全风险,现有方法在延迟和数据隐私方面存在显著不足。
核心思路:Reflex-Guard的核心思路是通过本地运行的轻量级架构,结合监狱意识预处理和快速分类器,来实现高效的提示安全过滤,降低响应延迟。
技术框架:整体架构包括三个主要模块:监狱意识预处理模块、句子变换器嵌入模块和七个快速二元分类器。数据首先经过预处理,然后生成嵌入,最后通过分类器进行安全性判断。
关键创新:Reflex-Guard的关键创新在于其低延迟和高准确率的结合,能够在本地快速处理提示,避免了现有方法的延迟和隐私问题。
关键设计:在设计中,使用了紧凑的句子变换器嵌入和七个快速二元分类器,优化了参数设置以提高检测效率,特别是在处理特定攻击类型时调整了阈值以优化检测效果。
🖼️ 关键图片
📊 实验亮点
实验结果显示,Reflex-Guard在有害提示检测中实现了95.9%的召回率,端到端延迟仅为37.6毫秒,显著快于Llama Guard 2(255毫秒)和SafeDecoding(723毫秒)。此外,Reflex-Guard在不同攻击类型的检测中表现出色,特别是在GCG后缀攻击和Base64编码提示的检测中均达到100%。
🎯 应用场景
Reflex-Guard可广泛应用于需要实时响应的自然语言处理系统,如聊天机器人、在线客服和内容审核等领域。其低延迟和高准确率的特性使其在保护用户数据隐私的同时,能够有效防止恶意提示,提升系统的安全性和用户体验。
📄 摘要(原文)
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.