Skip to main content
Deep DiveSearch AlgorithmsTrade-off Analysis· 4 min read· in Data & Analysis

BM25 vs. Dense Retrieval: The Accuracy and Latency Trade-offs in Search Ranking

While dense neural embeddings dominate zero-shot semantic benchmarks, traditional lexical algorithms regain a massive accuracy advantage as search corpora scale past 10 million tokens.

By Karim Mansour

Hybrid Systems Engineers 40%Lexical Traditionalists 30%Neural Retrieval Advocates 30%
Hybrid Systems Engineers
Practitioners who deploy dual pipelines to cover the full query distribution despite the added complexity.
Lexical Traditionalists
Advocates for maintaining sparse, keyword-based architectures due to their unmatched speed and precision.
Neural Retrieval Advocates
Proponents of dense embeddings who prioritize semantic understanding and conceptual matching.

Perspectives this story doesn't cover

  • Hardware vendors selling the GPU infrastructure required to run dense vector databases at scale
  • End-users experiencing the latency differences between lexical and neural search in real-time applications
67.71
Gemini Embedding 2 nDCG@10 score
42.0
BM25 baseline nDCG@10 score
10 million
Token threshold where BM25 overtakes dense models
50–200 ms
Latency to generate a single dense embedding
580%
Recall improvement using hybrid fusion

In April 2026, the Gemini Embedding 2 model posted a score of 67.71 on the BEIR (Benchmarking Information Retrieval) leaderboard. Measured in normalized Discounted Cumulative Gain at rank 10 (nDCG@10), that figure represents the current ceiling for dense vector retrieval—a neural approach that maps human queries into high-dimensional mathematical space. On the same leaderboard, the traditional lexical algorithm BM25 sits far behind at 42.0.

That 25-point gap on the Massive Text Embedding Benchmark (MTEB) suggests a total victory for semantic search over exact keyword matching. Dense retrieval uses transformer encoders to convert text into vectors of 768 to 1,536 dimensions. Because it measures the cosine similarity between these vectors, it understands that a user searching for "physician" will be satisfied by a document about a "doctor," even if the exact string never appears.

BM25, conversely, is a sparse retrieval method built on term frequency-inverse document frequency (TF-IDF). It requires exact lexical overlap. If a user queries "bicycle repair" and the corpus only contains the phrase "fixing a bike," BM25 returns nothing. Yet despite this rigid limitation, BM25 remains the foundational baseline for nearly every production search system in the world.[1]

Dense retrieval models hold a commanding lead on standard zero-shot semantic benchmarks.

The persistence of BM25 comes down to the specific ways in which semantic understanding fails. Dense retrieval models are trained on general text, which makes them highly capable of interpreting broad concepts but remarkably poor at identifying exact, rare strings. When a user searches for a specific error code like "XYZ-1234" or a niche technical term like the "Karatsuba multiplication algorithm," dense models often return semantically adjacent but factually incorrect results, such as "XYZ-1235".

"Sparse retrieval's strengths are the mirror of dense retrieval's weaknesses," notes a May 2026 analysis by data engineering firm Atlan. "Exact keyword matching works precisely for statute names, error codes, product identifiers, and technical jargon."

"Sparse retrieval's strengths are the mirror of dense retrieval's weaknesses," notes a May 2026 analysis by data engineering firm Atlan.

Then there is the computational cost. BM25 relies on inverted indexes, a data structure that allows it to search billions of documents in single-digit milliseconds. The operational cost runs between $0.01 and $0.10 per one million queries. Dense retrieval, by contrast, requires generating an embedding for every new document—a process that takes 50 to 200 milliseconds per document—and demands memory-intensive approximate nearest neighbor (ANN) indexes like HNSW or FAISS.

These trade-offs compound as the search space grows. A July 2026 controlled study tested retrieval methods across 28 nested corpus tiers, scaling the data volume by a factor of 450. The researchers found that while agentic and dense retrieval systems dominate small datasets, their accuracy erodes as the haystack expands.

As the search space expands past 10 million tokens, lexical matching overtakes semantic models in accuracy.

