What Are BM25 and SPLADE? Sparse Learned Retrieval Explained

    BM25 is the probabilistic keyword retrieval algorithm that still underpins most search engines, scoring documents based on term frequency and inverse document frequency with length normalisation. SPLADE extends it using BERT to expand queries and documents into a richer sparse representation, combining the interpretability of keyword search with the semantic awareness of neural models.

    Tharindu Gunawardana
    Tharindu Gunawardana
    April 10, 2026
    9 min read
    AI SEO
    What Are BM25 and SPLADE? Sparse Learned Retrieval Explained

    What Are BM25 and SPLADE?

    BM25 (Best Match 25) is a probabilistic sparse retrieval algorithm that has been the dominant document ranking method in search engines for over two decades. It scores documents based on the frequency of query terms in the document, adjusted for document length and the rarity of the term across the corpus. Elasticsearch, OpenSearch, Apache Solr, and most search engines use BM25 as their default scoring function.

    SPLADE (Sparse Learned Retrieval via BERT) extends sparse retrieval by using a BERT-based language model to expand the document's term representation to include related vocabulary from the full tokeniser vocabulary. This solves BM25's primary weakness: vocabulary mismatch, where a query uses different words than the relevant document and BM25 scores the document at zero.

    Sparse vs Dense Vector RepresentationsSparse (BM25 / SPLADE)150,000-dimensional vocabulary spaceranking80algorithm60search45neural12query8dogweatherrecipeMost dimensions = 0. Retrieval via inverted index. Interpretable.Dense (Bi-Encoder Embeddings)768-dimensional latent spacedim 10.29dim 960.42dim 191-0.18dim 286-0.15dim 3810.44dim 4760.26dim 571-0.28dim 6660.03All dimensions non-zero. Retrieval via ANN. Not interpretable.Sparse retrieval is exact and interpretable. Dense retrieval captures semantics. Hybrid systems use both.

    Both BM25 and SPLADE produce sparse vectors: vectors where the vast majority of dimensions are zero. Only terms that appear in the document (BM25) or are predicted to be related to the document's content (SPLADE) have non-zero values. This makes sparse retrieval fast via inverted index lookup and interpretable: you can see exactly which terms drove the relevance score.

    How BM25 and SPLADE Affect AI Search Coverage

    BM25 is not dead in the AI search era. Many AI search systems use sparse retrieval as a first-stage retriever precisely because it is fast and handles exact term queries reliably. SPLADE is increasingly deployed for first-stage retrieval in sophisticated pipelines.

    Example: Exact Match vs Semantic Expansion

    Query: "best techniques for speeding up web page rendering"

    BM25 scores (term overlap only)

    Score: 14.2

    "Best techniques for web page rendering speed: lazy loading, code splitting, and CDN delivery."

    Score: 0

    "Optimising Core Web Vitals with deferred JavaScript execution, image compression, and reducing render-blocking resources."

    BM25 scores zero for the second doc: no term overlap with "speeding up web page rendering".

    SPLADE scores (with semantic expansion)

    Score: 14.2

    "Best techniques for web page rendering speed..."

    Score: 11.7

    "Optimising Core Web Vitals with deferred JavaScript..." SPLADE expands "render-blocking" and "Core Web Vitals" to terms matching the query intent.

    SPLADE surfaces both documents. The semantically relevant doc without keyword overlap is now retrievable.

    • Exact terminology still matters: For product names, brand names, technical terms, and proper nouns, BM25 remains highly effective. Content that includes the exact terminology users search for will score well in the sparse retrieval component of a hybrid system.
    • Semantic variation improves dense retrieval coverage: Using synonyms, related terms, and paraphrases throughout the content improves performance in the dense retrieval component. This aligns with good content writing practice: covering a topic thoroughly naturally introduces vocabulary variation.
    • BM25 penalises keyword stuffing: The TF saturation and length normalisation in BM25 mean that repeating a keyword 20 times in a short document produces a worse score than naturally integrating the term in a comprehensive document. BM25's design directly discourages keyword stuffing.
    • SPLADE expansion benefits content about common topics: If your content covers well-established topics (machine learning, SEO, marketing), SPLADE's expansion will reach queries that use the standard vocabulary of that topic, even if your content does not use every specific term.
    • AI search systems combine signals: Optimising for AI search means producing content that performs well in both sparse and dense retrieval — precise in terminology and rich in semantic variation.

    BM25 Explained

    BM25 computes a relevance score for each document given a query by summing three components for each query term: how often the term appears in the document (TF), how rare the term is across all documents (IDF), and a normalisation for document length.

    BM25 Scoring ComponentsTerm Frequency (TF)How often query term appearsin the documentBM25 applies saturation:10 occurrences not 10x betterthan 1 occurrenceIDF (Inverse Doc Frequency)Rare terms score higher thancommon terms"the" scores near 0"matryoshka" scores highPenalises stopwords naturallyDocument Length NormShorter docs score higher perterm occurrence than longer docsPrevents gaming by paddingwith repeated keywordsControlled by parameter bBM25 combines TF saturation, IDF weighting, and length normalisation into a single relevance score per term.

    The key innovation over simple TF-IDF is TF saturation, controlled by parameter k1 (typically 1.2 to 2.0). In TF-IDF, a document with 10 occurrences of a query term scores 10x higher than one with 1 occurrence. In BM25, the saturation curve means 10 occurrences scores only about 2-3x higher. This prevents short but highly repetitive documents from outranking longer, more comprehensive documents that mention the query term naturally.

    Document length normalisation, controlled by parameter b (typically 0.75), penalises long documents relative to short ones for the same term frequency. A short document mentioning "machine learning" three times is considered more focused on that topic than a 10,000-word article that also mentions it three times. Setting b=0 disables length normalisation; setting b=1 applies full normalisation.

    BM25 retrieval is implemented as an inverted index lookup: for each query term, the index directly returns the list of documents containing that term with their pre-computed statistics. Scoring is computed only for documents that contain at least one query term. This makes BM25 retrieval much faster than dense vector search for high-recall scenarios at low latency, which is why it remains the baseline for first-stage retrieval in many hybrid systems.

    BM25's Limitations

    BM25's fundamental limitation is that it requires exact or near-exact term overlap between query and document. If a query uses the term "car" and the relevant document only uses "automobile" and "vehicle", BM25 scores that document at zero. This vocabulary mismatch problem is the primary driver for combining BM25 with semantic (dense) retrieval.

    BM25 also has no understanding of term relationships. The query "not broken" is scored identically to "broken" for BM25 because it sums individual term frequencies without understanding negation. Dense embedding models handle negation and other linguistic structures through the contextual representations produced by transformer encoders.

    Despite these limitations, BM25 outperforms many neural retrieval approaches for highly specific queries with rare, exact terminology. A query for a precise product code or technical identifier is better served by exact match scoring than by semantic approximation. This complementarity is why hybrid retrieval systems combining BM25 and dense retrieval consistently outperform either approach alone.

    SPLADE: Learned Sparse Retrieval

    How SPLADE Expands Terms Beyond the DocumentOriginal Doc"search engine""ranking""algorithm"BM25 terms onlyBERTMLMSPLADE Expansion"search engine" (high)"information retrieval""relevance scoring""web index" (medium)Vocab-space sparse vectorRetrieval BenefitNow matches queries using:"information retrieval algorithms""how web search ranks pages"No vocabulary mismatch problemSPLADE uses BERT's masked language model head to expand document terms into the full vocabulary, producing a sparse but semantically expanded representation.

    SPLADE addresses vocabulary mismatch by using a BERT model with a masked language model (MLM) head to produce sparse vectors over the full tokeniser vocabulary. Rather than only assigning weights to terms that appear verbatim in the document, SPLADE produces weights for terms that BERT predicts are contextually related to the document's content.

    For a document discussing "search engine ranking algorithms", SPLADE might assign non-zero weights to "information retrieval", "relevance scoring", "query processing", and "web index", in addition to the terms explicitly in the document. These expansions allow SPLADE to match queries that use this related vocabulary, eliminating the vocabulary mismatch that would defeat BM25.

    Critically, SPLADE vectors remain sparse. Most of the vocabulary dimensions are zero. This means SPLADE vectors can still be used with inverted indexes for efficient retrieval, unlike dense vectors which require approximate nearest neighbour search. The sparsity is enforced through a regularisation term in the SPLADE training loss that penalises non-zero dimensions.

    SPLADE-v2 and subsequent variants (DistilSPLADE, SPLADE-v3) have achieved performance on BEIR (Benchmark for Information Retrieval) competitive with or exceeding dense retrieval models, while maintaining the interpretability and inverted-index compatibility of sparse vectors.

    Sparse vs Dense Retrieval

    Sparse retrieval (BM25, SPLADE) and dense retrieval (bi-encoder embeddings) have complementary strengths. Sparse retrieval excels at exact term matching, rare terminology, and product-specific queries. Dense retrieval excels at paraphrasing, semantic similarity, and cross-lingual matching.

    Head-to-head benchmarks consistently show that neither approach dominates the other across all query types. Dense retrieval outperforms BM25 significantly on out-of-domain data where terminology varies. BM25 outperforms dense retrieval on datasets with precise technical queries where exact term matching is critical.

    This complementarity is why production AI search systems nearly always use both: dense retrieval for semantic coverage, sparse retrieval for exact match precision, and Reciprocal Rank Fusion to merge the two ranked lists into a single result set. Elasticsearch's approximate k-nearest neighbour search, Vespa, and Qdrant all support this hybrid retrieval pattern natively.

    Frequently Asked Questions

    Does Google use BM25 for ranking?

    Google uses BM25 or BM25-inspired signals as part of its ranking system, particularly for exact term matching. The Google Search documentation mentions BM25 explicitly in the context of how Google scores documents for keyword relevance. However, Google's full ranking system combines many signals beyond BM25, including neural models, link analysis, and user engagement data.

    What are the BM25 parameters k1 and b?

    k1 controls term frequency saturation (typically 1.2-2.0). Higher values give more weight to repeated terms. b controls document length normalisation (0-1, typically 0.75). A value of 0 disables length normalisation; a value of 1 applies full normalisation. These parameters are tunable and often calibrated on domain-specific data.

    How is SPLADE different from doc2query?

    Doc2query expands a document by generating likely questions that the document answers, then appending them to the document before BM25 indexing. SPLADE produces expansion weights directly over the vocabulary space using the BERT MLM head, without generating text. SPLADE is end-to-end trained for retrieval and produces a proper sparse vector; doc2query is a text augmentation technique for BM25.

    Can SPLADE be used with a standard inverted index like Elasticsearch?

    Yes. SPLADE vectors are sparse over the tokeniser vocabulary, so they can be stored in an inverted index by treating non-zero vocabulary dimensions as "terms" with their SPLADE weights as "term frequencies". Elasticsearch and OpenSearch support this via the rank_feature or sparse_vector field types, enabling SPLADE retrieval without a separate vector database.

    Is BM25 still relevant with modern LLM-based search?

    Yes. BM25 remains a strong first-stage retriever and is used in hybrid systems precisely because of its exact match capabilities and low latency. Even GPT-based and Perplexity-style search systems use BM25 or BM25-derived retrieval as part of their first-stage candidate generation before neural re-ranking. The simplicity and speed of BM25 make it difficult to replace entirely.

    Optimise for Both Sparse and Dense Retrieval

    AI search systems use hybrid retrieval combining BM25, SPLADE, and dense embeddings. We structure content to perform well across all retrieval layers.

    Tharindu Gunawardana

    Tharindu Gunawardana

    Founder and Director of SearchMinistry

    Tharindu Gunawardana is the Founder of SearchMinistry Media and a search strategist with 17 years of experience across Sri Lanka, Singapore, and Australia. A former Agency SEO Director, he specialises in helping brands transition from traditional SEO to AI-driven discovery.

    Leave a Reply