Promptwatch Logo

BM25

BM25 is a classic keyword-based ranking algorithm that scores how well a document matches a query's terms—still a core candidate generator in modern AI retrieval pipelines.
Updated June 1, 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

Semantic search method that finds information by comparing numerical meaning representations (embeddings) rather than matching exact keywords.

AI

Hybrid Search

Hybrid search combines keyword (lexical) and vector (semantic) retrieval so AI systems match both exact terms and meaning, improving recall and citation quality.

AI

Semantic Search

Search technology that understands meaning, context, and intent behind queries using embeddings and NLP rather than matching keywords alone.

SEO

Reranking

Reranking is a second-stage retrieval step that reorders an initial set of candidate documents by deeper relevance, improving the quality of passages fed to an LLM.

AI

Embeddings

Numerical vector representations of text, images, or data that capture semantic meaning, enabling AI systems to compare and retrieve content by similarity.

AI

RAG (Retrieval-Augmented Generation)

AI architecture that combines language models with real-time document retrieval to generate accurate, cited responses grounded in external sources.

AI

Retrieval-Augmented Generation (RAG)

AI architecture combining language models with real-time document retrieval to generate accurate, source-cited responses beyond training data.

AI

Passage Ranking

Search capability that ranks individual passages within pages independently—60% of AI Overview citations come from URLs outside the top 20 organic 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