Papers
Topics
Authors
Recent
Search
2000 character limit reached

Query-Based Named Entity Recognition

Updated 19 July 2026
  • Query-Based NER is a paradigm where entity extraction is driven by explicit query signals, enabling flexible handling of nested and overlapping entities.
  • It leverages various formulations—from MRC-style natural language questions to learnable instance queries—to enhance accuracy and address low-resource challenges.
  • Recent advances extend this framework to multimodal settings and optimize performance through diverse query representations and efficient inference strategies.

Query-Based Named Entity Recognition (Query-Based NER) denotes a family of NER formulations in which entity extraction is conditioned on an explicit query signal rather than only on a fixed token-label inventory. In the literature, that query signal has taken several forms: a natural-language question such as “which person is mentioned in the text?”, a descriptive type prompt, a weighted feature vector derived from a CRF-style model, a bank of learnable instance queries, or a token-centered latent query tied to a proposed start position (Meng et al., 2019, Li et al., 2019, Foley et al., 2018, Shen et al., 2022, Yan et al., 2022). Across these variants, the core idea is stable: the target entity notion is supplied or instantiated at query time, and the model extracts spans, entities, or structured entity hypotheses conditional on that query. This framing has been used to address nested and overlapping entities, long-tail entity classes, low-resource supervision, multimodal grounding, and large-label-space extraction.

1. Conceptual scope and historical development

An early precursor appears in “Named Entity Recognition with Extremely Limited Data” (Foley et al., 2018), which introduces Named Entity Search (NES). NES reframes NER as search under extreme label scarcity: the entity class is the query, each token occurrence is treated as a document, token features are treated as terms, and ranking replaces conventional sequence labeling. The paper makes the formulation explicit through the linear scoring function

p(Qx)=k=1KQkfk(x)=Qf(x),p(Q \mid x) = \sum_{k=1}^{K} Q_k f_k(x) = \vec{Q}\cdot \vec{f}(x),

where the target entity class is represented by a query vector and each token occurrence by a feature vector (Foley et al., 2018). This was not a modern MRC-style method, but it established a retrieval-oriented view in which the entity type is supplied at query time rather than fixed in advance.

