Promptwatch Logo

BM25

BM25 is a classic keyword ranking algorithm scoring document-query matches—still a core candidate generator in AI search and hybrid retrieval pipelines.
Updated September 6, 2026
AI

Definition

BM25 (Best Matching 25) is a ranking function from information retrieval that scores how relevant a document is to a query based on the query's terms. It improves on simple term-frequency counting by accounting for how often a term appears in a document (with diminishing returns), how rare the term is across the whole corpus (inverse document frequency), and document length, so that long documents are not unfairly favored. The result is a fast, robust lexical (keyword-based) relevance score.

Despite being decades old, BM25 remains a workhorse in 2026 AI search. It is widely used as the first-stage candidate generator in retrieval pipelines—including AI answer engines—precisely because it is cheap, predictable, and excellent at exact matching of specific terms like product names, error codes, version numbers, and rare keywords that vector search can miss. Bing Copilot, for example, reportedly uses BM25 over its web index as a primary candidate generator before reranking.

In practice BM25 rarely works alone. Modern systems combine it with dense embedding-based retrieval in a hybrid search stack and then apply a cross-encoder reranker for final precision. BM25 supplies high-recall lexical matches; vectors add semantic understanding; the reranker sorts the merged set.

For GEO, BM25's persistence is a reminder that exact wording still matters. Using consistent, precise terminology and named entities—not just semantically adjacent phrasing—helps your content match the lexical stage of retrieval and survive into the candidate set that answer engines synthesize from.

Examples of BM25

  • A search system uses BM25 to instantly surface documents containing an exact error code that a semantic model might overlook.
  • A hybrid pipeline runs BM25 and vector retrieval in parallel, fuses the results, and reranks them before sending the top passages to an LLM.
  • Bing Copilot generates candidates with BM25 over its web index, then applies a reranker to refine relevance before synthesis.
  • A GEO team improves lexical match by auditing pages to use consistent, precise terminology and exact entity names that BM25-style retrieval can score directly.

Terms related to BM25

Vector Search

Vector search is a semantic search method that finds information by comparing embeddings—powering RAG, Perplexity, and AI search retrieval for GEO.

AI

Hybrid Search

Hybrid search combines keyword and vector retrieval so AI systems match exact terms and meaning—improving recall and citations in AI search.

AI

Semantic Search

Semantic search is search technology that understands meaning, context, and intent behind queries using embeddings and NLP, not keyword matching alone.

SEO

Reranking

Reranking is a second-stage retrieval step that reorders candidate documents by deeper relevance, improving the passages fed to an LLM in AI search and GEO.

AI

Embeddings

Embeddings are numerical vector representations of text or images that capture semantic meaning—core to vector search, RAG, and AI search retrieval.

AI

RAG (Retrieval-Augmented Generation)

RAG (retrieval-augmented generation) grounds LLM responses in real-time retrieved sources—core to AI search, Perplexity, and GEO citations.

AI

Retrieval-Augmented Generation (RAG)

Retrieval-augmented generation (RAG) grounds LLM responses in real-time retrieved sources—core to AI search, Perplexity, and GEO citations.

AI

Passage Ranking

Passage ranking ranks individual passages within pages independently; most AI Overview citations come from URLs outside the top 20 results.

SEO

Retrieval Coverage

Retrieval coverage measures how much of your important content is accessible and likely to be retrieved by AI search and RAG systems.

Analytics

Frequently Asked Questions about BM25

Learn about AI visibility monitoring and how Promptwatch helps your brand succeed in AI search.

BM25 scores a document's relevance to a query using term frequency (with diminishing returns), inverse document frequency (rarer terms count more), and document-length normalization so long documents are not unfairly favored. It is a lexical, keyword-matching relevance function.

Be the brand AI recommends

Monitor your brand's visibility across ChatGPT, Claude, Perplexity, and Gemini. Get actionable insights and create content that gets cited by AI search engines.

Promptwatch Dashboard