Inferensys

Glossary

Candidate Generation

The initial retrieval stage in entity linking that uses fast, approximate methods to fetch a small set of plausible knowledge base entries for a given text mention.
Knowledge engineer constructing knowledge base on laptop, document hierarchy visible, casual office setup.
ENTITY LINKING PIPELINE

What is Candidate Generation?

Candidate generation is the initial, high-recall retrieval stage in an entity linking pipeline that uses fast, approximate methods to fetch a small set of plausible knowledge base entries for a given text mention.

In clinical entity linking, candidate generation is the critical first-pass filter that reduces the search space from millions of potential concepts to a manageable shortlist—typically 5 to 50 candidates. This stage prioritizes recall over precision, ensuring the correct concept is almost certainly within the retrieved set. Common techniques include BM25 lexical retrieval against entity descriptions, dense passage retrieval using bi-encoder architectures like SapBERT, and dictionary-based lexical variant generation that programmatically expands acronyms and morphological variations to match against the UMLS Metathesaurus.

The efficiency of candidate generation directly determines the latency profile of the entire linking system. By leveraging approximate nearest neighbor (ANN) search over pre-computed dense vector indices, modern systems can retrieve candidates in sub-millisecond timeframes. Constraints like semantic type filtering—restricting matches to specific UMLS Semantic Types such as 'Clinical Drug' or 'Disease or Syndrome'—further prune irrelevant candidates before the computationally expensive candidate ranking stage applies a cross-encoder reranker for final disambiguation.

RETRIEVAL ARCHITECTURE

Key Characteristics of Candidate Generation

Candidate generation is the high-recall, low-latency first stage of entity linking that rapidly narrows a knowledge base of millions of concepts down to a manageable shortlist of plausible matches for a given text mention.

01

High Recall Over Precision

The primary objective is to ensure the true entity is present in the candidate set, even at the cost of including false positives. A recall of >95% is typically targeted. The downstream candidate ranking stage handles precision.

  • Trades specificity for comprehensiveness
  • Often uses approximate methods to avoid missing rare concepts
  • Failure here is catastrophic; a missed entity cannot be recovered later
02

Sub-Linear Retrieval Speed

Candidate generation must execute in milliseconds against knowledge bases containing millions of entities. This is achieved through indexing structures that avoid exhaustive comparison.

  • Inverted indices for lexical matching
  • Approximate Nearest Neighbor (ANN) graphs for dense vector search
  • Pre-computed alias tables mapping surface forms directly to concept IDs
03

Lexical-Dense Hybrid Retrieval

Modern pipelines combine BM25 sparse retrieval with dense bi-encoder similarity to capture both exact terminology and semantic meaning.

  • Lexical: Matches 'myocardial infarction' to entries containing that exact phrase
  • Dense: Matches 'heart attack' to 'myocardial infarction' via embedding proximity
  • Hybrid scoring merges results from both pathways for robust coverage
04

Alias and Synonym Expansion

Knowledge bases are pre-processed to generate extensive surface form dictionaries that map common clinical shorthand and variants to canonical IDs.

  • 'HTN' → Hypertension
  • 'MI' → Myocardial Infarction
  • Abbreviation expansion and lexical variant generation are critical pre-retrieval steps
  • Reduces reliance on computationally expensive semantic matching at query time
05

Semantic Type Filtering

A hard constraint applied during retrieval to restrict candidates to a specific UMLS Semantic Type. If a mention is identified as a medication, only entities typed as 'Pharmacologic Substance' or 'Clinical Drug' are considered.

  • Dramatically reduces the candidate pool size
  • Prevents cross-domain false positives (e.g., linking a drug name to a disease concept)
  • Requires accurate upstream mention type classification
06

NIL Prediction Awareness

The retrieval stage must be designed to facilitate NIL prediction—identifying when a mention has no valid target in the knowledge base. This is often handled by setting a minimum similarity threshold.

  • If no candidate exceeds the threshold, the mention is flagged as unlinkable
  • Prevents forced grounding of novel or misspelled terms
  • Critical for maintaining clinical data integrity in production systems
CANDIDATE GENERATION

Frequently Asked Questions

Clear, technical answers to the most common questions about the initial retrieval stage in clinical entity linking pipelines.

Candidate Generation is the initial, high-recall retrieval stage in an entity linking pipeline that uses fast, approximate methods to fetch a small set of plausible knowledge base entries for a given text mention. Its primary goal is to reduce the search space from millions of potential concepts to a manageable shortlist—typically 5 to 100 candidates—that a more computationally expensive Candidate Ranking model can then score precisely. This stage prioritizes recall over precision; it is acceptable to retrieve some incorrect candidates as long as the correct entity is almost always present in the candidate set. Common techniques include BM25 lexical retrieval, Approximate Nearest Neighbor (ANN) search over dense embeddings, and dictionary-based Lexical Variant Generation using pre-built alias tables from the UMLS Metathesaurus.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.