Once the corpus crossed the 10-million token threshold, BM25 overtook the neural models. At the largest scale tested, the traditional lexical algorithm beat dense retrieval and autonomous agents by a margin approaching 20 points. As the volume of text increases, the semantic overlap between unrelated documents rises, making exact-term anchoring necessary to filter out noise.

Because the two methods fail on opposite ends of the query spectrum, production systems increasingly refuse to choose between them. The current industry standard is hybrid retrieval, which runs both pipelines in parallel and merges the results using Reciprocal Rank Fusion (RRF).

RRF calculates a combined score using a simple mathematical formula: the inverse of a constant (typically 60) plus the document's rank in each respective system. If a document ranks first under BM25 and tenth under dense retrieval, its combined score is 1/61 plus 1/70, yielding 0.031. This fusion ensures that documents scoring highly in both exact matching and semantic relevance rise to the top.

Reciprocal Rank Fusion (RRF) mathematically balances the strengths of both retrieval methods.

The empirical results of this dual approach are definitive. On the MS MARCO recall tasks, weighted fusion of dense and sparse retrieval improves recall by up to 580 percent compared to single-method approaches. To reach a recall@1,000 threshold of 0.98, both pipelines are strictly required; neither BM25 nor dense retrieval can achieve that coverage alone.

Viewpoints in depth

BM25 (Sparse Lexical Retrieval)

The traditional statistical approach relying on exact keyword overlap.

**For:** Unmatched precision on exact identifiers, single-digit millisecond latency, and highly efficient memory usage via inverted indexes. **Against:** Completely blind to semantic intent; fails when the user's vocabulary differs from the document's. **Evidence:** Costs $0.01–$0.10 per million queries and regains a 20-point accuracy lead over dense models when corpora exceed 10 million tokens. **Fits well when:** The search space is massive, latency constraints are strict, and queries involve exact names, error codes, or SKUs. **Does not fit when:** Users search by broad concepts, questions, or descriptions.

Dense Vector Retrieval

Neural models that map text into high-dimensional semantic space.

**For:** Deep contextual understanding, immunity to vocabulary mismatch, and superior performance on natural language questions. **Against:** High computational overhead, poor performance on exact string matching, and a tendency to retrieve semantically related but factually incorrect results. **Evidence:** Achieves a 67.71 nDCG@10 on the BEIR benchmark, outperforming BM25 by over 25 points on small-to-medium datasets, but requires 50–200 milliseconds per document for embedding generation. **Fits well when:** The corpus is semantically homogeneous, queries are conversational, and infrastructure budgets can support vector databases. **Does not fit when:** The system must retrieve specific alphanumeric codes or operate under hard sub-50ms latency constraints.

Hybrid Search (Reciprocal Rank Fusion)

The parallel deployment of both lexical and semantic pipelines.

**For:** Covers the entire query distribution by catching both exact matches and semantic intent, achieving the highest overall recall. **Against:** Doubles the infrastructure complexity, requires tuning fusion weights, and inherits the latency floor of the slower dense pipeline. **Evidence:** Improves recall by up to 580 percent on MS MARCO tasks compared to single-method approaches, and is the only configuration capable of reaching a 0.98 recall@1,000 threshold. **Fits well when:** Building production-grade Retrieval-Augmented Generation (RAG) systems where missing a relevant document is more costly than the compute overhead. **Does not fit when:** Prototyping early-stage applications or operating on highly constrained mobile hardware.

Sources

Source coverage

2 outlets

3 viewpoints surfaced

Hybrid Systems Engineers 40%Lexical Traditionalists 30%Neural Retrieval Advocates 30%
  1. [1]arXivNeural Retrieval Advocates

    BEIR: A Heterogeneous Benchmark for Zero-shot Evaluation of Information Retrieval Models

    Read on arXiv
  2. [2]Factlen Editorial TeamHybrid Systems Engineers

    Synthesis by Factlen editorial team

    Read on Factlen Editorial Team

Comments

Stay informed

Every angle. Every day.

Get Data & Analysis stories with full source coverage and perspective breakdowns delivered to your inbox.