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 →
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.
| Query | BM25 | Dense |
|---|---|---|
| "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
- Run BM25 and vector search in parallel, e.g. top 50 each.
- Fuse: Reciprocal Rank Fusion (RRF) or weighted normalised scores (Q20).
- 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.
Related
You understood something today that you didn't yesterday.