Ensuring safe, policy-compliant outputs from large language models requires real-time content moderation that can scale across multiple safety dimensions. However, state-of-the-art guardrail models rely on autoregressive decoders with 7B--27B parameters, reformulating what is fundamentally a classification problem as sequential text generation, a design choice that incurs high latency and scales poorly to multi-aspect evaluation. In this work, we introduce \textbf{GLiGuard}, a 0.3B-parameter schema-conditioned bidirectional encoder adapted from GLiNER2 for LLM content moderation. The key idea is to encode task definitions and label semantics directly into the input sequence as structured token schemas, enabling simultaneous evaluation of prompt safety, response safety, refusal detection, 14 fine-grained harm categories, and 11 jailbreak strategies in a single non-autoregressive forward pass. This schema-conditioned design lets supported task and label blocks be composed directly in the input schema at inference time. Across nine established safety benchmarks, GLiGuard achieves F1 scores competitive with 7B--27B decoder-based guards despite being 23--90$\times$ smaller, while delivering up to 16$\times$ higher throughput and 17$\times$ lower latency. These results suggest that compact bidirectional encoders can approach the accuracy of much larger guard models while drastically reducing inference cost. Code and models are available at https://github.com/fastino-ai/GLiGuard.


翻译:[translated abstract in Chinese] 确保大语言模型的安全、符合策略输出需要进行实时内容审核,该审核需能扩展至多个安全维度。然而,现有最先进的防护模型依赖具有7B至27B参数的自回归解码器,将本质上属于分类问题简化为序列文本生成,这种设计选择导致高延迟并难以扩展至多维度评估。本文提出 \textbf{GLiGuard}——一种基于GLiNER2改进的0.3B参数模式条件双向编码器,用于大语言模型内容审核。核心思路是将任务定义与标签语义直接编码至输入序列作为结构化标记模式,使其能在单次非自回归前向传播中同时评估提示安全性、响应安全性、拒绝检测、14个细粒度危害类别及11种越狱策略。这种模式条件设计使得支持的任务和标签模块可在推理时直接组合至输入模式中。在九个成熟安全基准测试中,尽管GLiGuard体积仅有7B至27B解码器防护模型的23至90分之一,其F1分数与之相当,同时吞吐量提升高达16倍、延迟降低17倍。结果表明紧凑型双向编码器可在显著降低推理成本的同时,达到与更大规模防护模型相当的准确率。代码与模型已发布于https://github.com/fastino-ai/GLiGuard。

0
下载
关闭预览

相关内容

《国防领域安全采用大语言模型的战略蓝图》
专知会员服务
21+阅读 · 6月6日
158页!天大等最新《大型语言模型安全:全面综述》
专知会员服务
51+阅读 · 2024年12月24日
大语言模型中的提示隐私保护
专知会员服务
24+阅读 · 2024年7月24日
《大型语言模型保护措施》综述
专知会员服务
29+阅读 · 2024年6月6日
大型语言模型网络安全综述
专知会员服务
68+阅读 · 2024年5月12日
大语言模型安全现状与挑战
专知会员服务
88+阅读 · 2024年1月14日
下载 | 最全中文文本分类模型库,上手即用
机器学习算法与Python学习
31+阅读 · 2019年10月17日
哈工大讯飞联合实验室发布中文XLNet预训练模型
哈工大SCIR
13+阅读 · 2019年8月20日
Word2Vec 与 GloVe 技术浅析与对比
LibRec智能推荐
25+阅读 · 2017年5月15日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
19+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
VIP会员
最新内容
《无人机脆弱性利用:网络空间力量的新域》
专知会员服务
2+阅读 · 今天4:08
美空军如何将人工智能从战场部署至后方机关
专知会员服务
11+阅读 · 7月31日
《史诗怒火行动:多域前瞻评估》49页报告
专知会员服务
7+阅读 · 7月31日
《英国防部:未来空战系统数字化战略》33页
专知会员服务
5+阅读 · 7月31日
《面向自主飞行网络的智能体人工智能架构》
专知会员服务
7+阅读 · 7月31日
“史诗怒火”行动:现代多域作战的重要节点
专知会员服务
8+阅读 · 7月30日
《下一代无线网络中的多无人机通信资源管理》
相关VIP内容
相关基金
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
19+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员