
Research
Thao Nguyen

GLiNER started as a PhD research project from Urchade Zaratiana at Université Sorbonne Paris Nord, building on a bet that went against the grain at the time: entity extraction didn't need a large language model.
Urchade, now a founding researcher at Fastino Labs, tested the idea with a training run. The result was good enough to warrant more experiments, so he scaled it up and evaluated it more carefully. That work became GLiNER, a small encoder model that could extract named entities from text without a GPU.
Three years later, GLiNER has passed 45 million downloads on Hugging Face. The project now covers named entity recognition, classification, structured extraction, relation extraction, and constrained decoding. Its newest update, GLiNER2.5, extends the same approach to add longer spans and joint entity decisions.
Why use an encoder?
When Urchade started GLiNER during his PhD, large language models were becoming useful for zero-shot tasks. People were also using them for entity extraction.
Entity extraction seemed like a poor fit for a generative model. The information was already in the input. The model needed to locate and label it. Generating a new sequence token by token added work to a task that could be handled by an encoder model.
"All the information is already present in the input text. You don't need to generate, you just need to find a way to extract these entities from this text. My idea was combining the prompting of LLMs with the efficiency of encoders."
GLiNER matched entity-type embeddings with span embeddings in a shared latent space. A small encoder could compare a label such as person or organization with spans in the text. The model was designed to run on a CPU and could be fine-tuned for domain-specific extraction with relatively little data.
Urchade wrote the original GLiNER paper with his collaborators at LIPN and FI Group, and released the model on Hugging Face. In the years since, people started using GLiNER for PII detection and humanitarian work at NGOs, guardrails at UNESCO, and domain-specific research in university theses.
"I wish I'd had this kind of model during my own studies," Urchade said. "It was really hard to have a powerful model on CPU."
GLiNER: efficient encoder-based named entity recognition (2023)
The first generation of GLiNER did one thing well: named entity recognition. It could identify spans using labels supplied at inference time, which made it useful for PII redaction, biomedical extraction, legal review, and financial data extraction.
However, the design came with clear limits. Candidate spans had a maximum length of 12 words, and the model accepted a 512-token input window. Classification, structured JSON extraction, and relation extraction required another model or a custom pipeline.
GLiNER2: adding extraction and more tasks to the same model (2025)
GLiNER2 expanded that interface into a declarative schema. A user could describe the fields and labels they wanted, then run classification, entity extraction, JSON extraction, and relation extraction in one forward pass.
GLiNER2 added:
Capability | What it enabled |
|---|---|
Single-label and multi-label classification | Classify text without a second model |
Hierarchical JSON extraction | Turn unstructured text into structured records |
Relation extraction | Capture how entities connect |
Fast fine-tuning | Adapt a schema with as few as ten examples in about three minutes |
GLiGuard is a fine-tuned version of GLiNER2 for safety moderation. The 300M-parameter model handles four tasks in one forward pass: overall safety classification, jailbreak strategy detection, harm category detection, and refusal detection. It can evaluate both user prompts and model responses.
GLiNER2-PII applies the same approach to privacy. The 300M-parameter multilingual model extracts 42 types of personally identifiable information, supports custom label schemas at inference time, and can be used to detect and redact sensitive information without retraining.
GLiNER2-Guardrails-PII-Multi combines those two use cases in one 0.3B multilingual model. It can perform both simultaneously: the four GLiGuard safety tasks and extraction of the same 42 PII types, in a single forward pass that reduces the latency and memory required to run separate guardrail and PII models. Its aggregate performance remains close to the original models, with a precision and recall tradeoff on PII extraction that can be adjusted through the inference threshold.
Though innovative, GLiNER2 is not without limitations:
The model scores every task on its own, with no mechanism to reconcile them. That creates a specific failure mode. A prompt can receive the label
safein one task andprompt injectionin another. Each label can look plausible on its own. Together, they produce an inconsistent answer.Long documents create another problem. GLiNER2 truncates input at a fixed word limit, so entities in the middle or end of a long document can be silently dropped unless a user splits the document manually first.
GLiNER2.5: efficient extraction without span limits (August 2026)
Earlier GLiNER models enumerated candidate spans up to a maximum width. The latest iteration, GLiNER2.5, predicts where a span starts and ends directly, so spans no longer have a fixed maximum length and inference remains linear in document length. The release includes three variants - 74M small, 0.2B base, and 0.3B multilingual - all under Apache 2.0 license.
The recent release adds utilities for longer inputs, including chunking, overlap handling, and offsets that map extracted spans back to the original source. While the input window more than doubles to 4,096 words.
New capabilities include:
Capability | What it enables |
|---|---|
Unlimited span length | Extract entities of any length, with no per-type width limit |
Constrained classification | Keep related labels coherent across tasks |
Entity-level classification | Classify sentiment, severity, negation, or other properties for each extracted span |
Long-document extraction | Process larger documents and preserve source offsets |
Joint entity and relation extraction | Build coherent graph structures through joint search |
An earnings transcript may mention several companies, and entity-level classification extracts each one with its own sentiment in the same pass. The same method turns agent conversations into a queryable knowledge graph.
Constrained classification fixes the GLiNER2 limitation: you declare the relationships between labels, and the decoder never returns a combination that violates them. That guarantees internal consistency, not that any individual label is correct. Joint extraction applies the same principle to entities and relations, scoring them together through beam search so the returned graph follows the schema's rules, an approach that traces back to EnriCo, Urchade's PhD research on globally constrained decoding.
GLiNER models at a glance

GLiNER2.5 is the recommended starting point for new projects. It keeps the compact encoder architecture while removing the fixed span-length limit, adding long-document utilities, and supporting constrained and joint decoding. While GLiNER2 remains useful for existing deployments and simple extraction tasks, GLiNER2.5 provides the broader feature set at a similar scale, so there's no reason to start with the older model.
The GLiNER models have evolved alongside how people use them. It began with extracting a list of entities. Then came the need to classify those entities, connect them to each other, and turn long documents into structured records. GLiNER2.5 now brings all of that into one model, while keeping the efficiency that made the original GLiNER useful.
Can post 2 out of 3. Could add in outside of just the OpenCode and CursorHit models built in. If you're a developer and want to switch from closed model to open model, often times it's just a matter of switching out your base URL and API key, since many of your API clients' base URLs follow the OpenAI format or are OpenAI compatible. Something Alana was like, "fact check me."
Fastino Inc. (“Fastino”) develops specialized AI models and provides APIs designed to support structured data extraction, classification, reasoning, and production AI workflows. Fastino is a technology company and does not provide legal, financial, compliance, or advisory services.
Any outputs, predictions, classifications, or decisions generated through Fastino models are based on the configuration, data, and implementation provided by the customer. Fastino does not control, verify, or guarantee the accuracy, completeness, or suitability of model outputs for any specific purpose. By using this website or Fastino’s models and services, you acknowledge that all content and outputs are provided for informational and operational purposes only and agree to our Terms of Use and Privacy Policy.
2026 Fastino Inc.
All rights reserved