What does BM25 stand for and what does it score?
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
BM25 (Best Matching 25) is a sparse term-frequency retrieval function that scores documents by TF, IDF, and length normalization; it pairs with dense embeddings in hybrid retrieval.
Picture an old-school librarian who scores every book by counting how often your search words appear inside it, downweights words that appear in almost every book (like the, and, of), and accounts for how long each book is so a giant encyclopedia doesn't beat a short article by sheer volume. That counting system is BM25. It's been around since the 1990s and is shockingly hard to beat for exact-match cases like rare names, product codes, and error strings. Modern systems usually run BM25 and a smart semantic search side by side and combine their answers.
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.
6 min: spell out the acronym, walk through the three scoring factors, explain where BM25 outperforms dense embeddings, describe the hybrid + RRF pattern, and place BM25 in the 2026 production stack.
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.
Treating BM25 as obsolete because dense embeddings exist. It's still strong at exact-token matching and the workhorse of hybrid retrieval, where BM25 + dense + RRF beats either alone.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.