GLiFormer's 575M Encoder Hits 91.10 F1 on Nested JSON Without Generating Tokens
In this article
Knowledgator has released GLiFormer, a schema-conditioned encoder framework that handles named-entity recognition, relation extraction, text classification, nested JSON structuring, and text embeddings within a single model. Two Apache 2.0 checkpoints are on Hugging Face — GLiFormer Base v1 at 264.2M parameters and GLiFormer Large v1 at 575.6M — both installable via pip install gliformer and deployable on CPU or GPU. The headline benchmark is 91.10 F1 on nested JSON extraction, achieved without generating a single output token.
For engineers running extraction pipelines, that last detail is the operative one. Production structured-extraction stacks typically chain discrete models — one for entity tagging, one for classification, one for record assembly — compounding latency and failure modes at each handoff. As we have covered before, production AI fails on architecture, not model intelligence, and GLiFormer's design is a direct response to that pattern.
Encoder-only span extraction architecture
GLiFormer generalises the GLiNER span-matching framework through a concept called an anchor — a runtime object against which each schema label is scored. Depending on the task, an anchor can be a group vector (classification), an entity pair (relation extraction), or a record slot (JSON structuring). The source document is encoded once; multiple task schemas then run as task-local groups over that shared representation, avoiding redundant forward passes.
For NER, the head scores start, end, and inside evidence for every token-label pair using independent sigmoid outputs, allowing nested mentions and shared span boundaries to coexist without mutual exclusion constraints. The JSON structuring pipeline runs four deterministic stages: grounding field values as spans copied directly from source text; assigning spans to record slots using Hungarian matching; predicting directed parent-child links restricted to schema-legal paths; and assembling the final output with a deterministic decoder. Because values are source spans rather than generated strings, the model cannot hallucinate field content absent from the input — though span selection, record assignment, and hierarchy prediction can still be wrong.
Each v1 checkpoint is configured with 100 record anchors. Head compute scales with the number of groups, labels, and anchors, so schema complexity carries a real cost, but it does not trigger autoregressive token generation.
Benchmark performance
| JSON Nesting Depth | Mean Input Tokens | Mean Reference JSON Tokens | GPU Latency p50 (ms) | CPU Latency p50 (ms) |
|---|---|---|---|---|
| Depth 3 | 456 | 175 | 52.2 | 240.0 |
| Depth 4 | 540 | 243 | 54.2 | 303.1 |
| Depth 5 | 771 | 522 | 108.1 | 551.7 |
| Depth 6 | 947 | 778 | 127.8 | 941.7 |
| All 40 documents | 678 | 429 | 69.0 | 546.9 |
Benchmarks cover 40 structuring documents — 10 per nesting depth from 3 to 6 — measured at batch size 1 with timing spanning input processing, prediction, and nested-output reconstruction. GPU hardware was an NVIDIA RTX PRO 6000 Blackwell; CPU was an AMD EPYC 9B45 running FP32 with 8 threads. Across all 40 documents, GLiFormer-base GPU mean is reported as 81.0× faster than an autoregressive LLM analytical estimate and 12.2× faster on CPU. At depth 6, where a reference JSON averages 778 tokens, the GPU p50 remains 127.8 ms — latency a synchronous API call can absorb.
AI Mastery analysis
The 91.10 F1 figure is compelling, but practitioners should note what the architecture trades away for its speed advantage. Constraining output values to source spans eliminates hallucination of field content, but it also means any field whose value must be inferred, normalised, or synthesised from multiple document locations is outside GLiFormer's reach. A date field expressed relative to a document's implicit timestamp, for instance, requires reasoning the span-copy mechanism cannot perform. This positions GLiFormer squarely in the extractive rather than abstractive extraction regime.
The Hungarian matching step for record slot assignment is also worth scrutiny at scale. Hungarian matching is O(n³) in the number of slots, and while 100 anchors per checkpoint keeps that tractable for the benchmark documents, deeply nested schemas with many repeated record types could stress the assignment stage in ways the reported benchmarks — capped at depth 6 — do not fully expose.
The broader architectural lesson connects to a pattern this publication has tracked: architectural specificity outperforms GPU scaling. GLiFormer's per-task-group head design and deterministic decoder extract performance without adding parameters or inference compute proportionally. The Large checkpoint at 575.6M parameters is a fraction of the size of frontier LLMs it outpaces on this task, and it runs on CPU — a meaningful constraint lift for on-premise or edge deployments where GPU access is restricted.
The Apache 2.0 licensing removes commercial friction that would otherwise limit adoption in production data pipelines. Whether the 91.10 F1 ceiling holds on domain-specific corpora with irregular schema structures — legal contracts, regulatory filings, clinical notes — remains the open empirical question teams should answer before committing the architecture to a critical extraction path.
Primary source
Frequently asked questions
What F1 score does GLiFormer achieve on nested JSON extraction?
GLiFormer achieves 91.10 F1 on nested JSON extraction. This is accomplished without generating a single output token — values are copied directly from source spans rather than produced autoregressively.
How many parameters does GLiFormer have, and which checkpoints are available?
Two checkpoints are available: GLiFormer Base v1 at 264.2M parameters and GLiFormer Large v1 at 575.6M parameters. Both are Apache 2.0 licensed, installable via `pip install gliformer`, and run on CPU or GPU.
How fast is GLiFormer compared to an autoregressive LLM on structured extraction?
Across all 40 benchmark documents, GLiFormer-base GPU mean is reported as 81.0× faster than an autoregressive LLM analytical estimate, and 12.2× faster on CPU. GPU p50 latency across all documents is 69.0 ms; CPU p50 is 546.9 ms.
What hardware was used to benchmark GLiFormer?
GPU benchmarks used an NVIDIA RTX PRO 6000 Blackwell; CPU benchmarks used an AMD EPYC 9B45 running FP32 with 8 threads. All timing covers input processing, prediction, and nested-output reconstruction at batch size 1.
Can GLiFormer hallucinate field values in its JSON output?
GLiFormer cannot invent field content absent from the input document, because all output values are spans copied directly from source text. However, span selection, record assignment, and hierarchy prediction can still be wrong.
Related Reading
GLiNER2.5 Drops Span Enumeration, Opens 4,096-Token Context
Fastino's GLiNER2.5 replaces span enumeration with boundary prediction, removing entity-length limits and reaching 56.17 macro F1 across 16 zero-shot benchmarks.
DeepSeek-V4.1-Flash: 552B MoE at 890 Bytes per Token
DeepSeek-V4.1-Flash uses a Causal Encoder-Decoder architecture to cut prefill to 8B active params and compress global KV cache to 890 bytes per token.
Fruit Fly Connectome Wired Into 1.2B LLM Loses to No-Graph Control
FLM embeds 166,700 fly neurons into a frozen LFM2.5-1.2B backbone — then its own ablations show a graph-free control wins in every seed.