Opir: Efficient Multi-Task Safety Classification for Toxicity, Jailbreaks, Hate Speech, and Harmful Content
On the map: LLM safety and security → Safety alignment, refusal and guardrails
Abstract (arXiv)
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.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Placed in Safety alignment, refusal and guardrails, one of 12 directions in LLM safety and security. Builds on 53 of its 69 references that are in the map. First posted on arXiv 28 May 2026.
Builds on
53 of 69 references.
Closest ancestors · 7
Same direction, newest first
- 2026GLiGuard: Schema-Conditioned Classification for LLM Safeguard8 May
- 2026GLiNER Guard: Unified Encoder Family for Production LLM Safety and Privacy6 May
- 2025Aegis2.0: A Diverse AI Safety Dataset and Risks Taxonomy for Alignment of LLM Guardrails15 Jan
- 2024WildGuard: Open One-Stop Moderation Tools for Safety Risks, Jailbreaks, and Refusals of LLMs26 Jun
- 2024PKU-SafeRLHF: Towards Multi-Level Safety Alignment for LLMs with Human Preference20 Jun
- 2024OR-Bench: An Over-Refusal Benchmark for Large Language Models31 May
- 2023All Languages Matter: On the Multilingual Safety of Large Language Models2 Oct
Other references · 46
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2024The Llama 3 Herd of Modelscited by 14,715
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
- 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,170
- 2023Judging LLM-as-a-Judge with MT-Bench and Chatbot Arenacited by 8,626
- 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 5,944
- 2016Overcoming catastrophic forgetting in neural networkscited by 4,787
- 2022Training a Helpful and Harmless Assistant with Reinforcement Learning from Human Feedbackcited by 3,720
- 2023Universal and Transferable Adversarial Attacks on Aligned Language Modelscited by 3,104
- 2020DeBERTa: Decoding-enhanced BERT with Disentangled Attentioncited by 2,181
- 2017Gradient Episodic Memory for Continual Learningcited by 1,898
- 2023Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injectioncited by 1,443
34 more
- 2024HarmBench: A Standardized Evaluation Framework for Automated Red Teaming and Robust Refusalcited by 1,429
- 2023Jailbreaking Black Box Large Language Models in Twenty Queriescited by 1,420
- 2020RealToxicityPrompts: Evaluating Neural Toxic Degeneration in Language Modelscited by 1,255
- 2021DeBERTaV3: Improving DeBERTa using ELECTRA-Style Pre-Training with Gradient-Disentangled Embedding Sharingcited by 1,254
- 2023Llama Guard: LLM-based Input-Output Safeguard for Human-AI Conversationscited by 1,207
- 2022Red Teaming Language Models with Language Modelscited by 1,026
- 2023BeaverTails: Towards Improved Safety Alignment of LLM via a Human-Preference Datasetcited by 860
- 2023AutoDAN: Generating Stealthy Jailbreak Prompts on Aligned Large Language Modelscited by 785
- 2023Tree of Attacks: Jailbreaking Black-Box LLMs Automaticallycited by 672
- 2024JailbreakBench: An Open Robustness Benchmark for Jailbreaking Large Language Modelscited by 536
- 2023XSTest: A Test Suite for Identifying Exaggerated Safety Behaviours in Large Language Modelscited by 505
- 2024The Instruction Hierarchy: Training LLMs to Prioritize Privileged Instructionscited by 493
- 2023"Do Anything Now": Characterizing and Evaluating In-The-Wild Jailbreak Prompts on Large Language Modelscited by 489
- 2022A Holistic Approach to Undesired Content Detection in the Real Worldcited by 356
- 2024Replacing Judges with Juries: Evaluating LLM Generations with a Panel of Diverse Modelscited by 326
- 2024ShieldGemma: Generative AI Content Moderation Based on Gemmacited by 243
- 2023Multilingual Jailbreak Challenges in Large Language Modelscited by 240
- 2024SORRY-Bench: Systematically Evaluating Large Language Model Safety Refusalcited by 240
- 2023ToxicChat: Unveiling Hidden Challenges of Toxicity Detection in Real-World User-AI Conversationcited by 231
- 2024SALAD-Bench: A Hierarchical and Comprehensive Safety Benchmark for Large Language Modelscited by 228
- 2020HateBERT: Retraining BERT for Abusive Language Detection in Englishcited by 207
- 2022A New Generation of Perspective API: Efficient Multilingual Character-level Transformerscited by 185
- 2024AgentDojo: A Dynamic Environment to Evaluate Prompt Injection Attacks and Defenses for LLM Agentscited by 145
- 2022Efficient Few-Shot Learning Without Promptscited by 137
- 2024AEGIS: Online Adaptive AI Content Safety Moderation with Ensemble of LLM Expertscited by 136
- 2021Challenges in Automated Debiasing for Toxic Language Detectioncited by 96
- 2023GLiNER: Generalist Model for Named Entity Recognition using Bidirectional Transformercited by 88
- 2023SimpleSafetyTests: a Test Suite for Identifying Critical Safety Risks in Large Language Modelscited by 76
- 2025PolyGuard: A Multilingual Safety Moderation Tool for 17 Languagescited by 59
- 2024garak: A Framework for Security Probing Large Language Modelscited by 49
- 2024RTP-LX: Can LLMs Evaluate Toxicity in Multilingual Scenarios?cited by 36
- 2024NuNER: Entity Recognition Encoder Pre-training via LLM-Annotated Datacited by 34
- 2025GLiClass: Generalist Lightweight Model for Sequence Classification Taskscited by 15
- 2024GLiNER multi-task: Generalist Lightweight Model for Various Information Extraction Taskscited by 8
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2026Trust The Typical
- 2025SGuard-v1: Safety Guardrail for Large Language Models
- 2026Benchmarking Open-Source Safety Guard Models: A Comprehensive Evaluation
- 2024LionGuard: Building a Contextualized Moderation Classifier to Tackle Localized Unsafe Content
- 2025Safety Pretraining: Toward the Next Generation of Safe AI
- 2025A Multi-Perspective Benchmark and Moderation Model for Evaluating Safety and Adversarial Robustness
- 2025Circumventing Safety Alignment in Large Language Models Through Embedding Space Toxicity Attenuation
- 2026A Reproducible, License-Aware Distillation Recipe for CPUDeployable Safety Classification