Skip to main content
QUICK REVIEW

[Paper Review] Learning In-context Learning for Named Entity Recognition

Jiawei Chen, Yaojie Lu|arXiv (Cornell University)|May 18, 2023
Topic ModelingComputer Science3 citations
TL;DR

This paper proposes MetaNER-ICL, a novel in-context learning framework for few-shot named entity recognition that models pre-trained language models (PLMs) as meta-functions to dynamically construct entity extractors from instructions and few-shot demonstrations. By pre-training PLMs to align in-context extractors with fine-tuned surrogate extractors, the method achieves strong zero-shot generalization to novel entity types without retraining, outperforming fine-tuned PLMs on 4 few-shot NER benchmarks.

ABSTRACT

Named entity recognition in real-world applications suffers from the diversity of entity types, the emergence of new entity types, and the lack of high-quality annotations. To address the above problems, this paper proposes an in-context learning-based NER approach, which can effectively inject in-context NER ability into PLMs and recognize entities of novel types on-the-fly using only a few demonstrative instances. Specifically, we model PLMs as a meta-function $\mathcal{ λ_ { ext{instruction, demonstrations, text}}. M}$, and a new entity extractor can be implicitly constructed by applying new instruction and demonstrations to PLMs, i.e., $\mathcal{ (λ. M) }$(instruction, demonstrations) $ o$ $\mathcal{F}$ where $\mathcal{F}$ will be a new entity extractor, i.e., $\mathcal{F}$: text $ o$ entities. To inject the above in-context NER ability into PLMs, we propose a meta-function pre-training algorithm, which pre-trains PLMs by comparing the (instruction, demonstration)-initialized extractor with a surrogate golden extractor. Experimental results on 4 few-shot NER datasets show that our method can effectively inject in-context NER ability into PLMs and significantly outperforms the PLMs+fine-tuning counterparts.

Motivation & Objective

  • Address the challenge of recognizing novel entity types in real-world NER applications where new types emerge and high-quality annotations are scarce.
  • Overcome the limitations of fine-tuning (expensive retraining) and metric-based methods (sensitivity to domain shift, fixed architecture) in few-shot NER.
  • Enable on-the-fly recognition of new entity types using only a few demonstrative examples without updating model weights.
  • Inject in-context NER capability into PLMs through a meta-function pre-training strategy that aligns in-context extractors with fine-tuned surrogate extractors.
  • Develop a generalizable framework that leverages the language understanding and generation power of PLMs for dynamic, instruction- and demonstration-driven entity extraction.

Proposed method

  • Model PLMs as a meta-function λ(instructions, demonstrations, text).M that implicitly constructs a new entity extractor F: text → entities by applying instructions and demonstrations to the model.
  • Introduce a meta-function pre-training algorithm that compares the (instruction, demonstration)-initialized extractor with a surrogate golden extractor trained via fine-tuning.
  • Use representation-level contrastive learning between the encoder features of the in-context extractor and the surrogate golden extractor to align their outputs.
  • Pre-train the model on a large-scale, distantly supervised NER dataset from Wikipedia and Wikidata to inject in-context NER ability.
  • Apply the pre-trained model to downstream few-shot NER tasks by prompting with new instructions and demonstrations at inference time.
  • Leverage the full contextual and generative capacity of PLMs to generalize across diverse and unseen entity types without parameter updates.

Experimental results

Research questions

  • RQ1Can in-context learning be effectively injected into pre-trained language models to enable on-the-fly recognition of novel entity types with only a few demonstrations?
  • RQ2How can a meta-function pre-training strategy align in-context extractors with fine-tuned surrogate extractors to improve generalization in few-shot NER?
  • RQ3Does modeling PLMs as meta-functions lead to better performance than fine-tuning-based methods in low-resource, few-shot NER scenarios?
  • RQ4To what extent does the proposed method generalize across diverse entity types and domains without retraining?
  • RQ5Can representation-level alignment between in-context and surrogate extractors serve as an effective proxy for meta-learning in few-shot NER?

Key findings

  • MetaNER-ICL significantly outperforms PLM-fine-tuning baselines on 4 few-shot NER benchmarks, achieving 57.40 F1 in 1-shot and 63.45 F1 in 5-shot on CoNLL03.
  • The meta-function pre-training strategy effectively equips PLMs with in-context NER ability, as evidenced by the close alignment between the (instruction, demonstration)-initialized extractor and the surrogate golden extractor in representation space.
  • The method generalizes well to unseen entity types, enabling on-the-fly recognition without retraining or parameter updates.
  • Fine-tuned models (MetaNER-FT) still outperform in-context learning versions (MetaNER-ICL), indicating a generalization-specialization trade-off inherent in in-context learning.
  • The surrogate golden extractor provides a reliable approximation of the true golden extractor, validating the use of representation-level comparison in meta-function pre-training.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.