Retrieval-augmented generation · mid
Hybrid search, fusion and reranking
Vectors find meaning and keyword search finds exact words. Hybrid search runs both and merges the lists, often with reciprocal rank fusion, and a reranker then orders the best candidates more carefully.
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceThe notes
What you must know
- Embeddings blur exact strings. BM25 scores a document by how often the query words appear, weighted by how rare each word is across documents, with a length adjustment. It is strong for ids, names and rare words.
- Hybrid search runs vector and keyword search and merges the lists.
- Reciprocal rank fusion (RRF): each document scores the sum of 1 divided by (k + rank) over the lists. k is 60 in the original paper. It uses ranks only, so no score normalisation is needed.
- Blending raw scores needs normalisation and tuning on an eval set. Per-list weights give weighted RRF.
- RRF details: ranks start at 1, a duplicate inside one list counts once at its best rank, ties break in a fixed way, and edge cases are empty lists and n larger than the number of unique documents.
- A reranker (cross-encoder) reads the query and one candidate together and gives a relevance score. It is more accurate but runs once per candidate, so it reranks only the top 20 to 100.
- A common pipeline: keyword top 50 plus vector top 50, fuse, rerank to the top 5 to 8, then generate.
- Measure each stage with recall@k, MRR or NDCG before and after you add it.
The red pen
Common traps: mistake → fix
Mistake: Vector search is always better than keyword search
Fix: exact codes and names often need keyword search.
Mistake: Add the BM25 score and the cosine score directly
Fix: they have different scales; use RRF or normalise.
Mistake: A reranker can search the whole corpus
Fix: it is too slow; it only reorders a short candidate list.
Easy to hard
Questions interviewers ask, easy to hard
- Why add BM25 to vector search?
- What is reciprocal rank fusion?
- What does a reranker do and why not use it on everything?
- Write RRF for two ranked lists.
- How do you prove that hybrid search helped?
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceYour first interview is free
Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.