NER-MQMRC: Formulating Named Entity Recognition as Multi Question Machine Reading Comprehension

Anubhav Shrimal, Avi Jain, Kartik Mehta, Promod YenigallaNAACL 2022

Abstract

Named Entity Recognition (NER) is a fundamental task in natural language processing, traditionally addressed through sequence labeling or single-question machine reading comprehension (SQMRC). While SQMRC leverages semantic information to improve extraction, it suffers from significant computational overhead when scaling to numerous entity types. We present NER-MQMRC, a framework that reformulates NER as a multi-question MRC task. By processing multiple entity queries in a single model pass, NER-MQMRC achieves substantial speedups in both training and inference while maintaining or improving state-of-the-art accuracy across diverse datasets.

Introduction

Traditional NER systems often treat the task as a sequence labeling problem (NER-SL). Although efficient, NER-SL fails to utilize the semantic meaning of entity labels and requires extensive retraining for new entity types. Recent shifts toward Single-Question Machine Reading Comprehension (NER-SQMRC) have addressed these semantic limitations by framing entity extraction as a question-answering task (e.g., "What is the brand?"). However, SQMRC introduces a linear computational bottleneck: extracting $N$ entity types requires $N$ separate model passes. For large-scale applications like e-commerce, where thousands of attributes may need extraction, this approach is computationally prohibitive.

Methodology

The NER-MQMRC framework addresses the efficiency gap of SQMRC by enabling parallel entity extraction within a single transformer pass.

Input Architecture and Multi-Entity Questions

Instead of multiple independent passes, NER-MQMRC concatenates the context text with multiple entity questions or names in a single input string. These questions are delimited by a special [ENT] token, which serves as a placeholder for the specific entity type being queried. This allows the model's self-attention mechanism to process all queries simultaneously relative to the same context.

Model Architecture and Interaction Layer

The core of the architecture is a BERT-based encoder. The model learns unique embeddings for each [ENT] token, representing the semantic essence of the corresponding entity query. To determine the presence of an entity, the model computes an element-wise product between the context token embeddings ($t_i$) and the entity-specific embeddings ($ent_j$).

The NER-MQMRC architecture showing the flow from input embeddings through BERT to interaction layers and final BIO tagging.

The resulting interaction embeddings ($p_{ij}$) are then passed to a classification layer that predicts BIO (Beginning, Inside, Outside) tags for every context token relative to every entity in the input. This design naturally handles overlapping entities and multiple values for a single attribute.

Experimental Setup

The model was evaluated across three diverse datasets to prove its versatility:

  • AE-Pub: A public AliExpress dataset containing over 110,000 triplets from sports and entertainment domains.
  • Ecommerce5PT: An internal Amazon dataset featuring 33 attributes across five product categories, validated with high-quality manual audits.
  • Twitter: A standard NER dataset for identifying People, Locations, and Organizations in noisy social media text.

Results and Discussion

NER-MQMRC demonstrates superior performance in both efficiency and accuracy compared to SQMRC and traditional multi-task baselines.

Efficiency Gains

The most significant advantage of NER-MQMRC is its computational efficiency. By parallelizing queries, the model achieves a 2.5x speedup in training and a 2.3x speedup in inference relative to the SQMRC baseline. In production environments, this translates to a nearly 60% reduction in training costs.

Relative runtime comparison for training and inference across three datasets, demonstrating the efficiency of NER-MQMRC over the SQMRC baseline.

Accuracy and Few-Shot Learning

Despite the increased efficiency, NER-MQMRC consistently outperforms SQMRC in F1 scores, with gains of +0.41% on AE-Pub and +0.32% on Ecommerce5PT. Furthermore, the model exhibits robust few-shot learning capabilities; by leveraging the semantic descriptions of entities, it significantly outperforms standard multi-task models when training data is limited (e.g., as few as 2,500 samples).

Robustness and Consolidation

The researchers found that shuffling the order of entity questions during training is essential to prevent the model from developing positional biases. Additionally, a single "generalist" NER-MQMRC model was shown to outperform an ensemble of five specialized models by 2.14% F1, suggesting that multi-question formulation enhances the model's ability to generalize across domains.

Conclusion

NER-MQMRC successfully bridges the gap between the semantic richness of MRC-based NER and the efficiency of sequence labeling. By reformulating the task to handle multiple questions simultaneously, the framework provides a scalable solution for large-scale entity extraction tasks. Future work will explore scaling to thousands of attributes and integrating more advanced MRC techniques like knowledge distillation.

Summary updated

BibTeX
@inproceedings{shrimal2022ner,
  author = {Anubhav Shrimal and Avi Jain and Kartik Mehta and Promod Yenigalla},
  title = {{NER-MQMRC: Formulating Named Entity Recognition as Multi Question Machine Reading Comprehension}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2022},
  doi = {10.18653/v1/2022.naacl-industry.26},
}
Figure