What Is BM25?

BM25 Search Ranking Explainer

BM25 is a ranking function used by search engines to estimate how relevant a document is to a text query. It relies on lexical matches, giving credit when query terms appear in a document.

The score increases with term frequency but with diminishing returns. Rare terms usually contribute more than common terms through inverse document frequency, while length normalization prevents long documents from winning simply because they contain more words.

BM25 is fast, interpretable, and effective for exact names, identifiers, and specialized vocabulary. It works naturally with inverted indexes and remains a strong baseline or component in hybrid retrieval systems.

Because it depends on surface terms, BM25 can miss relevant passages phrased differently from the query. Tokenization, field weighting, parameter settings, stop words, and corpus statistics all affect results, so tuning should use representative judgments.

BM25 is a lexical ranking function that scores documents using query-term frequency, term rarity, and document-length normalization.

Key terms include BM25, lexical retrieval, term frequency, inverse document frequency, length normalization, score, inverted index and parameter.

Repeated query terms add evidence without letting repetition increase the score without limit.

Rare terms and document length adjust how much each match contributes.

BM25 is strong for names and identifiers because it preserves lexical evidence.

It can miss paraphrases, making hybrid semantic retrieval useful for broader recall.

Explore more "Explainers"

Discover additional explainers across politics, science, business, technology, and other fields. Each explainer breaks down a complex idea into clear, everyday language—helping you better understand how major concepts, systems, and debates shape the world around us.