GLiNER Guard: Unified Encoder Family for Production LLM Safety and Privacy

Bogdan Minko, Sabrina Sadiekh, Evgeniy Kokuykin · 2026

Read GLiNER Guard: Unified Encoder Family for Production LLM Safety and Privacy by Bogdan Minko, Sabrina Sadiekh, Evgeniy Kokuykin (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2605-05277.txt.

Introduction

Bogdan Minko, Sabrina Sadiekh, and Evgeniy Kokuykin present GLiNER Guard, a single encoder model that handles both safety moderation and personal data detection for production language model systems in one pass. Operators need both tasks under strict speed and cost limits. Autoregressive moderators are accurate but expensive, while light encoders are fast but weaker, forcing an awkward trade-off.

The family includes compact models for high-throughput serving and a larger Omni variant for stronger moderation. Under dynamic batching on one high-end graphics processor, the compact model served requests far faster than its predecessor at sub-second tail latency. The authors also release a span-level benchmark for personal data detection in full pipelines.

Catalog record

CREATORBogdan Minko, Sabrina Sadiekh, Evgeniy Kokuykin
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE51 KB
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2605.05277

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

GLiNER Guard: Unified Encoder Family for Production LLM Safety and Privacy Bogdan Minko, Sabrina Sadiekh, Evgeniy Kokuykin Abstract Production LLM systems require both safety moderation and PII detection under strict latency and cost constraints. This creates a trade-off: autoregressive moderators are accurate but expensive, while lightweight encoders are faster but less capable. We present GLiNER Guard (GLiGuard) , a unified encoder that performs safety classification and PII detection in a single forward pass, simplifying safety pipelines. We introduce three variants: compact uni- and bi-encoders (145–147M) for high-throughput serving, and GLiGuard Omni (209M) for stronger moderation quality. Under dynamic batching on a single A100, the compact model reaches 193 requests/sec with P99 latency below 1s, achieving 1.6 × \times higher throughput than GLiNER2. Omni remains competitive with much larger moderators on public safety benchmarks. We also release PII-Bench , a span-level benchmark for evaluating PII detection in end-to-end pipelines. Overall, encoder-based guardrails offer a practical low-cost alternative for always-on moderation. Models and benchmarks are released on HuggingFace 1 1 1 Models: https://huggingface.co/collections/hivetrace/gliner-guard-v1 2 2 2 PII-Bench: https://huggingface.co/datasets/hivetrace/pii-bench . 1 Introduction In production environments, malicious LLM requests, prompt injection, hacking attempts, and user-provided personal data create operational and compliance risks. As a result, requests often need to be screened before reaching downstream systems. Moderation and personal data detection therefore become core components of the first stage of LLM deployment. Many of the strongest open guardrails are autoregressive models such as LlamaGuard [ 7 , 13 ] , WildGuard [ 4 ] , ShieldGemma [ 24 ] , and GPT-OSS-SafeGuard [ 16 ] . These systems can provide high-quality moderation, but their inference cost and latency make always-on deployment expensive at scale. Lightweight encoder models are substantially faster, but existing encoder-based guardrails are typically narrower in scope (e.g., prompt injection only or binary toxicity only) and often less capable. A similar fragmentation exists in privacy pipelines, where production systems frequently rely on a separate NER stack alongside moderation models. This raises a practical systems question: can a compact model provide efficient first-stage protection that combines strong moderation quality and multi-task functionality in a single deployable unit? We answer this question with GLiNER Guard , a unified multi-task guardrail built on top of GLiNER2 [ 22 ] for safety classification and PII detection in a single forward pass. We study three deployment-oriented variants: (1) a compact uni-encoder, (2) a shared-weight bi-encoder with label caching support, and (3) GLiNER Guard Omni , a larger variant initialized from GLiNER2 Multi to improve transfer and broader generalization. Our central contribution is not only adapting GLiNER-style architectures to safety supervision, but showing that a single schema-driven encoder can replace multiple first-stage moderation components under realistic serving constraints. Our contributions are: • We introduce GLiNER Guard (GLiGuard), a unified encoder for joint safety classification and PII detection. • We propose compact uni-encoder and shared-weight bi-encoder variants optimized for high-throughput serving. • We present GLiNER Guard Omni, which improves transfer performance while retaining strong moderation quality. • We provide a production-oriented evaluation covering moderation quality, PII detection, generalization, cascading, and serving efficiency. Our results show that compact encoder-based guardrails occupy a practical middle tier between narrow classifiers and large autoregressive moderators, offering strong utility under production latency constraints. This work is a production-oriented technical report. Our focus is practical deployment trade-offs, serving efficiency, and unified first-stage moderation. 2 Related Work 2.1 LLM Safety Guardrails Autoregressive guardrails. Many of the strongest open safety moderators are autoregressive models trained with safety supervision, including LlamaGuard [ 7 ] , Llama 4 Guard [ 13 ] , WildGuard [ 4 ] , ShieldGemma [ 24 ] , NemotronGuard [ 15 ] , PolyGuard [ 9 ] , and GPT-OSS-SafeGuard [ 16 ] . These systems often perform strongly on response-level moderation, multilingual settings, and longer-context inputs. Their main limitation is serving cost: autoregressive decoding introduces substantially higher latency and inference cost than encoder-only alternatives, making always-on deployment expensive at scale. Encoder-based guardrails. A smaller line of work explores encoder-only models for narrower safety tasks. For example, PromptGuard 2 3 3 3 https://huggingface.co/meta-llama/Prompt-Guard-2 focuses on prompt injection and jailbreak detection, Longformer-harmful-ro 4 4 4 https://huggingface.co/LibrAI/longformer-harmful-ro applies Longformer [ 1 ] to binary harmful-content classification, and DeBERTa-v3-base-prompt-injection-v2 5 5 5 https://huggingface.co/ProtectAI/deberta-v3-base-prompt-injection-v2 uses DeBERTa-v3 [ 6 ] for prompt injection detection. Such models are efficient, but they are typically narrow in scope, rely on task-specific fine-tuning, and do not unify moderation with structured extraction tasks such as PII detection. 2.2 Schema-Driven Information Extraction GLiNER [ 23 ] introduced a schema-driven alternative to conventional NER: instead of generating labels as text, it scores candidate spans against natural-language entity descriptions, enabling open-label extraction with a compact encoder. GLiClass [ 19 ] extended the same principle to classification tasks. GLiNER2 [ 22 ] further unified named entity recognition, relation extraction, and classification within a single encoder architecture conditioned on dynamically defined schemas. However, prior GLiNER-based systems were not designed for safety domains and did not explicitly model adversarial prompts, jailbreak behavior, or moderation taxonomies. Bi-encoder scalability. A bi-encoder variant was later introduced for the original GLiNER by 20 . By encoding labels independently and caching their embeddings, it scales more efficiently as label spaces grow. This is particularly attractive for guardrail deployment, where policy schemas may be fixed, large, tenant-specific, or frequently updated. However, prior bi-encoder work focused on single-task NER and relied on two separate encoder towers rather than a shared multitask design. 2.3 PII Detection PII detection is commonly approached through three paradigms. Rule-based systems such as Presidio [ 14 ] are highly precise for structured patterns (emails, phone numbers, identifiers) but weaker on context-dependent entities such as names or free-form addresses. Fine-tuned token classifiers based on encoders such as DeBERTa-v3 [ 6 ] can achieve strong in-domain performance, but typically depend on labeled data and fixed ontologies. LLM-based extraction approaches such as Llama-3-70B [ 3 ] support open-vocabulary extraction, but incur substantially higher inference cost. Despite strong progress, PII detection is still often deployed as a separate subsystem alongside moderation models. This increases pipeline complexity, maintenance overhead, and latency. A unified model that shares representations across moderation and span extraction offers a simpler systems alternative. Unified gap and our approach. Taken together, prior work reveals three connected limitations: (1) autoregressive guardrails provide strong moderation quality but remain costly for always-on first-stage deployment, (2) existing encoder guardrails are efficient but narrow in scope, and (3) moderation and PII detection are often implemented as separate systems. GLiNER Guard addresses these limitations with a unified schema-driven encoder family that performs safety classification and PII detection in a single forward pass. We introduce compact uni-/bi-encoder variants for high-throughput serving, a shared-weight bi-encoder with label caching for scalable deployment, and GLiNER Guard Omni for stronger transfer and broader downstream generalization. 3 Method 3.1 Overview GLiNER Guard is motivated by a simple observation: safety moderation and PII detection are distinct tasks, but both depend on contextual understanding of the same input text. Built on top of GLiNER2 [ 22 ] , the model unifies safety classification and span-level privacy extraction within a single encoder architecture. The system consists of three components: (1) a shared text encoder, (2) span-scoring heads for extraction tasks, and

Read the complete text