Why has the 2026 default become wide retrieval plus a cross-encoder rerank?
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
Stage 1 is a fast bi-encoder optimized for recall over a wide candidate pool; stage 2 is a slow cross-encoder that scores query and chunk jointly to sharpen precision on the survivors.
Picture hiring for one open seat at a software company. You do not interview every applicant in depth. First, a resume scan sweeps thousands of resumes and pulls maybe fifty that look plausible. That sweep is fast and forgiving on purpose: you want the right candidate in the pile, even if they are not ranked first. Then a smaller panel does deep interviews with those fifty and picks the actual top three. Two passes with two different filters do a better job than one pass with one filter that has to be both fast and thorough. RAG retrieval works the same way. Vector search is the resume scan. The reranker is the interview panel.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
4 minutes: bi-encoder versus cross-encoder, recall versus precision split, k1 and k2 defaults, three 2026 rerankers, one sizing question for sanity check.
from anthropic import Anthropic
import cohere
vector_db = ... # Faiss / Pinecone / Qdrant client
co = cohere.Client()
def retrieve(query: str, k1: int = 30, k2: int = 5) -> list[str]:
# Stage 1: wide bi-encoder recall
candidates = vector_db.search(query, top_k=k1)
# Stage 2: cross-encoder rerank to top k2
docs = [c.text for c in candidates]
rerank = co.rerank(model="rerank-3.5", query=query, documents=docs, top_n=k2)
return [docs[r.index] for r in rerank.results]Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Skipping the rerank because vector search already returns ranked results. Bi-encoder scores correlate weakly with true relevance past the top few; reranking is what makes top-5 actually be top-5.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.