Okapi BM25

The probabilistic ranking function that became the standard lexical baseline in search.

Answer first

Okapi BM25 is a ranking function from the probabilistic relevance framework developed by Stephen Robertson, Karen Spärck Jones and others. It scores documents on query term matches, with term frequency saturation and document length normalisation, and its BM25F variant weights fields such as title, body and anchor text. Google has never said it uses BM25, and the US v. Google opinions we reviewed do not name it. For sites, the lesson is that lexical matching still matters: the words a searcher uses should appear in the title, headings and body.

What is BM25?

Okapi BM25 is a ranking function that estimates how relevant a document is to a query from the query terms it contains. BM stands for best matching, and Okapi is the name of the first system to use it, built at City University London in the 1980s and 1990s (Wikipedia).

It comes from the probabilistic relevance framework set out by Stephen Robertson and colleagues. The standard reference is Robertson and Zaragoza's 2009 review, The Probabilistic Relevance Framework: BM25 and Beyond.

BM25 is a bag-of-words retrieval function that ranks a set of documents based on the query terms appearing in each document, regardless of their proximity within the document.

Wikipedia, Okapi BM25, Wikipedia

How does BM25 score a page?

BM25 keeps the core of TF-IDF, rewarding rare query terms more than common ones, and adds two corrections. Term frequency saturates: the fifth mention of a word adds far less than the first, so repetition quickly stops paying. Length normalisation stops long documents winning simply because they contain more words. Two tunable parameters, usually written k1 and b, control those effects.

BM25F extends the model to documents with fields. Each field, such as title, body or incoming anchor text, gets its own weight before the scores are combined. That is the part most relevant to web pages, because it formalises why a term in a title or in the anchor text of links pointing at a page counts differently from the same term deep in body copy.

  • IDF: rare query terms carry more weight.
  • Saturation (k1): repeated terms give diminishing returns.
  • Length normalisation (b): long pages are not rewarded for length alone.
  • BM25F: separate weights per field, including anchor text.

In the Web context, with extensive hyperlinks, it is usual to enhance the original texts with the anchor text of incoming links.

Stephen Robertson and Hugo Zaragoza, The Probabilistic Relevance Framework: BM25 and Beyond, Foundations and Trends in Information Retrieval (2009)

What evidence is there that Google uses BM25?

This page is labelled General theory. Google has not said it uses BM25. In the US v. Google case, Judge Mehta's 2024 liability opinion lists a Google signal called Term Weighting among the ranking signals retrained in Google's data reduction experiment, alongside NavBoost, QBST, RankBrain, DeepRank and RankEmbedBert, but it does not describe how Term Weighting is calculated. We searched the text of that opinion and the 2025 remedies opinion and found no mention of BM25 or TF-IDF.

So the trial confirms that Google has a term weighting signal, which is unsurprising, and does not reveal its formula. Google's own public framing is that early Search relied on matching words and later layered machine learning on top (Pandu Nayak, Google, February 2022).

In the early days of Search, before we had advanced AI, our systems simply looked for matching words.

Pandu Nayak, Google, How AI powers great search results, Google blog

What does BM25 mean for your pages?

Lexical retrieval is still how many systems, including many retrieval augmented AI pipelines, build their first candidate set, so a page that never uses the searcher's words can miss the shortlist entirely. Put the core query terms in the title element, the H1 and the opening paragraph, in natural phrasing.

Saturation is the other lesson. Under BM25, extra repetitions add little, so once a term is present in the fields that matter, effort is better spent on coverage and clarity than on frequency. A falsifiable test: add a missing core term to the title and H1 of a page that ranks beyond page two for that term and compare impressions in Search Console over the following four weeks against a matched control page.

Again, this has led to one of the most successful Web-search and corporate-search algorithms, BM25F.

Stephen Robertson and Hugo Zaragoza, The Probabilistic Relevance Framework: BM25 and Beyond, Foundations and Trends in Information Retrieval (2009)

Which Laurelin audit checks test for BM25?

BM25 is a scoring model, not something visible on a site, so these checks measure its on-page inputs. The new check Core query terms missing from title, H1 and opening copy looks for lexical gaps in the highest weighted fields.

Related checks: Title doesn't match content intent covers the most heavily weighted field. Missing H1 removes a strong field entirely. Generic anchor text wastes the anchor text field that BM25F models. Very low content to boilerplate ratio dilutes the body field. Keyword stuffing and over-optimisation is where saturation makes repetition pointless.

What are the key dates for BM25?

  • 2009: Robertson and Zaragoza publish The Probabilistic Relevance Framework: BM25 and Beyond (source)
  • 2024-08-05: US v. Google liability opinion names a Term Weighting ranking signal without describing it (source)
  • 2025-09-02: US v. Google remedies opinion filed; no mention of BM25 found in its text (source)

Frequently asked questions about BM25

Does Google use BM25?

Google has not said so. The US v. Google liability opinion names a Term Weighting signal but does not describe its formula, and neither opinion mentions BM25.

What is the difference between BM25 and TF-IDF?

BM25 builds on the same idea of weighting rare terms but adds term frequency saturation and document length normalisation, which make it more robust than plain TF-IDF.

What is BM25F?

BM25F is a variant that scores fields such as title, body and incoming anchor text separately with their own weights before combining them.