Abstract
Named Entity Recognition (NER) is a fundamental task in information extraction. Traditional methods like sequence labeling or span classification often struggle with nested entities or suffer from slow inference in generative setups. We present DiffusionNER, a novel generative framework that treats NER as a boundary-denoising diffusion process. By gradually refining randomly sampled "noisy spans" into precise entity boundaries, DiffusionNER achieves state-of-the-art performance on both flat and nested NER tasks while offering significant speedups over traditional autoregressive models.
Introduction
Named Entity Recognition (NER) involves identifying and categorizing entities such as persons, locations, and organizations within text. While sequence labeling and span classification have been standard, they face challenges with nested entities—where one entity resides within another (e.g., "British Columbia" within "western Canadian province of British Columbia"). Recent generative models address nesting by treating NER as a sequence-to-sequence task, but their autoregressive nature makes them computationally expensive and prone to exposure bias.
DiffusionNER reframes NER as a global refinement task. Instead of sequential generation, it utilizes a diffusion process to refine a set of initial noisy spans into accurate entity boundaries simultaneously.
Methods
The DiffusionNER framework adapts the principles of diffusion models to the discrete domain of text by treating entity boundaries as continuous coordinates.
Boundary Diffusion
The process consists of two main phases:
- Forward Process: During training, Gaussian noise is added to the "golden" entity boundaries (start and end indices), transforming them into noisy spans.
- Reverse Process (Inference): Starting from pure Gaussian noise, the model iteratively "denoises" these spans over several timesteps $T$, gradually shifting the boundaries to align with actual entities.
Architecture
The core architecture consists of a Sentence Encoder and an Entity Decoder. The encoder (typically BERT + Bi-LSTM) generates contextualized representations of the input text. The Entity Decoder then takes a set of noisy spans and uses cross-attention to refine their boundaries and predict their entity types based on the sentence context.
Set-based Learning
To handle the variable number of entities in a sentence, the model predicts a fixed number of spans ($K$). During training, the Hungarian Algorithm is employed to find the optimal bipartite matching between the $K$ predictions and the $N$ ground-truth entities, ensuring a stable loss calculation.
Results and Discussion
DiffusionNER was evaluated across six major benchmarks, including nested (ACE04, ACE05, GENIA) and flat (CoNLL03, OntoNotes 5.0, MSRA) NER datasets.
Performance and Efficiency
The model achieved state-of-the-art results, notably an 88.39% F1 on ACE04 and 81.53% F1 on GENIA. Beyond accuracy, DiffusionNER offers a massive efficiency gain. By refining all potential entities in parallel rather than one-by-one, it achieved an 18x speedup over leading autoregressive generative models, processing 37.10 sentences per second on ACE04 compared to 1.98 for previous SOTA.
Key Insights
- Continuous Refinement: Treating discrete token indices as continuous values allows the model to leverage standard Gaussian diffusion, providing a robust mechanism for boundary correction.
- Progressive Denoising: The iterative nature allows the model to self-correct, pulling initially inaccurate boundaries into the correct positions over time.
Conclusion
DiffusionNER introduces a powerful new paradigm for NER by framing it as a boundary diffusion process. It effectively bridges the gap between the flexibility of generative models and the efficiency of parallel processing. While currently limited to continuous spans, future work may extend this approach to handle discontinuous entities, further broadening its applicability in complex information extraction tasks.
Summary updated