RAG · Hybrid retrieval

RRF vs Reranker

Why a hybrid RAG pipeline needs both: Reciprocal Rank Fusion merges incompatible ranked lists; a reranker scores true relevance. Walk the stages with a live demo.

BM25 + Dense RRF Reranker LLM

Why you need both in a hybrid pipeline

Hybrid retrieval fires two searches in parallel: a keyword search (BM25) and a semantic search (dense embeddings). Each returns its own ranked list. Those lists have incompatible raw scores — BM25 is unbounded; cosine similarity is 0–1 — so you cannot average them.

RRF merges the lists by rank position alone. A reranker then re-scores the fused candidates by reading the query and each document together. Each step does something the previous one cannot.

Fusion

RRF — rank fusion

Looks only at rank positions, never at query meaning. Doc C can win because it ranked well in both lists — but RRF has no idea why, or how relevant the doc actually is.

Relevance

Reranker — cross-encoder

Sees the actual query and each document together. It scores how well each document answers the question — something RRF can never do because it never reads either one.

Side-by-side

RRF Reranker
Job Merge ranked lists Score query–doc relevance
Reads the query? No Yes
Reads documents? No (ranks only) Yes (full text / passages)
Cost Tiny (arithmetic) Higher (model inference)
Typical place After hybrid retrieval After fusion, before LLM
Example LangChain EnsembleRetriever CrossEncoder, Cohere Rerank

RRF formula

score(d) = Σ 1 / (k + rankᵢ(d)) · k = 60 (common default)

Sum over each retriever i. Documents that appear high in multiple lists accumulate a stronger fused score — still without any notion of semantic relevance.

Reranker input shape

[CLS] query [SEP] document [SEP] → Transformer → score ∈ [0, 1]

Live demo — walk the pipeline

Click Run next stage to reveal each step with sample documents and scores.

Your query

"What is the difference between RRF and a reranker?"

Sent to both BM25 index and dense vector index simultaneously

Hybrid retrieval fires two searches in parallel. Each returns its own ranked list.