Glossary · Retrieval & generation
BM25
A lexical ranking function that scores a document from query-term matches while accounting for term rarity, repeated occurrences, and document length.
Why it matters
It is a strong exact-term retrieval baseline and complements dense retrieval for identifiers, rare words, and domain-specific phrases.
In practice
Retrieve candidates with BM25 and dense search, combine their ranks, then evaluate the merged results before adding a more expensive reranker.
Common confusion
BM25 does not understand semantic similarity directly, and its score has no universal meaning across different queries or index configurations.
Related terms
Sources
Browse the learning paths to see this term in context — every lesson is free to read.