Candidate pool merging is the critical middleware step in a multi-stage retrieval architecture where the unique document IDs returned by independent sparse retrieval (e.g., BM25) and dense retrieval (e.g., vector similarity) subsystems are combined into a single, deduplicated set. This process ensures that a document retrieved by both pipelines is represented only once before the computationally expensive Cross-Encoder re-ranking or Reciprocal Rank Fusion (RRF) is applied, preventing redundant processing and score distortion.
Glossary
Candidate Pool Merging

What is Candidate Pool Merging?
Candidate pool merging is the deduplication and unification process that combines distinct document identifier sets from parallel retrieval pipelines into a single, non-redundant set before final scoring.
The primary technical challenge in candidate pool merging is resolving identity collisions between disparate index structures while preserving provenance metadata. A robust merging implementation must reconcile the inverted index's integer doc IDs with the vector store's string UUIDs, often using a canonical document hash. This deduplicated candidate set forms the input for the final fusion algorithm, where techniques like CombMNZ or Weighted Sum Fusion aggregate the separate relevance signals into a unified ranking.
Key Characteristics of Candidate Pool Merging
The process of combining unique document identifiers from sparse and dense retrieval pipelines into a single, deduplicated set before final re-ranking or fusion.
Set Union & Deduplication
The foundational operation of candidate pool merging is a set union on document IDs returned by independent retrieval systems. Since sparse (BM25) and dense (vector) indexes often retrieve overlapping documents, deduplication ensures each candidate appears only once in the merged pool. This is typically performed using a hash set or Bloom filter on the document's unique identifier, preventing redundant scoring and ensuring the downstream re-ranker processes a clean, minimal candidate set.
Pool Size Management
Controlling the cardinality of the merged candidate pool is critical for latency budgeting. A naive union of top-K results from N retrievers can produce up to N*K candidates, overwhelming a computationally expensive re-ranker.
- Fixed Cardinality: Truncate the merged set to a hard limit (e.g., 1000 documents).
- Score-Based Pruning: Discard candidates below a minimum BM25 or vector similarity threshold before merging.
- Tiered Retrieval: Retrieve a larger pool from fast indexes and a smaller, high-precision pool from slower systems.
Score Preservation
During merging, the raw relevance scores from each retrieval subsystem must be preserved and associated with their respective document IDs. These scores serve as input features for the subsequent fusion algorithm (e.g., RRF or weighted sum). A merged candidate record typically stores a vector of scores: {doc_id: "A", bm25_score: 12.4, dense_score: 0.89}. If a document was retrieved by only one system, the missing score is imputed as a default minimum or zero before normalization.
Early Termination & Pruning
To optimize performance, candidate pool merging often incorporates early termination heuristics. If a sufficient number of high-confidence candidates are identified early in the merge process, the system can stop pulling results from slower indexes.
- WAND Operator: Adapts the classic Weak-AND algorithm to stop scoring when a document's combined score cannot enter the top-K.
- Confidence Thresholds: If the top-10 candidates from the dense retriever all have cosine similarity > 0.95, the system may skip the sparse retriever entirely.
Pre-Fusion vs. Post-Fusion Merging
Candidate pool merging occurs at a distinct architectural point: before the fusion algorithm runs. This is a critical distinction from post-fusion merging.
- Pre-Fusion Merge: Combine IDs first, then apply RRF or CombSUM to the unified pool. This is the standard approach for most hybrid search systems.
- Post-Fusion Merge: Each retriever produces a fully ranked list, and the lists are interleaved or combined only at the final ranking stage. This is less common and risks losing candidates that one system ranked poorly.
Metadata & Filter Integration
Candidate pool merging must respect pre-retrieval metadata filters. If a user's query includes a hard constraint (e.g., year > 2020), this filter is typically pushed down to each retriever's index scan. The merged pool then contains only documents that satisfy the constraint. A common failure mode is post-filtering during merge, where a document retrieved by one system is discarded because it fails a metadata check, leading to an unexpectedly small candidate pool and potential empty result sets.
Frequently Asked Questions
Clarifying the technical mechanics behind unifying sparse and dense retrieval results before final re-ranking.
Candidate Pool Merging is the algorithmic process of combining the unique document identifiers retrieved by separate sparse (e.g., BM25) and dense (e.g., vector similarity) search pipelines into a single, deduplicated set. This operation occurs before the final re-ranking or fusion algorithm is applied. The primary mechanism involves executing parallel queries against an inverted index and a vector index, collecting the top-K results from each, and performing a set union on the document IDs. This ensures that a document found only by lexical matching and another found only by semantic understanding both enter the final scoring phase, bridging the lexical-semantic gap without premature filtering.
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
Explore the core algorithms and architectural patterns that govern how distinct retrieval pipelines are unified into a single, deduplicated candidate set before final re-ranking.
Score Normalization
A critical preprocessing step before weighted fusion. Because BM25 scores are unbounded and cosine similarity ranges from -1 to 1, raw scores cannot be directly compared. Min-Max Normalization rescales values to [0, 1], while Standard Score (Z-score) Normalization centers them around a mean of zero, ensuring one retrieval subsystem's score magnitude does not dominate the merged pool.
CombMNZ
A score aggregation method that rewards documents retrieved by multiple independent systems. It multiplies the sum of normalized scores by the number of systems that returned the document: CombMNZ = Σ(score_i) * |systems_retrieved|. This effectively boosts candidates that exhibit both lexical relevance and semantic similarity, acting as a vote of confidence from diverse retrieval signals.
Late Fusion Architecture
An architectural pattern where sparse and dense retrieval pipelines execute independently against their respective indexes. The candidate pools are merged only after both systems complete their search. This contrasts with Early Fusion, where embeddings interact during retrieval. Late Fusion is simpler to scale but requires careful deduplication logic to handle overlapping document IDs.
Weighted Sum Fusion
A linear combination technique that applies a predefined weight to each retrieval system's normalized score: final_score = w1*score_sparse + w2*score_dense. Weights are typically tuned via grid search against NDCG or MRR metrics. For example, a weight of 0.7 for dense and 0.3 for sparse prioritizes semantic understanding for natural language queries.
Learned Fusion
A machine learning approach where a model is trained to optimally combine retrieval signals. Unlike static formulas, a LambdaMART or neural network learns non-linear weighting patterns from labeled relevance data. This allows the system to dynamically adjust fusion behavior based on query features, such as boosting lexical signals for rare keyword queries and semantic signals for conceptual queries.

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