Abstract
Traditional Named Entity Recognition (NER) often struggles with nested entities, where one entity is contained within another. Existing span-based or sequence-to-sequence methods face challenges like computational complexity or arbitrary output ordering. This paper introduces a Sequence-to-Set network that treats nested NER as an unordered set prediction problem. By employing a non-autoregressive decoder with learnable entity queries and a bipartite matching loss, the model achieves state-of-the-art performance across multiple benchmarks, including ACE 2004, ACE 2005, and KBP 2017.
Introduction
Traditional Named Entity Recognition (NER) identifies "flat" entities (e.g., "New York"). However, real-world data often contains nested entities, where one entity resides inside another. For example, in the phrase "a professor of psychiatry at nyu", a model needs to identify both the shorter entity "nyu" (Organization) and the longer entity "a professor of psychiatry at nyu" (Person).
Existing solutions generally fall into two camps, both with significant flaws:
- Span-based methods: These treat every possible combination of words as a candidate. This leads to a massive search space and often ignores the relationships between entities.
- Sequence-to-Sequence (Seq2Seq) methods: These generate entities one by one. Because entities in a sentence lack a natural "order," forcing the model to learn an arbitrary sequence (e.g., left-to-right) creates an unreasonable training loss if the model predicts the correct entities but in a different order.
Methodology
The proposed Sequence-to-Set architecture predicts all entities simultaneously in a single pass, bypassing the limitations of sequential generation.
Sequence Encoder
The model uses a combination of BERT, GloVe, POS tags, and character-level embeddings. These are processed through a BiLSTM to create a rich contextual representation of the input text.
Entity Set Decoder
Instead of generating tokens, this Transformer-based decoder uses a fixed set of learnable vectors (entity queries). These queries "probe" the encoded sequence to identify valuable spans. Because it is non-autoregressive, it predicts the entire set of entities at once. By allowing entity queries to interact via self-attention, the model naturally captures dependencies between entities (e.g., identifying a "Person" may help locate the "Organization" they belong to).
Bipartite Matching Loss
To train the model without forcing a specific output order, the authors utilize the Hungarian Algorithm. This algorithm finds the optimal one-to-one matching between the model's $N$ predictions and the actual ground-truth entities, minimizing the total cost based on classification and boundary accuracy.
Experimental Results
The model was evaluated on four widely recognized nested NER benchmarks: ACE 2004, ACE 2005, KBP 2017, and GENIA.
The Sequence-to-Set model achieved new state-of-the-art (SOTA) F1 scores on three of the four datasets:
- ACE 2004: 87.26% F1 (+0.56% over previous SOTA)
- ACE 2005: 87.05% F1 (+1.65% over previous SOTA)
- KBP 2017: 83.96% F1 (+2.99% over previous SOTA)
- GENIA: 80.44% F1 (Comparable to the SOTA of 80.50%)
Ablation studies confirmed that the interaction between entity queries via self-attention was crucial; removing it caused performance to drop significantly (up to 2.87% on ACE 2005).
Discussion and Key Insights
The core innovation of this work is the realization that NER is a set prediction problem, not a sequence labeling task. Treating it as a sequence is a legacy of older architectures rather than a requirement of the data. By eliminating exhaustive searches (common in span-based models) and order-sensitivity (common in Seq2Seq models), the Sequence-to-Set approach streamlines the identification of complex entity structures.
Conclusion
While the model performs exceptionally well on general-purpose datasets, its performance on the specialized GENIA medical dataset was comparable but not superior to existing methods. This suggests that medical entities may require different representational strategies. Future research will focus on finding even more robust ways to represent the complex hierarchies and relationships inherent in nested entities.
Summary updated