Debiasing Generative Named Entity Recognition by Calibrating Sequence Likelihood

Yu Xia, Yongwei Zhao, Wenhao Wu, Sujian Li

Abstract

Generative Named Entity Recognition (NER) models often suffer from training bias due to the deterministic nature of Maximum Likelihood Estimation (MLE), which forces the model to favor a single "gold" sequence even when other valid orderings exist. This paper proposes RerankNER, a calibration method that aligns a model's internal confidence with its actual task performance (F1 score) using contrastive learning. By fine-tuning the generator with a ranking loss, RerankNER achieves state-of-the-art results across flat, nested, and discontinuous NER benchmarks, effectively bridging the "likelihood-performance gap."

Introduction

Named Entity Recognition (NER) has evolved to handle complex structures, including flat, nested (e.g., "University of Washington" containing both an Organization and a Location), and discontinuous entities. Sequence-to-sequence (Seq2Seq) models are popular for these tasks due to their flexibility in generating arbitrary entity structures. However, standard training via Maximum Likelihood Estimation (MLE) creates a deterministic bias: the model learns to over-rely on a specific sequence order rather than the underlying information.

The authors identify a significant "likelihood-performance gap," where the most likely sequence produced during beam search is often not the most accurate. Oracle analysis shows that the best candidate in the top-5 list typically has an F1 score 8.1 points higher than the top-ranked candidate.

Methodology: The RerankNER Approach

RerankNER is a two-stage approach designed to calibrate model likelihoods so that the most accurate sequences become the most probable. After initial training with standard MLE, the model (BART-large) undergoes a calibration stage using a novel contrastive loss.

Overview of the RerankNER training architecture and the three loss components: MLE, Gold, and Rank.

The calibration objective consists of three parts:

  1. $\mathcal{L}_{MLE}$: Maintains the model's fundamental text generation capabilities.
  2. $\mathcal{L}_{Rank}$: A margin ranking loss that forces the model to assign higher likelihoods to candidate sequences with higher F1 scores.
  3. $\mathcal{L}_{Gold}$: Ensures that the ground-truth (gold) sequence remains the most probable, preventing generated candidates from accidentally overtaking it.

Unlike traditional rerankers that use a separate "judge" model, RerankNER fine-tunes the original generator, allowing it to learn to generate higher-quality candidates directly.

Experimental Setup

The researchers evaluated RerankNER on eight widely used benchmarks covering three distinct NER subtasks:

  • Flat NER: CoNLL03, OntoNotes 5.0.
  • Overlapped (Nested) NER: ACE 2004, ACE 2005, GENIA.
  • Discontinuous NER: CADEC, ShARe13, ShARe14.

Key Results and Insights

RerankNER consistently outperformed the baseline (BARTNER) across all datasets. It achieved 93.48 F1 on CoNLL03 and 86.22 F1 on ACE 2005, narrowing the gap with specialized discriminative models.

A core insight is that calibration provides the most significant boost to "hard" cases where the model was initially uncertain. By aligning likelihood with F1 performance, the model's "judgment" improves, pushing better answers to the top of the results.

Example of sequence likelihood calibration: RerankNER adjusts the model's confidence to align with the actual F1 score of candidates.

The "Hit@top-k" rate also improved across the board, demonstrating that the calibration effectively reorders the search space to favor high-quality outputs.

Conclusion

RerankNER demonstrates that the performance of generative NER models can be significantly enhanced by addressing the deterministic bias inherent in MLE training. While the calibration stage introduces some computational overhead due to beam search during training, the gains in accuracy and the ability to bridge the "oracle gap" make it a compelling approach. Future work will explore scaling these calibration techniques to massive Large Language Models (LLMs).

Summary updated

BibTeX
@inproceedings{xia2023debiasing,
  author = {Yu Xia and Yongwei Zhao and Wenhao Wu and Sujian Li},
  title = {{Debiasing Generative Named Entity Recognition by Calibrating Sequence Likelihood}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  doi = {10.18653/v1/2023.acl-short.98},
}
Figure