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.
Glossary
Candidate Generation

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.
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.
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.
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
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
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.
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.
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.
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.
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.
Candidate Generation vs. Entity Disambiguation
Distinguishing the retrieval-first phase from the resolution-second phase in the entity linking pipeline.
| Feature | Candidate Generation | Entity 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 |
| N/A (precision-focused) |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Candidate generation is the critical first stage in entity linking. Explore the complementary techniques that form a complete disambiguation pipeline, from initial mention detection to final knowledge base grounding.
Fuzzy Matching
String similarity algorithms that tolerate typographical errors, abbreviations, and formatting inconsistencies during dictionary-based candidate lookup. Essential when surface forms don't exactly match knowledge base labels.
- Levenshtein distance for edit-based similarity
- Jaro-Winkler optimized for name matching
- TF-IDF character n-grams for robust tokenization-free matching
Collective Entity Linking
A global optimization approach that jointly disambiguates all mentions in a document by maximizing semantic coherence among linked entities. Instead of independent candidate ranking, it evaluates the pairwise compatibility of entity assignments.
- Uses PageRank-style random walks over entity graphs
- Exploits topical consistency: linked entities should relate
- Graph neural networks learn entity co-occurrence patterns
Nil Prediction
The critical capability to recognize when a mention refers to an entity absent from the target knowledge base. Prevents false positive links that cascade into downstream errors. Systems output a special NIL identifier with a confidence threshold.
- Threshold-based: link only if top candidate score exceeds τ
- Learned NIL classifier trained on out-of-KB mentions
- Essential for real-world corpora with long-tail entities

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us