arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2506.07330cs.LGcs.AIcs.CR
收藏

JavelinGuard:面向 LLM 安全的低成本 Transformer 架构

JavelinGuard: Low-Cost Transformer Architectures for LLM Security

Yash Datta, Sharath Rajasekar

AI总结:

本文提出 JavelinGuard 低成本 Transformer 架构族,用于检测 LLM 交互中的恶意意图,并在九个对抗数据集上验证其相较开源护栏模型和 gpt-4o 的准确率、延迟与成本优势。

摘要:

我们提出 JavelinGuard,这是一套低成本、高性能的模型架构,旨在检测大语言模型(LLM)交互中的恶意意图,并专门针对生产部署进行了优化。近期 Transformer 架构的进展,包括紧凑型 BERT(Devlin 等人,2019)变体(例如 ModernBERT(Warner 等人,2024)),使我们能够构建仅需约 400M 参数的高精度分类器,并且即使在标准 CPU 硬件上也能实现快速推理。我们系统地探索了五种复杂度逐步提升的基于 Transformer 的架构:Sharanga(基线 Transformer 分类器)、Mahendra(具有更深层头部的增强注意力加权池化)、Vaishnava 和 Ashwina(混合神经集成架构),以及 Raudra(带有专用损失函数的先进多任务框架)。我们在九个多样化的对抗性数据集上对模型进行了严格基准测试,包括 NotInject 系列、BIPIA、Garak、ImprovedLLM、ToxicChat、WildGuard 等常用数据集,以及我们新引入的 JavelinBench;后者专门用于测试在具有挑战性的边界案例和困难负样本上的泛化能力。此外,我们将所提架构与领先的开源护栏模型以及 gpt-4o 等大型仅解码器 LLM 进行比较,证明其在准确率和延迟方面具有更优的成本-性能权衡。研究结果表明,尽管 Raudra 的多任务设计总体上提供了最稳健的性能,但每种架构在速度、可解释性和资源需求方面都呈现出独特的权衡,可指导从业者在真实 LLM 安全应用中选择复杂度与效率的最佳平衡。

英文摘要:

We present JavelinGuard, a suite of low-cost, high-performance model architectures designed for detecting malicious intent in Large Language Model (LLM) interactions, optimized specifically for production deployment. Recent advances in transformer architectures, including compact BERT(Devlin et al. 2019) variants (e.g., ModernBERT (Warner et al. 2024)), allow us to build highly accurate classifiers with as few as approximately 400M parameters that achieve rapid inference speeds even on standard CPU hardware. We systematically explore five progressively sophisticated transformer-based architectures: Sharanga (baseline transformer classifier), Mahendra (enhanced attention-weighted pooling with deeper heads), Vaishnava and Ashwina (hybrid neural ensemble architectures), and Raudra (an advanced multi-task framework with specialized loss functions). Our models are rigorously benchmarked across nine diverse adversarial datasets, including popular sets like the NotInject series, BIPIA, Garak, ImprovedLLM, ToxicChat, WildGuard, and our newly introduced JavelinBench, specifically crafted to test generalization on challenging borderline and hard-negative cases. Additionally, we compare our architectures against leading open-source guardrail models as well as large decoder-only LLMs such as gpt-4o, demonstrating superior cost-performance trade-offs in terms of accuracy, and latency. Our findings reveal that while Raudra's multi-task design offers the most robust performance overall, each architecture presents unique trade-offs in speed, interpretability, and resource requirements, guiding practitioners in selecting the optimal balance of complexity and efficiency for real-world LLM security applications.

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

↑