GuardNet: Ensemble Strategies of Shallow Neural Networks for Robust Prompt Injection and Jailbreak Detection

📄 arXiv: 2606.05566v1 📥 PDF

作者: Paulo Ricardo Ferreira Neves, Edson Rodrigues da Cruz Filho, Paulo Henrique Eleuterio Falsetti, João Vitor Pavan, Ian Degaspari, Henrique Vieira Laturrague, Patrick Vieira Laturrague, Guilherme Nielsen Dias, Marccello Wilson Perez Berto, Gustavo Voltani Von Atzingen

分类: cs.AI, cs.CR

发布日期: 2026-06-04


💡 一句话要点

提出GuardNet以解决大语言模型的Prompt Injection和Jailbreak攻击问题

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 大语言模型 Prompt Injection Jailbreak攻击 浅层神经网络 集成学习 鲁棒性 阈值校准 实时检测

📋 核心要点

  1. 现有的大语言模型在面对Prompt Injection和Jailbreak攻击时表现脆弱,且基准评估结果可能受到信息泄露的影响。
  2. GuardNet通过集成多个浅层神经网络(BiLSTMs)来增强对抗鲁棒性,强调示例多样性和阈值校准的重要性。
  3. 实验结果显示,GuardNet在盲数据集上获得了0.747的AUROC和0.92的F1分数,且在CPU上平均延迟约为50毫秒,适合实际应用。

📝 摘要(中文)

大型语言模型(LLMs)在自然语言处理领域取得了显著进展,但仍然容易受到Prompt Injection(PI)和Jailbreak(JB)攻击。此外,基准评估可能受到污染和部分信息泄露的影响,从而影响性能估计。本文提出了GuardNet,一个基于浅层神经网络(BiLSTMs)集成的防护系统,约有4700万参数。我们探讨了在对抗场景中,鲁棒性更依赖于示例覆盖的多样性和阈值校准,而非模型规模。结果表明,GuardNet在轻量级检测器中表现出竞争力,并在低延迟下具有高效率,尽管较大的LLMs如Mistral-7B和Llama-3.1-8B在F1分数和AUROC上仍然表现优越。GuardNet在盲数据集上实现了0.747的AUROC和0.92的F1分数,适合在成本和基础设施受限的生产环境中部署。

🔬 方法详解

问题定义:本文旨在解决大型语言模型在Prompt Injection和Jailbreak攻击下的脆弱性,现有方法在对抗场景中表现不佳,且基准评估受到信息泄露的影响。

核心思路:GuardNet的核心思路是通过集成多个浅层神经网络(BiLSTMs)来提高系统的鲁棒性,认为示例的多样性和阈值的精确校准比单一模型的规模更为重要。

技术框架:GuardNet的整体架构包括多个BiLSTM网络的集成,每个网络负责处理不同类型的输入示例,系统通过阈值校准来优化检测性能。

关键创新:GuardNet的主要创新在于其集成策略和对阈值校准的重视,这与传统依赖于大型模型的检测方法形成鲜明对比。

关键设计:在设计中,GuardNet采用了约4700万的参数配置,使用特定的损失函数来优化模型性能,同时确保在低延迟下运行,适合生产环境的需求。

📊 实验亮点

实验结果显示,GuardNet在盲数据集上实现了0.747的AUROC和0.92的F1分数,表现出色。尽管较大的语言模型在某些基准上表现更佳,GuardNet在轻量级检测器中仍展现出竞争力,且在CPU上平均延迟仅为50毫秒,适合实际应用。

🎯 应用场景

GuardNet的研究成果在多个领域具有潜在应用价值,尤其是在需要高安全性和实时响应的自然语言处理系统中。其高效的检测能力使其适合用于在线聊天机器人、内容审核和安全监控等场景,能够有效防止恶意攻击和信息泄露。

📄 摘要(原文)

Large Language Models (LLMs) have transformed natural language processing, but they remain vulnerable to Prompt Injection (PI) and Jailbreak (JB) attacks. In addition, benchmark evaluations may be affected by contamination and partial information leakage, compromising performance estimates. This work presents GuardNet, a guardrail system based on an ensemble of shallow neural networks (BiLSTMs) with approximately 47 million parameters. We investigate the hypothesis that robustness in adversarial scenarios depends more on the diversity of example coverage and threshold calibration than on model scale. The results indicate that GuardNet achieves competitive performance compared with lightweight detectors and high efficiency at low latency, although larger LLMs such as Mistral-7B and Llama-3.1-8B still achieve superior performance in terms of F1 score and AUROC on the blind JBB-Behaviors benchmark. Nevertheless, GuardNet achieves an AUROC of 0.747 on the blind dataset (n = 200) and an F1 score of 0.92 on a proprietary benchmark (n = 50), under threshold calibration and evaluation with declared partial information leakage. The system operates with an average latency of approximately 50 ms on CPU, making it suitable for deployment in production environments with cost and infrastructure constraints.