BM25 and BM25F
BM25, also called Okapi BM25, is a ranking function used by search engines to estimate how relevant documents are to a search query[1] . It is based on the probabilistic retrieval framework developed in the 1970s and 1980s by Stephen E. Robertson, Karen Spärck Jones and others[1] . BM25F is a version that takes document structure into account by weighting fields such as titles and headings separately[1][3] .
Overview
Wikipedia explains that "BM" stands for best matching, and that the fuller name Okapi BM25 comes from the first system to use it, the Okapi information retrieval system implemented at City University in London in the 1980s and 1990s[1] . BM25 and newer variants such as BM25F are described as TF-IDF-like retrieval functions used in document retrieval[1] . In SEO software, BM25 is used to compare how a page or draft reads against the pages ranking for a query, as in RankGear's Content Intelligence and BM25 Drafts[4] .
Origins in the probabilistic relevance framework
In a 2009 review titled "The Probabilistic Relevance Framework: BM25 and Beyond," Stephen Robertson and Hugo Zaragoza describe the family of models behind BM25 as the Probabilistic Relevance Framework, emphasizing the "importance of the relevance variable"[2] . The review covers the binary independence model, relevance feedback, the eliteness model and BM25, multiple streams and BM25F, and parameter optimization[2] .
A central idea in the framework is the Probability Ranking Principle: if retrieved documents are ordered by decreasing probability of relevance on the data available, the system's effectiveness is the best that can be obtained for that data[2] .
How BM25 scores a document
BM25 is a bag-of-words function that ranks documents based on the query terms appearing in each one, regardless of how close together they are[1] . For each query term, the score combines the term's inverse document frequency, how often it occurs in the document, and the document's length compared with the average length in the collection[1] . Two free parameters, k1 and b, are usually set to k1 between 1.2 and 2.0 and b = 0.75 when no advanced optimization is done[1] . At the extreme values of b, BM25 turns into functions known as BM11 (b = 1) and BM15 (b = 0)[1] .
RankGear's glossary summarizes the effect in plain terms: "A term that appears everywhere counts for little; a term that is distinctive counts for more; and extra length stops paying off" once a document is comfortably above average size[5] . Term frequency saturates, so a tenth mention adds far less than a second[5] . Inverse document frequency gives more weight to terms that appear in few documents; because it is log-scaled, the gap between a word in 2 pages and 5 pages is much larger than between 200 and 205[6] .
BM25F and weighted fields
BM25F, the BM25 model with extension to multiple weighted fields, treats a document as composed of several fields, such as headlines, with different weights[1] . RankGear's glossary explains that plain BM25 treats a page as "one undifferentiated bag of words," so a keyword in the title counts the same as one in the footer, while BM25F weights each field before combining them[3] .
The glossary's example compares two pages that mention "fleet insurance" the same number of times; the one that places it in the title and main heading scores higher than the one that uses it only in body text[3] . BM25F has no fixed ceiling, so a score only means something relative to the other pages in the same set[3] . In RankGear, BM25F appears in the workbook, can be enabled under Settings, and is referenced in BM25 Drafts[3] .
BM25 compared with tf-idf
Wikipedia defines tf-idf (term frequency-inverse document frequency) as a measure of the importance of a word to a document in a collection, adjusted for the fact that some words appear more frequently in general[7] . Inverse document frequency was introduced as "term specificity" by Karen Spärck Jones in a 1972 paper[7] . One of the simplest ranking functions sums the tf-idf of each query term, and many more sophisticated functions are variants of that model[7] .
BM25 shares the IDF ingredient but adds term-frequency saturation and document-length normalization, controlled by k1 and b[1] . RankGear's glossary notes that this means "a longer page is not automatically favored for containing more words"[5] .
Use in SEO content analysis
RankGear's BM25 Drafts workflow applies BM25 to weigh a draft against the pages ranking for a query and estimate where it would sit[4] . RankGear also lists BM25F among the methods used to model the field in an Analysis Run[8] .
RankGear's glossary is explicit about limits: BM25 "is a lexical, term-matching measure" that does not by itself judge meaning, intent or answer quality, and small reference samples make the rarity weights unstable[5] . It describes a BM25 value as "a retrieval-relevance indicator, not a Google ranking score"[5] . The general caution about such numbers is covered in Correlation and causation in SEO.
Common questions
What is BM25?
BM25 is a ranking function used by search engines to estimate the relevance of documents to a query[1] . It weighs term frequency, term rarity and document length[5] .
What does BM25 stand for?
BM is an abbreviation of "best matching"[1] . The fuller name Okapi BM25 refers to the Okapi system at City University, London, the first to use it[1] .
How is BM25 different from tf-idf?
Both use inverse document frequency, but BM25 adds term-frequency saturation and document-length normalization through its k1 and b parameters[1] . Simple tf-idf ranking sums the tf-idf of each query term[7] .
What is BM25F?
BM25F is a modification of BM25 in which a document is treated as several fields, such as headlines, with different weights[1] . A term in the title can therefore count for more than the same term in body text[3] .
See also
- Content Intelligence and BM25 Drafts
- Correlation and causation in SEO
- Spearman and Pearson correlation
- Deficits and target strategies
- SEO testing
References
- ^ a b c d e f g h i j k l m n o p q r s t u v "Okapi BM25". Wikipedia. Retrieved November 2026.
- ^ a b c d "The Probabilistic Relevance Framework: BM25 and Beyond". Robertson & Zaragoza, Foundations and Trends in Information Retrieval (2009). Retrieved November 2026.
- ^ a b c d e f "BM25F". RankGear knowledge base. Retrieved November 2026.
- ^ a b "BM25 Drafts". RankGear knowledge base. Retrieved November 2026.
- ^ a b c d e f "BM25". RankGear knowledge base. Retrieved November 2026.
- ^ "Inverse document frequency". RankGear knowledge base. Retrieved November 2026.
- ^ a b c d "tf–idf". Wikipedia. Retrieved November 2026.
- ^ "Analysis Run: measure the ranking field for a keyword". RankGear (rankgear.com). Retrieved November 2026.