arXiv:2605.29659cs.LGcs.AI2026-05

Opir用小模型实现多任务安全分类,兼顾效率与精度。

Opir: Efficient Multi-Task Safety Classification for Toxicity, Jailbreaks, Hate Speech, and Harmful Content

论文配图:Opir: Efficient Multi-Task Safety Classification for Toxicity, Jailbreaks, Hate Speech, and Harmful Content
图 1 · 摘自论文原文
  • 基于GLiClass架构,统一处理毒性、越狱、仇恨言论等多类风险
  • 在12项任务中超越多数开源模型,参数少于100M仍保持高性能
  • 适合需要低延迟部署的实时内容过滤场景

大型语言模型应用需实时安全过滤,但传统大模型防护成本高,难以区分良性敏感内容与真实有害内容。本文提出Opir,一套基于GLiClass架构的编码器型防护模型家族,支持二分类安全/不安全、多标签毒性、越狱检测及零样本提示与响应分类。模型训练采用三级分类体系,涵盖16个一级标签、126个二级标签和854个三级标签,共996类别。数据融合了标注的安全提示、对抗挖掘的难例负样本、良性保护性示例、生成响应、多语言翻译以及Aegis2和WildGuard部分训练集。同时开源评估工具包,支持GLiClass、GLiNER2及解码器模型,覆盖二分类、多标签分类、毒性、越狱检测、提示与响应安全性、拒答行为及子类别分析。在12项安全分类任务和17个类别任务上对比8个当前主流防护系统(含GLiNER2与生成式模型),Opir各变体在多数基准上表现优于或持平最强开源基线,且部署开销显著更小。

原文摘要 · Abstract (English)

Real-time safety filtering for large language model (LLM) applications requires classifiers that can detect unsafe prompts, toxic language, jailbreak attempts, and unsafe responses without the cost profile of large guardrail models, and that can distinguish benign sensitive text from genuinely covert harmful content. In this paper, we introduce Opir, a family of encoder-based guardrail models built on the GLiClass architecture. Opir includes multi-task models for binary safe/unsafe classification, multi-label toxicity classification, jailbreak classification, and zero-shot unsafe prompt and response categorization. We also release edge variants with fewer than 100M parameters dedicated to binary safe/unsafe categorization. The models are trained on a three-level taxonomy containing 996 categories across 16 top-level labels, 126 mid-level labels, and 854 leaf labels. Opir's training data combines taxonomy-grounded unsafe prompts, adversarially mined hard negatives, benign safety-preserving examples, generated response examples, multilingual translations, and portions of the Aegis2 and WildGuard training subsets. We also open-sourced an evaluation harness that supports GLiClass and GLiNER2 backends as well as decoder-based models, and covers binary safety classification, multi-label categorization, toxicity, jailbreak detection, prompt safety, response safety, response refusal, and prompt subcategory views across public benchmark families. Across an expanded comparison spanning 12 safety-classification tasks and 17 category tasks against eight contemporary guardrail systems -- including both GLiNER2-based and generative guardrail models -- Opir variants are competitive on or ahead of the strongest open-weight baselines on the majority of benchmark datasets while operating with a substantially smaller deployment footprint.

安全分类多任务学习轻量模型

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