PromptNER: Prompting For Named Entity Recognition

Dhananjay Ashok, Zachary C. LiptonarXiv 2023

TL;DR

This paper introduces PromptNER, a novel approach to Named Entity Recognition (NER) that leverages Large Language Models (LLMs) with a prompting strategy. PromptNER achieves state-of-the-art results in few-shot and cross-domain NER by combining entity definitions, few-shot examples, and a structured output format, all without requiring model fine-tuning.

What Problem Does This Paper Address?

Named Entity Recognition (NER) is a crucial task in natural language processing for extracting structured information. Traditional NER methods often require large amounts of labeled data specific to a domain and fixed entity definitions. This makes them inflexible and challenging to adapt to new domains or scenarios where entity definitions might vary. While recent advances in LLMs have shown promise for few-shot learning in other NLP tasks, they haven't yet reached state-of-the-art performance in NER, often lagging behind fine-tuned models. The core challenge is to create an NER system that is adaptable, requires minimal labeled data, and can achieve high performance across diverse domains.

Methods

PromptNER is a prompting-based NER method that utilizes a backbone LLM. Its key components are:

  • Modular Definitions: Instead of relying solely on examples, PromptNER uses a natural language description of entity types. This definition can be easily adapted to new domains and doesn't require technical expertise.
  • Few-Shot Examples: A small set of labeled examples from the target domain is provided to guide the LLM.
  • Precise Output Format: The LLM is prompted to produce a structured output that includes potential entities, explanations for why they are or are not entities, and their types. This structured output is inspired by "Chain-of-Thought" prompting, encouraging the LLM to "reason" about its decisions.

The method's flexibility comes from its ability to adapt to new domains by simply modifying the entity definition and the few-shot examples, without any parameter updates to the LLM.

Datasets

PromptNER was evaluated on several standard NER datasets:

  • CoNLL: A widely used dataset for NER.
  • GENIA: A biomedical dataset.
  • FewNERD: A dataset designed for few-shot NER, with an "Intra" split used for contradictory domain settings.
  • CrossNER: A benchmark for cross-domain NER, featuring five domains (Politics, Literature, Music, AI, Natural Sciences) with distinct entity types.

The paper does not introduce new benchmarks but focuses on evaluating PromptNER's performance on existing ones, particularly in low-resource and cross-domain settings.

Key Insights and Ideas

  • Definitions are Crucial: The inclusion of natural language entity definitions significantly improves performance, especially in domains where entity concepts might be ambiguous or differ from common understanding.
  • Structured Output Aids Reasoning: Prompting the LLM to provide explanations for its entity predictions (Chain-of-Thought) is vital for achieving high accuracy.
  • LLM Scaling Matters: Larger LLMs (like GPT-4) consistently outperform smaller ones, demonstrating the benefits of scaling for this prompting-based approach.
  • Flexibility Without Fine-tuning: PromptNER's ability to adapt to new tasks and domains by simply changing definitions and examples, without any model fine-tuning, is a significant advantage for practical applications.
  • Human Evaluation Reveals Nuance: A human survey indicated that in many cases where PromptNER's predictions differed from ground truth, annotators considered PromptNER's output to be equally valid or even better, suggesting that traditional F1 scores might underestimate the model's true performance in ambiguous cases.

Key Results

PromptNER achieved state-of-the-art results across several benchmarks:

  • Few-Shot NER:
    • CoNLL: 4% absolute improvement in F1 score.
  • GENIA: 9% absolute improvement in F1 score.
  • FewNERD (Intra): 4% absolute improvement in F1 score.
  • Cross-Domain NER (CrossNER):
    • Outperformed prior methods on 3 out of 5 target domains.
  • Achieved an average F1 gain of 3%.
  • Crucially, it used less than 2% of the available training data compared to other methods.
  • Ablation Studies: Removing any of the core components (definitions, few-shot examples, Chain-of-Thought explanations) led to a decrease in performance, highlighting the synergistic effect of PromptNER's design.

Limitations and Future Work

  • Span Preservation: PromptNER, being a text-generation model, cannot directly preserve exact span information. This requires a post-processing step to extract entities, which can be suboptimal.
  • Data Contamination: The use of pre-trained LLMs means there's a possibility that evaluation data was seen during training, though the authors argue this is less likely for newer datasets like CrossNER and FewNERD.
  • Interpretability: While the explanations provided by the LLM offer insights, they should not be solely relied upon for true interpretability, as they can sometimes be logically inconsistent.
  • Candidate Lists: The generated candidate lists might not always contain all entities, so they shouldn't be treated as a complete set.

Future work could explore more robust methods for span extraction and further investigate the impact of LLM scaling and architectural choices on PromptNER's performance. The authors also suggest that human evaluation is crucial for understanding model performance, especially in domains with inherent ambiguity.

Summary updated

Abstract

In a surprising turn, Large Language Models (LLMs) together with a growing arsenal of prompt-based heuristics now offer powerful off-the-shelf approaches providing few-shot solutions to myriad classic NLP problems. However, despite promising early results, these LLM-based few-shot methods remain far from the state of the art in Named Entity Recognition (NER), where prevailing methods include learning representations via end-to-end structural understanding and fine-tuning on standard labeled corpora. In this paper, we introduce PromptNER, a new state-of-the-art algorithm for few-Shot and cross-domain NER. To adapt to any new NER task PromptNER requires a set of entity definitions in addition to the standard few-shot examples. Given a sentence, PromptNER prompts an LLM to produce a list of potential entities along with corresponding explanations justifying their compatibility with the provided entity type definitions. Remarkably, PromptNER achieves state-of-the-art performance on few-shot NER, achieving a 4% (absolute) improvement in F1 score on the ConLL dataset, a 9% (absolute) improvement on the GENIA dataset, and a 4% (absolute) improvement on the FewNERD dataset. PromptNER also moves the state of the art on Cross Domain NER, outperforming prior methods (including those not limited to the few-shot setting), setting a new mark on 3/5 CrossNER target domains, with an average F1 gain of 3%, despite using less than 2% of the available data.
BibTeX
@misc{ashok2023promptner,
  author = {Dhananjay Ashok and Zachary C. Lipton},
  title = {{PromptNER: Prompting For Named Entity Recognition}},
  year = {2023},
  eprint = {2305.15444},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2305.15444},
}
Figure