Inferensys

Glossary

Candidate Generation

The initial retrieval phase in entity linking that uses a surface form dictionary or approximate nearest neighbor search to produce a shortlist of possible knowledge base entries for a given mention.
Knowledge engineer constructing knowledge base on laptop, document hierarchy visible, casual office setup.
INITIAL RETRIEVAL PHASE

What is Candidate Generation?

The first stage in entity linking that narrows the search space from millions of knowledge base entries to a manageable shortlist of plausible matches for a given textual mention.

Candidate generation is the initial, high-recall retrieval phase in an entity linking pipeline that produces a shortlist of possible knowledge base (KB) entries for a given textual mention. Using a surface form dictionary or approximate nearest neighbor (ANN) search over dense entity embeddings, it efficiently filters millions of entities down to a few dozen candidates, prioritizing recall over precision to ensure the correct entity is not prematurely discarded.

This phase typically relies on pre-built indexes mapping surface forms (names, aliases, acronyms) to KB identifiers, often augmented with prior probabilities derived from hyperlink statistics or co-occurrence counts. Modern neural approaches employ bi-encoder architectures like dense passage retrieval (DPR) to encode mentions and entity descriptions into a shared vector space, enabling semantic candidate retrieval that handles lexical variations and synonyms beyond exact string matching.

THE INITIAL RETRIEVAL PHASE

Key Characteristics of Candidate Generation

Candidate generation is the high-recall first stage of entity linking that produces a shortlist of possible knowledge base entries for a given textual mention. It trades precision for speed, ensuring the subsequent disambiguation stage has the correct entity in its candidate set.

01

Surface Form Dictionary Lookup

The most common approach uses a precomputed surface form dictionary mapping textual mentions to candidate entity IDs. This dictionary is built by mining anchor text from Wikipedia hyperlinks, page titles, and redirect pages. For the mention "Paris," the dictionary returns a list including the French capital, Paris Hilton, and Paris, Texas. The quality of this dictionary directly determines the upper bound of recall for the entire linking pipeline. Key considerations include:

  • Handling case sensitivity and punctuation normalization
  • Incorporating acronym expansion for mentions like "NLP"
  • Managing out-of-vocabulary mentions not seen during dictionary construction
02

Approximate Nearest Neighbor Search

For zero-shot candidate generation where surface form dictionaries fail, dense retrieval using bi-encoder architectures encodes the mention context and entity descriptions into a shared vector space. Systems like Dense Passage Retrieval (DPR) compute the similarity between the mention embedding and pre-indexed entity embeddings using approximate nearest neighbor (ANN) libraries such as FAISS or ScaNN. This approach excels at:

  • Handling rare or unseen surface forms not in any dictionary
  • Capturing semantic similarity beyond exact string matching
  • Scaling to knowledge bases with millions of entities via efficient indexing
03

Alias Table and Name Variants

A robust candidate generator maintains an alias table that maps multiple name variants to the same canonical entity. This includes transliterations across scripts (e.g., Москва → Moscow), common misspellings, historical names, and abbreviations. The table is constructed from:

  • Redirect pages in Wikipedia that point to the canonical article
  • Multilingual interwiki links connecting the same entity across language editions
  • Phonetic encoding algorithms like Soundex or Metaphone for fuzzy name matching Without comprehensive alias coverage, recall drops sharply for entities with multiple common designations.
04

Prior Probability and Popularity Priors

Each candidate in the generated shortlist is often assigned a prior probability P(e|m) — the likelihood that mention m refers to entity e based on frequency statistics alone, without considering context. These priors are derived from:

  • Anchor text click-through rates in Wikipedia
  • Entity popularity in large text corpora
  • Domain-specific frequency distributions for vertical applications For the mention "Mercury," the planet has a higher prior in astronomy texts, while the element dominates in chemistry contexts. These priors serve as a strong baseline signal for the downstream disambiguation ranker.
05

Blocking for Computational Efficiency

When linking against massive knowledge bases with billions of entities, exhaustive comparison is infeasible. Blocking techniques partition the search space using cheap heuristics before candidate retrieval. Common blocking keys include:

  • Token overlap between the mention and entity names
  • Entity type constraints — only consider entities matching the NER type label
  • Locality-sensitive hashing (LSH) on character n-grams Blocking dramatically reduces the number of pairwise comparisons while maintaining high recall, making candidate generation tractable at web scale.
06

Nil Prediction and NIL Handling

A critical capability is nil prediction — recognizing when a mention refers to an entity absent from the target knowledge base. The candidate generator must signal this possibility rather than forcing a false link. Strategies include:

  • Setting a confidence threshold on the top candidate's prior probability
  • Generating a special NIL candidate with a learned representation
  • Using open-world classification techniques that model the distribution of unseen entities Without proper NIL handling, systems silently introduce errors by linking mentions to incorrect but superficially similar entities.
CANDIDATE GENERATION

Frequently Asked Questions

Clear, technically precise answers to the most common questions about the initial retrieval phase in entity linking systems.

Candidate generation is the initial, high-recall retrieval phase in an entity linking pipeline that produces a shortlist of possible knowledge base entries for a given textual mention. Its primary function is to drastically reduce the search space from millions of entities to a manageable set (typically 5–100 candidates) for a downstream disambiguation stage. This is achieved by leveraging a surface form dictionary built from anchor texts, redirect pages, and aliases, or by performing an approximate nearest neighbor (ANN) search over dense entity embeddings. The goal is to maximize recall—ensuring the correct entity is in the candidate set—while maintaining computational efficiency, as exhaustive comparison against every entity in a knowledge base like Wikidata is infeasible for real-time applications.

PHASE COMPARISON

Candidate Generation vs. Entity Disambiguation

Distinguishing the retrieval-first phase from the resolution-second phase in the entity linking pipeline.

FeatureCandidate GenerationEntity Disambiguation

Primary Objective

Recall: retrieve all plausible KB entries for a mention

Precision: select the single correct KB entry from candidates

Pipeline Stage

Phase 1 (Retrieval)

Phase 2 (Resolution)

Input

Raw text mention surface form

Mention context + candidate set from Phase 1

Output

Shortlist of K candidate entities (K ≈ 5-200)

Single canonical entity ID or NIL prediction

Core Technique

Surface form dictionary lookup, ANNS over entity embeddings, DPR

Cross-encoder ranking, collective coherence optimization, neural scoring

Failure Mode

False negatives: correct entity missing from candidate set

False positives: wrong entity selected from candidate set

Latency Budget

Dominant cost; must scale to millions of KB entries

Lower cost; operates only on pre-filtered candidate set

Typical Recall Target

95% of gold entities in candidate set

N/A (precision-focused)

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.