Preprint
Machine Learning

NuNER

February 1, 2024

0

Citations

0

Influential Citations

Venue

2024

Year

Abstract

A foundation model for Named Entity Recognition (NER) created by further pre-training RoBERTa, using contrastive training on a large dataset annotated by GPT-3.5, derived from a subset of C4.

Analysis

Why This Paper Matters

Named Entity Recognition (NER) is a cornerstone of information extraction, but traditional approaches require large, carefully annotated datasets for each new domain or entity type. Large language models (LLMs) like GPT-4 can perform NER zero-shot, but their size and cost make them impractical for many production systems. NuNER bridges this gap by showing that a compact encoder model (125M parameters) can match or exceed the few-shot performance of models 56 times larger, using synthetic annotations from GPT-3.5. This matters because it offers a practical, data-efficient path to deploy high-quality NER without massive compute budgets or extensive human annotation.

How It Works

Figure 1

NuNER's innovation lies in its pre-training data and contrastive learning objective. The authors start with a random sample of C4, a diverse English web corpus, and annotate it using GPT-3.5-turbo with a prompt that encourages extracting any entity, concept, or idea—not just traditional NER types like person or organization. This yields 1 million sentences with 4.38 million entity annotations across 200,000 unique concepts, ranging from concrete entities to abstract topics.

NuNER creation procedure.

Because the concept set is large and imbalanced, standard token classification over a fixed label set is impractical. Instead, NuNER uses a contrastive learning framework with two encoders: a text encoder (RoBERTa-base) that produces token embeddings, and a concept encoder that embeds concept names. During training, each token's embedding is pushed toward the embedding of its annotated concept and away from others via a logistic sigmoid on the dot product. This encourages the text encoder to learn a representation space where entity tokens cluster by semantic concept.

NuNER's pre-training procedure.

After pre-training, the concept encoder is discarded, and the text encoder (NuNER) can be fine-tuned on downstream NER tasks by adding a simple classification head. The bottom six layers of RoBERTa are frozen during pre-training for stability, and the model is trained for 10 epochs.

Results

Figure 6

In few-shot experiments with frozen backbones, NuNER significantly outperforms RoBERTa pre-trained on the NER-BERT dataset across all training sizes and datasets. When integrated into the TadNER framework for Few-NERD, NuNER sets a new state-of-the-art.

Few-NERD performance using TadNER and a modified TadNER using NuNER-BERT as the backbone.

Comparing directly with generative LLMs, NuNER starts lower than GPT-3.5 and GPT-4 in zero-shot but quickly catches up. With more than 8 examples per entity type, it surpasses GPT-3.5 and matches UniversalNER, despite being 56 times smaller.

Comparison of NuNER with LLMs.

In the standard k∼2k few-shot setting, NuNER and UniversalNER achieve similar entity-level F1 scores, suggesting that encoder models have an inherent advantage for NER tasks due to their token-level representations.

NuNER vs. UniversalNER few-shot entity-level F1-score in the k ∼ 2k setting.

Significance

NuNER demonstrates that synthetic data from LLMs can be effectively distilled into compact encoder models for NER, achieving strong few-shot performance without the computational overhead of generative models. This opens the door for practical, low-cost NER systems that can be quickly adapted to new domains with minimal labeled examples. The contrastive pre-training approach also provides a template for leveraging LLM-generated annotations in other token-level tasks. However, the reliance on exact string matching for entity positions and the noisy, imbalanced concept set highlight areas for future improvement. Overall, NuNER is a step toward democratizing high-quality NER for real-world applications.