BM25
Also called Okapi BM25, sparse retrieval, keyword search, lexical search.
BM25 is a keyword ranking function that scores documents by how often the query's terms appear in them, weighted by how rare each term is across the collection and normalized for document length.
Description
It is the standard sparse, lexical retrieval method and remains a strong baseline. It excels at exact matches, such as product codes, error messages, and names, where embedding search is weaker, and needs no training. It does not match synonyms or paraphrases, so it is usually paired with dense retrieval.
Sources
- Robertson and Zaragoza (2009). The Probabilistic Relevance Framework: BM25 and Beyond.
Cite this entry
Protologue. (2026). BM25. In Protologue: A Taxonomy of Prompting and LLM Techniques (v1.4.0, PTL-0127). https://protologue.com/t/bm25/
BibTeX
@misc{protologue_bm25,
title = {BM25},
author = {{Protologue}},
year = {2026},
howpublished = {Protologue: A Taxonomy of Prompting and LLM Techniques, v1.4.0},
note = {Entry PTL-0127},
url = {https://protologue.com/t/bm25/}
}New terms, as they're coined
One email a week with the newest techniques, each defined and sourced like this entry.
Delivered through Beehiiv. Unsubscribe from any issue.