Inferensys

Glossary

Candidate Pool Merging

The process of combining the unique document identifiers retrieved by sparse and dense search pipelines into a single, deduplicated set before applying a final re-ranking or fusion algorithm.
Stylish WeWork-like workspace with hot desks and document wall, professional searching through enterprise knowledge base on a mounted ultrawide display, warm industrial pendants overhead.
HYBRID SEARCH FUSION

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.

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.

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.

FUSION ARCHITECTURE

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.

01

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.

02

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.
03

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.

04

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.
05

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.
06

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.

CANDIDATE POOL MERGING

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.

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.