Dashboard
0%
1
Curious builder0 XP earned · 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
51 small wins to finish your pathNext question →

Q7EasyConcept

Keyword search (BM25) vs semantic search: why use hybrid search?

30-second answerSay your answer out loud first, then reveal.

BM25 in one line: scores a document higher when it contains the query terms, especially rare terms (IDF), with diminishing returns for repetition and normalisation for document length.

QueryBM25Dense
"error code E-4021"✅ exact match❌ may return generic error docs
"how to get my money back" (doc says "refund process")❌ no shared words✅ semantic match
"GDPR Article 17"✅⚠️ might return any GDPR article
"laptop won't turn on" vs "device fails to power up"❌✅

Hybrid implementation

  1. Run BM25 and vector search in parallel, e.g. top 50 each.
  2. Fuse: Reciprocal Rank Fusion (RRF) or weighted normalised scores (Q20).
  3. Optionally rerank the fused list with a cross-encoder (Q8).

Learned sparse models (SPLADE, for example) are a middle ground. They produce sparse, term-based vectors with learned expansion, so "refund" can activate "money back."

Common mistakes

  • Assuming dense retrieval is always better because it's newer. On many domain datasets BM25 is a strong baseline and hybrid wins.

You understood something today that you didn't yesterday.