GLiNER2: Schema-Driven Multi-Task Learning for Structured Information Extraction

Urchade Zaratiana, Gil Pasternak, Oliver Boyd, George Hurn-Maloney, Ash LewisEMNLP 2025

TL;DR

GLiNER2 is a new Python library that unifies named entity recognition, text classification, and hierarchical structured data extraction into a single, efficient model. It achieves competitive performance with large language models (LLMs) but runs on standard CPUs, making advanced information extraction more accessible and cost-effective.

What Problem Does This Paper Address?

Extracting structured information from text (Information Extraction or IE) is a crucial task in Natural Language Processing (NLP). Traditional approaches often require specialized models for each specific IE task (like identifying names, classifying sentiment, or extracting relationships), leading to complex and fragmented pipelines. While large language models (LLMs) have shown impressive capabilities in IE, their computational demands (requiring GPUs) and potential privacy/security concerns (especially for sensitive data) make them impractical for many real-world applications, particularly for organizations with limited resources or strict data sovereignty requirements. Existing smaller models, while more efficient, often lack the versatility to handle multiple IE tasks simultaneously.

Methods

GLiNER2 builds upon the original GLiNER architecture, which used a pretrained transformer encoder for zero-shot Named Entity Recognition (NER). The key innovation in GLiNER2 is its ability to handle multiple IE tasks (NER, text classification, and hierarchical structured data extraction) within a single, unified framework. This is achieved through a schema-driven interface and a unified input formulation.

  • Schema-Driven Interface: Users define extraction tasks using declarative schemas, allowing for flexible composition of different IE capabilities.
  • Unified Input Formulation: A carefully designed prompt template allows the model to understand and execute various extraction tasks in a single inference pass. This involves special tokens like [P] (Prompt), [E] (Entity), [C] (Child/Component), [L] (Label), and [SEP] (Separator) to delineate task specifications and input text.
  • Multi-Task Composition: GLiNER2 enables simultaneous execution of NER, text classification, and structured extraction, allowing the model to leverage shared contextual understanding across tasks. This significantly improves efficiency compared to running separate models for each task.

Datasets

The training dataset for GLiNER2 comprises 254,334 examples, a mix of real-world texts and synthetically generated data.

  • Real-world Data: Collected from sources like news articles, Wikipedia, legal texts, PubMed abstracts, and ArXiv papers.
  • Synthetic Data: Generated using GPT-40 to cover practical use cases such as emails, text messages, professional documents, social media posts, and e-commerce transactions.

The paper evaluates GLiNER2 on standard benchmarks for text classification (SNIPS, Banking77, Amazon-Intent, SST-2, IMDB, AG News, 20 Newsgroups) and NER (CrossNER). No new benchmarks were introduced.

Key Insights and Ideas

  • Unified Extraction Power: The most significant insight is that a single, efficient model can effectively handle diverse IE tasks (NER, classification, structured extraction) by leveraging a unified schema-driven approach. This breaks down the need for task-specific models.
  • CPU Efficiency is Key: GLiNER2 demonstrates that high performance in complex IE tasks doesn't necessarily require GPUs. Its CPU efficiency makes it a practical solution for a much wider range of deployment scenarios.
  • Schema Flexibility: The declarative schema approach allows users to define complex extraction requirements, including nested structures and custom entity descriptions, without needing to retrain the model.
  • Cost and Accessibility: By avoiding LLM APIs and GPU requirements, GLiNER2 dramatically reduces the cost and increases the accessibility of advanced IE capabilities for researchers, startups, and organizations in resource-constrained environments.

Key Results

  • Competitive Accuracy: GLiNER2 achieves accuracy comparable to or exceeding other open-source models on various text classification and NER benchmarks, often closing the gap with much larger proprietary models.
  • Significant Speedup: GLiNER2 offers substantial computational efficiency. For text classification, it achieves approximately a 2.6x speedup over GPT-40 on CPU and is significantly faster than DeBERTa-v3, especially as the number of labels increases, due to its simultaneous processing of all labels.
  • NER Performance: On the CrossNER benchmark, GLiNER2 closely matches GPT-40's overall F1 score and shows strong performance across specialized domains, demonstrating its versatility.
  • Parameter Count: The model maintains a parameter count under 500 million, facilitating deployment in edge computing and resource-constrained environments.

Limitations and Future Work

  • Hierarchical Structure Extraction Evaluation: The paper notes that hierarchical structure extraction was not evaluated due to the absence of established zero-shot benchmarks for this specific task type. The authors plan to address this in future work.
  • LLM Performance: While GLiNER2 performs competitively, the paper acknowledges that GPT-40, due to its significantly larger scale and extensive pretraining, leads across all tasks.
  • Future Work: The authors aim to develop benchmarks for hierarchical structure extraction and continue to enhance the model's capabilities.

Summary updated

BibTeX
@inproceedings{zaratiana2025gliner,
  author = {Urchade Zaratiana and Gil Pasternak and Oliver Boyd and George Hurn-Maloney and Ash Lewis},
  title = {{GLiNER2: Schema-Driven Multi-Task Learning for Structured Information Extraction}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2025},
}
Figure