GLiNER: Schema-Conditioned Extraction Model
- GLiNER is a schema-conditioned family of encoder models designed for flexible, natural-language driven extraction and dynamic extension to arbitrary entity types.
- It reformulates named entity recognition as semantic matching of text spans with descriptive labels, enabling zero-shot performance and reduced retraining needs.
- Subsequent variants broaden its scope to multitask extraction, biomedical NER, privacy filtering, and lemmatization, emphasizing efficiency and versatility in production settings.
GLiNER is a family of encoder-based information extraction models centered on the idea that entity and task labels can be supplied as natural-language inputs rather than fixed output indices. The original formulation, introduced in “GLiNER: Generalist Model for Named Entity Recognition using Bidirectional Transformer” (Zaratiana et al., 2023), recasts named entity recognition (NER) as semantic matching between text spans and label descriptions inside a shared bidirectional transformer. Subsequent work broadens that paradigm into a larger schema-conditioned family supporting multitask information extraction, biomedical NER, relation extraction, safety moderation, privacy filtering, contextualized lemmatization, and document-level extraction in research-literature monitoring (Stepanov et al., 2024, Zaratiana et al., 24 Jul 2025, Stepanov et al., 11 May 2026, Minko et al., 6 May 2026).
1. Origins and problem formulation
GLiNER was proposed to address a structural limitation of conventional NER systems: they are usually trained for a fixed, predefined label set, so extending them to new entity types requires reannotation and retraining. LLMs can accept open-ended instructions, but they are comparatively expensive, slow because of autoregressive decoding, and often inconvenient for resource-limited or latency-sensitive settings. GLiNER’s design goal was therefore a compact, label-agnostic model that can extract arbitrary entity types described in natural language while remaining efficient and parallelizable (Zaratiana et al., 2023).
The original model is explicitly open-type rather than closed-schema. Entity types are specified by short textual descriptions, and the model learns a shared latent space in which span representations from the input text can be matched against those type representations. In zero-shot evaluation, the largest original variant, GLiNER-L, reached an average F1 of 60.9 on a seven-dataset out-of-domain benchmark, exceeding ChatGPT at 47.5, InstructUIE at 47.2, UniNER-13B at 55.6, and GoLLIE-7B at 58.0; on a broader 20-dataset zero-shot collection, GLiNER-L obtained an average F1 of 47.8 versus ChatGPT at 36.5 and UniNER-7B at 45.7 (Zaratiana et al., 2023).
From the outset, GLiNER was also positioned as a compact alternative to large generative systems. The original paper reports model sizes of roughly 50M, 90M, and 0.3B parameters for GLiNER-S, GLiNER-M, and GLiNER-L respectively, and training time of about five hours for GLiNER-L on a single A100 GPU (Zaratiana et al., 2023). A plausible implication is that GLiNER’s research trajectory has been shaped as much by deployment constraints as by extraction quality: later descendants repeatedly emphasize CPU viability, local deployment, dynamic schemas, and first-stage filtering.
2. Core architecture and learning mechanism
In the original formulation, GLiNER jointly encodes label descriptions and text in a single bidirectional transformer. The input sequence is constructed as
where each [ENT] marks an entity-type description and [SEP] separates the prompt block from the text (Zaratiana et al., 2023). Later descriptions of the architecture characterize this as an encoder-only, BERT-like cross-encoder with a shared encoder over the concatenated label block and input text, followed by two lightweight feed-forward modules that derive span embeddings and label embeddings for similarity scoring (Dorkin et al., 2024).
The original span representation is boundary-based. For a span beginning at token and ending at token ,
where and are contextual token embeddings and denotes concatenation. Each entity type receives an embedding derived from the contextualized [ENT] token for that label, and compatibility is scored as
This score is interpreted as the probability that span 0 instantiates type 1. Training uses binary cross-entropy over span-type pairs, with additional negative entity-type sampling because the Pile-NER corpus natively supplies only positive types present in the passage (Zaratiana et al., 2023).
A central practical decision is the maximum span length cap 2. This bounds span construction to 3 and scoring to 4, where 5 is text length and 6 is the number of types. Decoding is greedy: spans above threshold are ranked, and the highest-scoring non-overlapping candidates are retained for flat NER, while nested mode permits fully nested spans but avoids partial overlaps (Zaratiana et al., 2023). This combination of bidirectional encoding, parallel span construction, and lightweight overlap resolution is the main reason GLiNER avoids the latency profile of autoregressive extraction.
The original pretraining source was Pile-NER from UniversalNER, built from The Pile and containing 44,889 passages, about 240k annotated spans, and roughly 13k distinct entity types (Zaratiana et al., 2023). The GliLem study reiterates that GLiNER was pretrained on the UniversalNER Pile-NER dataset and emphasizes the resulting ability to generalize to very different label spaces, which later papers repeatedly exploit when repurposing the model outside classical NER (Dorkin et al., 2024).
3. Multitask and schema-driven evolution
Later work uses “GLiNER” not only for the original span-label matcher but also for a broader family of schema-conditioned encoder systems. The common invariant is joint conditioning on label or schema text; the decoding head, however, is no longer uniform across the family. “GLiNER multi-task” extends the model to NER, relation extraction, extractive question answering, and extractive summarization under a single token-classification framework with begin/inside/end states, while GLiNER2 further generalizes the interface to NER, text classification, and hierarchical structured extraction (Stepanov et al., 2024, Zaratiana et al., 24 Jul 2025).
| Variant | Main capability | Notable property |
|---|---|---|
| GLiNER multi-task | NER, RE, QA, summarization | One encoder, token–label B/I/E scoring |
| GLiNER2 | NER, classification, hierarchical extraction | Schema-driven interface with [P], [E], [C], [L] |
| GLiNER-Relex | Joint NER and RE | Entity and relation labels in one prompted encoder pass |
| GLiNER Guard | Safety classification and PII detection | Single forward pass for moderation and privacy |
GLiNER multi-task uses DeBERTa v3 large, jointly encodes labels and text, and applies a shared token-label scoring head over begin, inside, and end states. Its zero-shot NER benchmark average F1 is reported as 0.6276, ahead of NuNER_Zero-span at 0.6196 and other GLiNER baselines in that comparison; on SQuAD2.0 it reached EM 87.72 and F1 91.99, and on FewRel relation extraction it reported EM 82.5 and F1 87.36 (Stepanov et al., 2024). This marks a substantial architectural shift: the model family stops being exclusively span-classification-based and starts functioning as a more general IE substrate.
GLiNER2 formalizes that transition with an explicit schema-driven interface. It uses learned special tokens [P], [E], [C], [L], and [SEP] to express tasks, entity labels, structured fields, and classification labels in one encoder input. The model has 205M parameters, supports a 2048-token context window, and is designed for CPU-efficient inference. On zero-shot text classification, the reported latency on CPU grows from 130 ms with 5 labels to 208 ms with 50 labels, whereas a DeBERTa-v3 zero-shot baseline rises from 1714 ms to 16897 ms over the same range (Zaratiana et al., 24 Jul 2025). The same paper reports zero-shot classification accuracies of 0.83 on SNIPS, 0.70 on Banking77, and 0.74 on AG News, with an overall average of 0.72 across seven datasets (Zaratiana et al., 24 Jul 2025).
GLiNER-Relex extends the family to joint NER and relation extraction by inserting both entity labels and relation labels into one prompted encoder sequence marked by [ENT] and [REL]. After entity extraction, it forms ordered entity pairs and scores them against relation label embeddings. The released model uses all-pairs enumeration, maximum span width 7, default thresholds 8 and 9, and a pair-MLP relation representation. In zero-shot evaluation, GLiNER-Relex reports micro-F1 of 40.4 on CoNLL04, 31.3 on DocRED, 12.5 on FewRel, and 18.1 on CrossRE, with an average of 25.6 across the four benchmarks; on 50 held-out documents it averaged 0.9 seconds per document on an NVIDIA L4 GPU, versus 64 seconds per document for GPT-5-mini via API (Stepanov et al., 11 May 2026).
4. Domain adaptation: biomedical NER, lemmatization, and specialized supervision
A major branch of the GLiNER literature adapts the label-conditioned encoder paradigm to biomedicine. GLiNER-BioMed introduces a biomedical suite of uni-encoder and bi-encoder variants at small, base, and large scales. The uni-encoder jointly processes text and label descriptions with a single DeBERTa-v3 encoder, giving complexity 0, while the bi-encoder separates text and label encoding so that the text cost is 1 and labels can be precomputed at 2, making the bi-encoder preferable when many labels must be scored (Yazdani et al., 1 Apr 2025).
The training pipeline for GLiNER-BioMed is unusually data-centric. The authors curate biomedical passages from DailyMed, ClinicalTrials.gov, PubMed abstracts, and biomedical patents; use OpenBioLLM-70B to annotate an initial subset; distill that behavior into an OpenBioLLM-8B model via LoRA; and then label the remaining corpus. The resulting synthetic biomedical pretraining set contains 2.3 million entity mentions and 640,000 unique entities. A second post-training stage mixes about 10,000 synthetic general-domain examples from FineWeb with human-annotated OntoNotes 5, MultiNERD, and WNUT2017, explicitly excluding target biomedical entity types to avoid leakage (Yazdani et al., 1 Apr 2025).
Quantitatively, GLiNER-BioMed-large reports 59.77% micro-F1 in zero-shot evaluation across eight biomedical NER datasets, improving by 5.96 points over the strongest GLiNER baseline, GLiNER v2.5-large at 53.81%. In few-shot settings, the bi-encoder large model reaches 70.39% F1 with only 10 labeled examples, 73.07% with 20 examples, and 76.02% with 50 examples (Yazdani et al., 1 Apr 2025). The ablations are equally important: synthetic biomedical pretraining alone gives 42.10% F1 with high precision and low recall, while synthetic biomedical pretraining plus post-training yields 59.77%, indicating that domain coverage and boundary quality are being learned in different stages (Yazdani et al., 1 Apr 2025).
The BioASQ 2025 study on GLiNER-BioMed provides a cautionary counterpoint. Fine-tuned on GutBrainIE Subtask 6.1 with 13 labels, the baseline GLiNER-BioMed model achieves dev-set micro precision 0.7390, recall 0.8389, and F1 0.7857; targeted dictionary-based post-processing raises dev micro-F1 to 0.8316, but the blind-test post-processed score falls to 0.7743, below the baseline 0.79 cited for the test setting (Mehta, 3 Oct 2025). The paper explicitly attributes the discrepancy to overfitting of the post-processing rules to the development error profile. A common misconception is that GLiNER’s open-label architecture alone removes the need for calibration; this result suggests the opposite for downstream rule layers.
GLiNER has also been adapted outside NER proper. GliLem treats contextualized lemmatization in Estonian as an open-vocabulary span-label problem over transformation rules rather than surface lemmas. Vabamorf generates candidate lemmas, each candidate is converted into a textual shortest edit script, and GLiNER ranks the candidate rules in context. On the Estonian UD EDT corpus, the paper reports test lemmatization accuracy of 0.977 for GliLem, versus 0.892 for Vabamorf’s HMM disambiguator, 0.966 for a pattern-based token classifier, and 0.993 for the oracle candidate set (Dorkin et al., 2024). In downstream BM25 retrieval on a translated Estonian DBpedia-Entity benchmark, GliLem also yields small but consistent recall gains over HMM-based lemmatization, including Recall@100 of 0.2935 versus 0.2831 (Dorkin et al., 2024). This suggests that GLiNER’s real abstraction is not “named entity recognition” narrowly construed, but dynamic contextual ranking over human-readable label candidates.
5. Privacy, safety, and other applied extraction systems
The family’s production-oriented branch is exemplified by GLiNER Guard, or GLiGuard, which unifies safety classification and PII detection in a single encoder forward pass. Three variants are reported: a compact uni-encoder at 147M parameters, a compact shared-weight bi-encoder at 145M, and GLiGuard Omni at 209M. Under dynamic batching on an A100 80 GB using ONNX TensorRT, the compact uni-encoder reaches 193.6 requests per second with P50/P95/P99 latencies of 480/750/900 ms and zero error rate, a throughput improvement of about 58% over GLiNER2 Multi at 122.6 RPS and a P99 latency reduction of 36% (Minko et al., 6 May 2026). On public moderation benchmarks, Omni reports 3, improving over GLiNER2 Multi at 66.6 and GLiClass at 64.9, while the compact models remain competitive on Aegis 2.0 and StrongReject (Minko et al., 6 May 2026).
For PII specifically, GLiNER2-PII adapts GLiNER2 to a 42-label multilingual schema spanning personal identity, contact and location, government and tax identifiers, banking and payment data, digital identity, secrets and credentials, and sensitive dates. It is trained on a synthetic corpus of 4,910 annotated texts generated by a constraint-driven pipeline across English, French, Spanish, German, Italian, Portuguese, and Dutch. On the SPY benchmark, GLiNER2-PII reports average span-level F1 of 0.471, ahead of OpenAI Privacy Filter at 0.373, NVIDIA GLiNER-PII at 0.391, urchade/gliner_multi_pii-v1 at 0.384, and knowledgator/gliner-pii-base-v1.0 at 0.368 (Zaratiana et al., 11 May 2026). The model is explicitly tuned toward higher recall, which the paper argues is desirable in redaction settings.
A more institution-specific example is LOGICAL, “Local Obfuscation by GLINER for Impartial Context-Aware Lineage,” which fine-tunes modern-gliner-bi-large-v1.0 on psychiatric hospital EHR notes for nine PII categories. The study reports character-level micro precision 0.979, recall 0.981, and F1 0.980 on 376 test instances, as well as complete sanitisation for 356 of 376 instances, or 95%. Gemini-Pro-2.5 in zero-shot mode reaches F1 0.845 and completely sanitises 64% of documents, while the GLiNER-based system runs on a standard laptop without a dedicated GPU (Shivaprakash et al., 22 Oct 2025). The same paper also highlights a residual entity-level false negative rate of about 2%, including 17 missed person names, and therefore recommends human-in-the-loop validation.
Other applied studies retain the GLiNER backbone but alter the supervision regime. A multitask GLiNER-based system for monitoring dataset usage in research literature jointly performs dataset mention extraction, relation identification, and usage-context classification, using focal loss and LLM-based revalidation; reported document-level precision/recall values include 1.00/0.88 on the original annotated corpus, 0.99/0.93 on JDC publications, and 0.99/0.87 on the PRWP collection (Macalaba et al., 28 May 2026). In a French biomedical NER challenge setting, GLiNER-BioMed fine-tuned on a synthetic French corpus and followed by GPT-4.1 verification achieved test micro-F1 65.22 and macro-F1 51.56, trailing GPT-4.1 in-context learning at micro-F1 75.79 and macro-F1 61.53 but offering a substantially lighter operational profile (Belmadani et al., 3 Oct 2025).
6. Limitations, recurrent failure modes, and research direction
Across the literature, GLiNER’s limitations are strikingly consistent. The original model notes sensitivity to ambiguous type descriptions, weaker performance on noisy tweet-style text, difficulty with non-Latin scripts when using English-only backbones, and the fact that greedy overlap resolution is not globally optimal. It also ignores spans longer than the maximum length cap, which is typically 4 (Zaratiana et al., 2023). These are not merely early-model artifacts: later descendants inherit analogous issues in other forms.
For schema-driven and relation-centric variants, the bottleneck shifts from span recognition to combinatorics and prompting. GLiNER-Relex must score 5 entity-pair–relation combinations in its all-pairs mode, so dense entity graphs and long documents degrade efficiency and precision; the paper also notes document truncation beyond 2048 words and difficulty with fine-grained relation inventories such as FewRel (Stepanov et al., 11 May 2026). GLiNER2 improves task breadth but reports a slight NER drop relative to GLiNER-M on some CrossNER domains, indicating that multi-task unification can dilute single-task specialization (Zaratiana et al., 24 Jul 2025).
For biomedical and privacy applications, the dominant failure modes are synthetic-data bias, static post-processing overfit, and incomplete span recovery. GLiNER-BioMed’s strongest gains come from synthetic biomedical pretraining plus post-training, which implies that synthetic supervision is powerful but not sufficient on its own (Yazdani et al., 1 Apr 2025). The BioASQ post-processing study demonstrates that dictionary corrections tuned to development errors may improve dev micro-F1 from 0.7857 to 0.8316 yet fail to generalize to the blind test (Mehta, 3 Oct 2025). LOGICAL’s 95% complete sanitisation rate still coexists with a nontrivial entity-level false negative rate, reinforcing the point that high micro-F1 does not eliminate operational risk in privacy-critical settings (Shivaprakash et al., 22 Oct 2025).
A further practical limitation is batching and deployment with dynamic label sets. GliLem reports that current GLiNER batching does not support per-example label sets, so each example must be processed separately; on a 4.5M-document corpus, both Vabamorf HMM disambiguation and GliLem took over 50 hours using about 30 concurrent CPU processes (Dorkin et al., 2024). GLiNER Guard addresses a different deployment regime—fixed or cached schemas under dynamic batching—and shows that encoder-based moderation can outperform larger pipelines in latency and cost, but it also notes that autoregressive moderators still lead on long response reasoning, multilingual response-level moderation, and ambiguous cases (Minko et al., 6 May 2026).
The broad research direction is therefore not a simple march from NER to general IE, but a progressive refinement of one core idea: schema-conditioned bidirectional encoding as a compact alternative to autoregressive extraction. Later work repeatedly expands that idea—via multi-task composition, bi-encoder label caching, synthetic pretraining, structured schemas, and unified safety-privacy inference—while preserving the premise that labels remain textual, modular, and externally specifiable (Stepanov et al., 2024, Zaratiana et al., 24 Jul 2025, Minko et al., 6 May 2026). A plausible implication is that GLiNER’s enduring contribution is less a single architecture than a reusable design pattern for efficient, promptable extraction with explicit span outputs.