Abstract
Named Entity Recognition (NER) is traditionally categorized into three distinct subtasks: flat, nested, and discontinuous NER. Existing research often treats these as separate problems, requiring specialized architectures and tagging schemas. In this work, we present a unified generative framework that addresses all three NER subtasks using a single sequence-to-sequence model. By formulating NER as an entity span sequence generation task and employing a pointer mechanism within a pre-trained BART model, our approach achieves state-of-the-art or competitive performance across eight benchmark datasets. This unified architecture eliminates the need for task-specific modifications, demonstrating the flexibility and power of generative models in structured prediction tasks.
Introduction
Named Entity Recognition (NER) is a fundamental task in Natural Language Processing (NLP), aimed at identifying and classifying entities within text. However, the structural complexity of entities varies significantly across different domains. Traditionally, NER is divided into three categories:
- Flat NER: Entities are non-overlapping continuous spans (e.g., "Barack Obama").
- Nested NER: Entities can be contained within one another (e.g., "[The [Lincoln] Memorial]").
- Discontinuous NER: Entities consist of multiple non-contiguous spans (e.g., "muscle pain and fatigue" refers to both "muscle pain" and "muscle fatigue").
Historically, these subtasks have been addressed with specialized methods. Flat NER typically relies on sequence labeling (e.g., BIO tagging). Nested NER often requires span-based classification or complex hypergraph models. Discontinuous NER is even more challenging, frequently necessitating transition-based systems. These disparate approaches make it difficult to build a single system capable of handling all entity types simultaneously. Researchers from Fudan University have addressed this by proposing a unified generative framework that treats all NER variants as a sequence generation problem.
Methodology: NER as Sequence Generation
The core innovation of this framework is the formulation of NER as an entity span sequence generation task. Instead of assigning labels to every token, the model is tasked with "writing out" the entities it detects in a structured format.
The BART-based Architecture
The framework utilizes BART (Bidirectional and Auto-Regressive Transformers), a powerful pre-trained Seq2Seq model. BART's encoder processes the input sentence, while the decoder generates the entity sequence.
Pointer Mechanism
To handle the open-ended nature of entity spans, the authors implement a pointer mechanism. Instead of generating text from a fixed vocabulary, the decoder generates indices (pointers) that refer back to specific token positions in the input sentence. This allows the model to precisely define entity boundaries without being limited by the decoder's vocabulary.
Linearization and Representation
To convert a set of entities into a sequence for the decoder, the authors explored three linearization strategies:
- Span: Points to the start and end Byte-Pair Encoding (BPE) tokens of an entity.
- BPE: Points to every individual BPE token within the entity.
- Word: Points to the first BPE token of every word within the entity.
The "Word" representation was found to be the most effective, as it provides enough structural information for the model to learn entity patterns while keeping the target sequence length manageable. For discontinuous entities, the model simply generates multiple start/end index pairs before appending the entity type tag.
Experimental Evaluation
The model was rigorously tested on eight benchmark datasets covering all three NER categories:
- Flat NER: CoNLL2003, OntoNotes 5.0.
- Nested NER: ACE2004, ACE2005, GENIA.
- Discontinuous NER: CADEC, ShARe13, ShARe14.
Key Results
The unified framework achieved state-of-the-art (SoTA) or near-SoTA performance across all categories:
- Flat NER: 93.24 F1 on CoNLL2003 and 90.38 F1 on OntoNotes.
- Nested NER: 86.84 F1 on ACE2004, surpassing previous specialized models.
- Discontinuous NER: Significant gains were observed, with 70.64 F1 on CADEC and 80.34 F1 on ShARe14.
Notably, these results were achieved using the same architecture and hyperparameters for every task, validating the framework's versatility.
Discussion and Insights
The success of this approach stems from several factors. First, Seq2Seq models are naturally flexible, allowing them to represent complex, overlapping, or split structures that are difficult for rigid sequence labeling models. Second, BART’s pre-training on denoising tasks appears highly compatible with the task of identifying and organizing spans.
The authors also noted that the model is remarkably robust; less than 1% of its predictions were "illegal" (e.g., pointing to out-of-bounds indices). Interestingly, an analysis of recall showed that entities appearing later in a sentence were often identified more accurately, suggesting the model benefits from the context of previously generated entities in the sequence.
Conclusion and Future Work
This unified generative framework represents a significant step toward a general-purpose NER system. By moving away from task-specific tagging schemas and architectures, it simplifies the pipeline for complex NER tasks. However, the model's autoregressive nature introduces a trade-off: inference is slower than non-autoregressive sequence labeling models. Future research could focus on non-autoregressive decoding methods to improve speed without sacrificing the framework's structural flexibility.
Summary updated