The canonical MRC-style turn appears in 2019. “Query-Based Named Entity Recognition” (Meng et al., 2019) and “A Unified MRC Framework for Named Entity Recognition” (Li et al., 2019) both recast NER as answering a query for each entity type. A representative example is to formalize [PER](https://www.emergentmind.com/topics/preference-informed-edge-reweighting-per) extraction as answering “which person is mentioned in the text?” (Li et al., 2019). These papers argue that sequence labeling struggles with overlapping or nested entities because one token can only receive one label at a time, whereas independent type-conditioned extraction allows the same token to participate in answers to multiple queries (Meng et al., 2019).

Subsequent work broadened what counts as a “query.” “Parallel Instance Query Network for Named Entity Recognition” (Shen et al., 2022) replaces manually written type-specific natural-language questions with learnable instance queries. “Local Hypergraph-based Nested Named Entity Recognition as Query-based Sequence Labeling” (Yan et al., 2022) uses a different notion again: the query is a token-centered contextual representation associated with a proposed start token. More recent multimodal systems use query-guided set prediction or text-guided learned queries rather than human-authored questions (Tang et al., 2024, Li et al., 18 Mar 2026).

A concise taxonomy emerging from these papers is as follows.

Branch Query representation Representative papers
Retrieval-oriented NES Weighted feature vector over token features (Foley et al., 2018)
MRC-style Query-Based NER Natural-language type question or description (Meng et al., 2019, Li et al., 2019)
Multi-question MRC Multiple type queries jointly encoded (Shrimal et al., 2022)
Learned-query set prediction Global learnable instance/entity queries (Shen et al., 2022, Tang et al., 2024, Li et al., 18 Mar 2026)
Query-based sequence labeling Start-token-centered latent query (Yan et al., 2022)
Generative prompt-based NER Type-specific prompt instruction (Wang et al., 2023)

This diversity is important because “query-based NER” is not a single architecture class. A common misconception is to equate it only with MRC over natural-language questions. The literature here suggests a broader definition in which the query can be symbolic, descriptive, learned, retrieval-based, or latent, so long as extraction is explicitly conditioned on that query.

2. Canonical MRC-style formulation

In the MRC-style formulation, the input text is

X={x1,x2,,xn},X=\{x_1,x_2,\ldots,x_n\},

and for each entity type yYy \in Y, a corresponding query qyq_y is constructed (Meng et al., 2019, Li et al., 2019). The model is then given the query and the context jointly, typically in BERT format

[CLS],qy,[SEP],X,[SEP],[\mathrm{CLS}], q_y, [\mathrm{SEP}], X, [\mathrm{SEP}],

and must extract the answer span or spans in the context that satisfy the query (Meng et al., 2019).

The simplest version, in “Query-Based Named Entity Recognition” (Meng et al., 2019), uses BERT plus start/end prediction. For each token in the context, the model predicts whether it is a start or end position of the answer. The paper uses Dice loss

Ldice=12i=0npigi+λi=0npi2+i=0ngi2+λL_{dice}=1-\frac{2\sum_{i=0}^{n} p_i g_i+\lambda}{\sum_{i=0}^{n} p_i^2+\sum_{i=0}^{n} g_i^2+\lambda}

to address the severe class imbalance inherent in start/end prediction (Meng et al., 2019). Its decoder is simple: if more than one start is predicted, it selects the one with the smallest index; if more than one end is predicted, it selects the one with the largest index; if either is missing, it returns NULL (Meng et al., 2019). This design was sufficient to demonstrate large gains on nested benchmarks, but it also exposed a limitation of the early formulation: the described decoding procedure is closer to single-answer QA than to full multi-span extraction.

“A Unified MRC Framework for Named Entity Recognition” (Li et al., 2019) addresses that limitation by decomposing prediction into three supervised subproblems: token-level start prediction, token-level end prediction, and start-end span matching. The core components are

Pstart=softmaxeach row(ETstart),Pend=softmaxeach row(ETend),P_\text{start}=\text{softmax}_\text{each row}(E\cdot T_\text{start}), \qquad P_\text{end}=\text{softmax}_\text{each row}(E\cdot T_\text{end}),

followed by a pairwise matching classifier over candidate start/end embeddings (Li et al., 2019). The total loss is

L=αLstart+βLend+γLspan.\mathcal{L}=\alpha\mathcal{L}_\text{start}+\beta\mathcal{L}_\text{end}+\gamma\mathcal{L}_\text{span}.

This formulation supports multiple spans for a queried type and is explicitly presented as a unified framework for both flat and nested NER (Li et al., 2019).

The significance of the MRC formulation lies in two repeated claims across the literature. First, it injects label semantics because the entity type is represented as language rather than as an opaque class index. Second, it handles overlap across different categories naturally because extraction for different types is performed by answering independent queries (Meng et al., 2019, Li et al., 2019). This suggests that the conceptual gain is not merely architectural; it is a change in task formulation from token tagging to query-conditioned extraction.

3. Query design and semantic conditioning

Query design is a central variable in Query-Based NER. The literature compares natural-language questions, short descriptive prompts, keyword labels, pseudo queries, index queries, annotation-guideline queries, and type descriptions.

“Query-Based Named Entity Recognition” (Meng et al., 2019) compares three query types on Chinese OntoNotes: index query, pseudo query, and natural language query. Reported F1 scores are 81.14 for index queries, 81.82 for pseudo queries, and 82.11 for natural-language queries (Meng et al., 2019). The paper interprets this as evidence that richer query wording carries informative prior knowledge about the target entity type.

“A Unified MRC Framework for Named Entity Recognition” (Li et al., 2019) studies query construction even more systematically. On OntoNotes 5.0, it compares position index of labels (88.29), keywords (89.74), Wikipedia (89.66), rule-based template filling (89.30), synonyms (89.92), keywords + synonyms (90.23), and annotation guideline notes (91.11) (Li et al., 2019). The best-performing queries are the dataset’s own annotation guideline notes, such as “Find organizations in the text, including companies, agencies and institutions” (Li et al., 2019). This result is important because it shows that query quality is not reducible to mere presence of a label name; annotation-specific semantic content matters.

The same pattern appears in multimodal query-grounded MNER. “MNER-QG” (Jia et al., 2022) compares four query forms: a keyword only query, a rule-based template, a Wikipedia definition, and a keyword + annotation description such as “Organization: Include club, company, government party, school government, and news organization.” The paper reports that the fourth form performs best on both MNER and query grounding (Jia et al., 2022).

A broader survey perspective reinforces this interpretation. “Recent Advances in Named Entity Recognition: A Comprehensive Survey and Comparative Study” (Keraghel et al., 2024) does not define Query-Based NER as a standalone category, but it treats prompt-based, template-based, and description-based NER as closely related paradigms. Its synthesis is that these methods matter especially when entity types are represented through natural-language definitions, descriptions, prompts, or templates rather than fixed symbolic labels (Keraghel et al., 2024).

The cumulative implication is that query wording is not a superficial interface detail. It is part of the supervision signal. This also creates a practical tension: natural-language descriptions can improve generalization and disambiguation, but they introduce query engineering as a modeling variable.

4. Architectural diversification beyond single-query MRC

The single-query-per-type architecture is only one branch of Query-Based NER. Several later systems modify the unit of querying, the number of queries per pass, or the decoding regime.

“NER-MQMRC: Formulating Named Entity Recognition as Multi Question Machine Reading Comprehension” (Shrimal et al., 2022) proposes multi-question MRC. Instead of creating kk separate examples per text for kk entity types, it concatenates all questions in one BERT input: X={x1,x2,,xn},X=\{x_1,x_2,\ldots,x_n\},0 The model extracts an embedding for each entity via its associated [ENT] marker, combines it with every token embedding through element-wise product, and predicts BIO labels for each token-entity pair with

X={x1,x2,,xn},X=\{x_1,x_2,\ldots,x_n\},1

optimized by

X={x1,x2,,xn},X=\{x_1,x_2,\ldots,x_n\},2

Empirically, it reports average 2.5 times faster training and 2.3 times faster inference than single-question MRC, while improving F1 by +0.41, +0.32, and +0.27 on AE-Pub, Ecommerce5PT, and Twitter respectively (Shrimal et al., 2022).

“Parallel Instance Query Network for Named Entity Recognition” (Shen et al., 2022) moves further away from manually written type-specific queries. It introduces a fixed set of learnable instance queries

X={x1,x2,,xn},X=\{x_1,x_2,\ldots,x_n\},3

encoded jointly with the sentence. Each query predicts one entity by jointly predicting left boundary, right boundary, and type. Training uses a one-to-many Linear Assignment Problem solved with the Hungarian algorithm, with assignment cost

X={x1,x2,,xn},X=\{x_1,x_2,\ldots,x_n\},4

This model supports nested NER naturally because multiple queries can predict overlapping spans (Shen et al., 2022). The paper reports new state of the art on nested benchmarks, including 88.14 F1 on ACE04, 87.42 on ACE05, 81.77 on GENIA, 84.50 on KBP17, and 94.04 on NNE, while also yielding 2.16× speedup on ACE04 and 30.46× speedup on NNE relative to type-specific MRC (Shen et al., 2022).

“Local Hypergraph-based Nested Named Entity Recognition as Query-based Sequence Labeling” (Yan et al., 2022) defines the query differently. It first proposes start-token candidates, then uses a start-token-centered query representation X={x1,x2,,xn},X=\{x_1,x_2,\ldots,x_n\},5 to initialize an LSTM that generates a local hypergraph over the suffix beginning at that token: X={x1,x2,,xn},X=\{x_1,x_2,\ldots,x_n\},6 The local label space uses X={x1,x2,,xn},X=\{x_1,x_2,\ldots,x_n\},7, X={x1,x2,,xn},X=\{x_1,x_2,\ldots,x_n\},8, and X={x1,x2,,xn},X=\{x_1,x_2,\ldots,x_n\},9-[entity-type] nodes, with paths from a fixed yYy \in Y0-node to an yYy \in Y1-node representing extracted entities (Yan et al., 2022). This avoids yYy \in Y2 span proposal and removes an explicit maximum entity length. The reported F1 scores are 88.23 on ACE04, 87.40 on ACE05, 82.03 on GENIA, and 86.03 on KBP2017 (Yan et al., 2022).

Taken together, these architectures show that the “query” in Query-Based NER can operate at different granularities: one query per type, multiple type queries per text, one query per entity instance, or one query per proposed start token. This suggests that the central abstraction is conditional extraction, not any single interface form.

5. Generative and multimodal extensions

Generative large-language-model formulations reinterpret Query-Based NER as prompt-conditioned generation rather than extractive span prediction. “GPT-NER: Named Entity Recognition via LLMs” (Wang et al., 2023) decomposes NER into one prompt per entity type, with prompts of the form “The task is to label [Entity Type] entities in the given sentence.” Instead of predicting tags or spans directly, it asks the model to reproduce the sentence while surrounding target entities with @@ and ##; for example, Columbus is a city becomes @@Columbus## is a city for location extraction (Wang et al., 2023). To counter hallucinated entities, GPT-NER adds a self-verification stage that asks the model whether an extracted span actually belongs to the queried type (Wang et al., 2023). On full test sets, the best GPT-NER variant remains below supervised MRC baselines—for example, 90.91 vs 93.04 on CoNLL2003 and 82.20 vs 91.11 on OntoNotes5.0—but it is markedly stronger in very low-resource settings, reaching about 60 F1 with only 8 examples on CoNLL2003 while the supervised comparison is around 0 (Wang et al., 2023).

Multimodal work extends the query to align textual extraction with visual evidence. “MNER-QG: An End-to-End MRC framework for Multimodal Named Entity Recognition with Query Grounding” (Jia et al., 2022) turns each sentence-image pair into a set of query-conditioned MRC instances, one per entity type. The same query conditions both textual span extraction and a query grounding module that predicts an image region relevant to the entity type (Jia et al., 2022). The total loss is

yYy \in Y3

combining grounding, existence detection, and entity span prediction (Jia et al., 2022). Reported MNER F1 reaches 74.70 on Twitter2015 and 86.94 on Twitter2017, with ablations showing that removing query grounding hurts performance on both datasets (Jia et al., 2022).

A second multimodal trajectory replaces manual type questions with learned entity queries and set prediction. “Multi-Grained Query-Guided Set Prediction Network for Grounded Multimodal Named Entity Recognition” (Tang et al., 2024) uses type-grained queries derived from prompts together with learnable entity-grained queries, then predicts an unordered set of entity quadruples under Hungarian matching (Tang et al., 2024). “A Proposal-Free Query-Guided Network for Grounded Multimodal Named Entity Recognition” (Li et al., 18 Mar 2026) uses a bank of randomly initialized learnable queries yYy \in Y4, refines them by attending to text, and decodes entity span, class, and box jointly (Li et al., 18 Mar 2026). These models are not MRC in the classical sense, but they preserve the query-based principle: extraction is driven by query representations that are refined by and interact with the input.

These extensions indicate that Query-Based NER has become a bridge concept between extractive QA, generative prompting, multimodal grounding, and DETR-style set prediction. A plausible implication is that the field has expanded from “query as natural-language type description” to “query as a learned entity hypothesis.”

6. Empirical profile, strengths, limitations, and ongoing ambiguities

The empirical strengths of Query-Based NER recur across distinct formulations. On nested benchmarks, the gains over sequence labeling are especially large. “Query-Based Named Entity Recognition” reports 84.14 F1 on ACE 2004 and 86.88 on ACE 2005, improving over BERT Tagger by +4.46 and +6.47 respectively (Meng et al., 2019). “A Unified MRC Framework for Named Entity Recognition” reports 85.98 on ACE04, 86.88 on ACE05, 83.75 on GENIA, and 80.97 on KBP2017, with particularly large improvements on GENIA (+5.44) and KBP2017 (+6.37) over prior state of the art (Li et al., 2019). In zero-shot transfer from CoNLL03 to OntoNotes 5.0, the same paper reports 72.34 for BERT-MRC versus 31.87 for BERT-Tagger, which strongly suggests that natural-language label descriptions help when the label vocabulary changes (Li et al., 2019).

Low-resource and long-tail settings are another recurring motivation. NES was explicitly designed for “extremely limited data,” asking whether “NER-style labeling” is possible with “tens of labels,” and it showed that simplifying a CRF to a retrieval-style query causes only small degradation on CoNLL while supporting interactive search for long-tail classes such as meteorites or mammals cloned (Foley et al., 2018). Its evaluation also introduced unique average precision (uAP) so that repeated mentions of the same entity do not dominate list-oriented retrieval (Foley et al., 2018). GPT-NER likewise shows a sharp low-resource advantage, though under a very different generative setup (Wang et al., 2023).

At the same time, the limitations are equally consistent. The classical MRC formulation usually requires one pass per entity type, so inference cost scales with label set size (Meng et al., 2019, Jia et al., 2022). Query wording matters: natural-language questions, guideline notes, or annotations outperform weaker identifiers, and multimodal performance depends on informative type descriptions (Meng et al., 2019, Li et al., 2019, Jia et al., 2022). Learned-query systems reduce manual prompt engineering but introduce other costs, including latent-query interpretability, query-count hyperparameters, and matching-based training complexity (Shen et al., 2022, Tang et al., 2024, Li et al., 18 Mar 2026). Some models expose formulation-specific brittleness: NER-MQMRC is sensitive to entity ordering unless order is shuffled during training, with average F1 dropping by 12.33% if order is fixed during training and shuffled at inference (Shrimal et al., 2022); NES requires large token-level indexes, with NER features on AQUAINT occupying 158 GB (Foley et al., 2018); early BERT Query decoding is heuristic and effectively single-span in the paper’s short version (Meng et al., 2019).

The term itself also remains somewhat unstable. The 2024 survey notes that “Query-Based NER” is not explicitly defined there, and nearby paradigms are discussed mainly under prompt-based LLM NER, template-based NER, and description-based zero-shot NER rather than as a standalone category (Keraghel et al., 2024). This suggests that the field contains at least two overlapping usages. In a narrow sense, Query-Based NER refers to MRC-style entity-type questions over text. In a broader sense, it includes any NER system in which extraction is governed by an explicit query representation—human-authored, retrieval-derived, prompt-based, or learned.

The literature therefore supports a broad but technically coherent understanding. Query-Based NER is not defined by a single decoder or a single encoder architecture. It is defined by the decision to make the target entity notion explicit as a query and to condition extraction on that query. Under that definition, retrieval-style NES (Foley et al., 2018), MRC-style span extraction (Meng et al., 2019, Li et al., 2019), multi-question MRC (Shrimal et al., 2022), learned instance-query systems (Shen et al., 2022), token-centered query-based sequence labeling (Yan et al., 2022), prompt-based generation (Wang et al., 2023), and query-guided multimodal grounding frameworks (Jia et al., 2022, Tang et al., 2024, Li et al., 18 Mar 2026) all belong to the same intellectual lineage.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Query-Based Named Entity Recognition.