Keyword search like BM25 ranks documents by the words they share with the query, while semantic search ranks them by meaning. The keyword score counts how often the query's words appear in a document, and it favors rare words. Semantic search compares embeddings, vectors that capture meaning, so a query can match a passage that shares no words with it.
A search for "car won't start" can return "vehicle ignition failure": close in meaning, zero shared terms.
Aspect
BM25
Semantic
Matches on
shared words
meaning
Synonyms, paraphrase
misses them
handles them
Rare IDs, names, codes
strong
often weak
Per-query cost
cheap text scoring
embed the query first
BM25 needs no model at query time. It indexes new words the moment you add them. An embedding model only knows the vocabulary it was trained on, so a fresh product code means little to it. Most production systems run both.
Rewriting in plainer words…
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Saved in this browser - sign in to keep your review list.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Keep going - a few more words and AI can grade it.
Interview lens
How interviewers actually use this question
Likely follow-ups
Why does BM25 weight rare words more, and how does document length affect the score?Names IDF for rarity, term-frequency saturation so repeats add less each time, and length normalization so long documents aren't favored for size.
Keyword search like BM25 ranks documents by the words they share with the query, while semantic search ranks them by meaning.
BM25 counts how often the query's words appear in each document and gives rare words more weight, and it needs no model at query time.
Semantic search turns the query and the documents into embeddings, vectors that capture meaning, and compares those instead of words.
That's how 'car won't start' can match 'vehicle ignition failure' with zero shared terms, a result BM25 would miss.
The trade-off flips on exact tokens. BM25 is strong on IDs, names and codes, and it indexes a new word the moment you add it.
An embedding model only knows the vocabulary it trained on, so a fresh product code means little to it, which is why most production systems run both.
Weak answers to avoid
Says semantic search is strictly betterIt loses on exact IDs, names and new codes that BM25 handles well. Say where each one wins and that most production systems run both.
Describes BM25 as plain word countingLeaving out the rare-word weighting makes BM25 sound naive. Say it scores shared words by frequency and weights rare words higher.
Treats embeddings as knowing every termA model only knows what it saw in training, so a new product code carries little meaning to it. Say BM25 catches those terms as soon as they're indexed.
No concrete example of a paraphrase match"It understands meaning" with nothing behind it sounds memorized. Give one query and one matching passage that share no words.
Interview lens
Likely follow-ups, what you can say, and the weak answers to avoid.