NuNER: Entity Recognition Encoder Pre-training via LLM-Annotated Data

Sergei Bogdanov, Alexandre Constantin, Timothée Bernard, Benoît Crabbé, Etienne BernardEMNLP 2024

Abstract

Named Entity Recognition (NER) traditionally faces a trade-off between the efficiency of small encoders and the broad knowledge of Large Language Models (LLMs). NuNER addresses this by pre-training a compact RoBERTa-sized encoder on 4.38 million LLM-generated concept annotations. This "task-specific foundation model" learns generalized entity representations, enabling it to outperform standard encoders in few-shot settings and match the performance of models 56 times its size.

Introduction

The "NER Gap" presents a significant challenge for NLP practitioners. Small models like RoBERTa are computationally efficient but "knowledge-poor," requiring extensive fine-tuning for specific domains. Conversely, LLMs like GPT-4 are "knowledge-rich" but prohibitively expensive and slow for large-scale inference. NuNER bridges this gap by distilling the broad entity-recognition intuition of an LLM into a small, efficient encoder.

Methods: The NuNER Pipeline

The creation of NuNER involves a two-step distillation process:

  1. Unconstrained Annotation: Instead of using a fixed schema (e.g., Person, Org, Location), the researchers prompted GPT-3.5 to label every possible concept in a subset of the C4 dataset. This resulted in over 200,000 unique concept types, ranging from "NFL player" to "unit of time."
  2. Contrastive Pre-training: Using a two-tower architecture, the model aligns text embeddings with concept embeddings. This contrastive objective allows the model to learn what constitutes an entity across a vast array of domains.
The NuNER training pipeline: from LLM-based unconstrained annotation to task-specific foundation model.

Datasets and Evaluation

NuNER was pre-trained on a random sample of the Colossal Clean Crawled Corpus (C4), yielding 4.38 million annotations. To test its versatility, the authors evaluated the model across diverse domains, including general (OntoNotes 5.0), medical (BioNLP 2004), and specialized (MIT Restaurant/Movie) datasets.

Key Results

The empirical results demonstrate NuNER's efficiency and power:

  • Few-Shot Dominance: In settings with 1 to 100 examples, NuNER significantly outperformed base RoBERTa and previous state-of-the-art models like NER-BERT.
  • Competitive with LLMs: With only 8 training examples per entity type, NuNER outperformed GPT-3.5 and remained competitive with GPT-4.
  • Efficiency and Cost: NuNER (125M parameters) achieved performance parity with UniversalNER (7B parameters), a model 56 times larger. Furthermore, inference costs are estimated at less than $0.0001 per example, compared to ~$0.10 for GPT-4.
Few-shot performance comparison: NuNER vs. RoBERTa baselines across different values of k.

Conclusion

NuNER represents a significant step toward high-performance, low-cost entity extraction. By leveraging LLMs for unconstrained data annotation, it creates a "drop-in" replacement for standard encoders that possesses a generalized understanding of entities. Future work will explore scaling the model size and pre-training data to further enhance its zero-shot and few-shot capabilities.

Citation: Bogdanov, S., et al. (2024). NuNER: Entity Recognition Encoder Pre-training via LLM-Annotated Data. Proceedings of EMNLP 2024.

Summary updated

BibTeX
@inproceedings{bogdanov2024nuner,
  author = {Sergei Bogdanov and Alexandre Constantin and Timothée Bernard and Benoît Crabbé and Etienne Bernard},
  title = {{NuNER: Entity Recognition Encoder Pre-training via LLM-Annotated Data}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  doi = {10.18653/v1/2024.emnlp-main.660},
}
Figure