AI News

GLiNER2.5: boundaries over spans, 4,096-word context, and joint decoding

GLiNER2.5 swaps span enumeration for boundary prediction and unlocks 4,096-word context, making extraction faster and more flexible on CPU.

2026-08-25 ·Hai Anton

Information extraction teams constantly trade off cost and flexibility. Small encoders are cheap but rigid. Large language models are versatile but costly per document. Fastino released GLiNER2.5 to close that gap. The key shift is moving from span enumeration to boundary prediction. That removes the entity length limit, enables a 4,096-word context, and keeps compute linear for a fixed schema. It also adds joint entity-relation decoding, cross-task label constraints, and per-span attributes.

What is GLiNER2.5, and why does it matter now?

GLiNER2.5 targets the extraction trade-off head-on. It aims to blend prompt-style flexibility with the operational economy of encoders. It changes how entities are found and extends context without paying a width tax.

The release adopts boundary prediction. The model scores where an entity starts and ends rather than ranking each candidate against a width grid. That change removes maximum entity length and creates room for long documents.

Fastino also adds features that once required separate steps. You now get joint entity and relation decoding, cross-task label constraints, and span attributes. The output becomes more structured by default.

On 16 zero-shot benchmarks, the multilingual checkpoint reaches 56.17 macro F1 versus 56.09 for GLiNER2. The headline boost on XNLI is 24.75 points. Three checkpoints ship under Apache 2.0.

How does boundary prediction change the game under the hood?

Moving from span enumeration to boundary prediction removes the width axis. Compute no longer depends on a fixed maximum entity length. For a fixed schema, it keeps complexity linear in sequence length.

The shared encoder still processes text and schema queries in one pass. Instead of scoring each span, the model predicts start and end scores on token boundaries, plus inside scores within tokens. A sparse proposal stage picks top starts and ends per query and pairs them without any distance cap.

Then a reranking head scores each candidate using boundary evidence and span content. Relation candidates are drawn from the same pool, not a separate pipeline. The Fastino team reports that, for a fixed schema and candidate budget, compute remains linear in sequence length.

Dropping explicit span representations cuts memory during training. That enables sequences up to 4,096 words. The checkpoints ship with max_len=4096.

Boundary prediction replaces span enumeration; entity width no longer costs compute.

Can you deploy GLiNER2.5 today?

Yes. Three checkpoints are available on Hugging Face under Apache 2.0. Local inference runs on CPU, CUDA, or MPS. Simply run pip install "gliner2[local]" on Python 3.10+ and load the model.

No inference provider currently hosts the checkpoints. So self-hosting is the deployment path. That keeps dependencies and environments transparent. You hold performance and privacy control.

Company level: any tier. The 74M and 194M checkpoints run on standard CPU machines. A two-person team can ship extraction without a GPU budget. Larger orgs get a fine-tunable, privately hosted alternative to per-token LLM extraction.

Industries include legal and contract operations, healthcare and clinical documentation, financial services, insurance claims, customer support, and AI safety tooling.

What capabilities arrive out of the box?

GLiNER2.5 brings five notable capabilities. Long-context extraction up to 4,096 words is supported without extra tricks. The library adds native chunking helpers: extract_entities_long, extract_long, Classifier.classify_long, and JointIE.extract_long. They remap spans to character offsets in the original document.

Span length is now unlimited. GLiNER2 enumerated spans up to a fixed width, typically near twelve words. Longer spans were never scored. In GLiNER2.5, a span can open at the first token and close at the last. A forty-word indemnification clause costs the same to locate as a two-word name.

Joint entity and relation extraction is first-class. You declare entity types, typed relations, and structural rules such as unique_head=True and no_self_loops(). A beam search assembles a globally consistent graph. Invalid combinations are never admitted. Check result.feasible before using the graph.

Constrained classification stitches labels across tasks during decoding. The C.implies and C.excludes rules enforce consistent assignments. Fastino illustrates the pain via the GLiGuard guardrail model: without constraints, a prompt can be labeled safe and prompt-injected simultaneously. If no valid assignment exists, the classifier raises an error.

Span attributes add nuance without extra passes. Attribute groups like “sentiment” attach to specific entity types via applies_to and are decoded span-by-span in the same forward pass. Entities return qualified rather than flat.

How does it perform, and which models are available?

Fastino evaluates zero-shot on 16 public datasets. Results are reported against GLiNER2 at matched sizes. GLiNER2.5 Multi reaches 56.17 versus 56.09 for GLiNER2 Multi. GLiNER2.5 Base reaches 54.87 versus 53.34.

The headline result is XNLI: Multi jumps to 62.30 from 37.55. That is a 24.75-point increase. Few-NERD improves for Base to 55.14 from 47.22. Romanian RONEC, an untrained language, improves for both.

The model family spans three checkpoints. gliner2.5-small-v1 has 74M parameters and uses DeBERTa-v3-xsmall for English. gliner2.5-base-v1 has 194M and builds on DeBERTa-v3-base, also English. gliner2.5-multi-v1 has 287M and uses mDeBERTa-v3-base for multilingual use.

All three share the same public API. Load them with AutoExtractor, not the legacy GLiNER2 span loader. The team also flags a chunking nuance: a span is kept only when both of its boundaries land in one chunk.

Three Apache 2.0 checkpoints: 74M, 194M, 287M — and all run on CPU.

There is one more review detail. Overall F1 rises to 56.17 for Multi and 54.87 for Base. At the same time, the extraction average dips for Multi. It is a sober reminder: architectural wins are not always uniform across tasks.

Based on Fastino.

Ready to automate your store?

We'll analyze your workflows, find the bottlenecks, and propose a concrete automation plan. First consultation is free.

Message us on Telegram →
Hai Anton
Hai Anton

Founder of HAIQ — AI Automation Agency. Founder of HAIQ. I build automations and AI solutions for Ukrainian e-commerce on n8n. I write about automation, chatbots, and AI for business.