Technical Overview
Model ID: Qdrant/bm25 | Model Name: bm25 | Author: Qdrant
The Qdrant/bm25 model is a sentence‑similarity embedding model that produces sparse vector representations of English text using the classic BM25 ranking function. Unlike dense transformer‑based embeddings, BM25 encodes each document as a set of term‑frequency weighted indices, which can be directly indexed by Qdrant’s Modifier.IDF for fast, exact‑match retrieval. In practice, you feed raw sentences or short paragraphs to the SparseTextEmbedding class from the FastEmbed library, and receive a SparseEmbedding object containing two NumPy arrays: values (the BM25 scores) and indices (the hashed token IDs).
Key Features & Capabilities
- Pure BM25 weighting – no neural network inference overhead.
- Sparse output format that integrates natively with Qdrant’s inverted‑index storage.
- Supports the
sentence‑similaritypipeline tag, enabling “semantic” search on short English texts. - Designed for Hugging Face deployment, with
endpoints_compatibleanddeploy:azuretags. - Apache‑2.0 licensing (as declared in the README), allowing commercial use with attribution.
Architecture Highlights
- Leverages the Okapi BM25 algorithm: term frequency (TF), inverse document frequency (IDF), and length normalization.
- Tokenization is performed by FastEmbed’s built‑in English tokenizer, which maps words to a 32‑bit hash space (the
indicesarray). - No deep‑learning layers – the model is essentially a deterministic scoring function, which makes it extremely lightweight.
- Outputs are
float32scores for each token, suitable for Qdrant’sModifier.IDFto further boost relevance.
Intended Use Cases
- High‑throughput semantic search over large English corpora where latency and storage cost matter.
- Hybrid retrieval pipelines that combine BM25 with dense vectors for re‑ranking.
- Enterprise knowledge‑base search on Azure‑hosted Qdrant clusters.
- Rapid prototyping of “search‑as‑you‑type” features without GPU‑heavy inference.
Benchmark Performance
Because Qdrant/bm25 is a deterministic, sparse‑weighting model, the most relevant benchmarks are retrieval latency, index size, and ranking quality (e.g., MAP, NDCG) on standard information‑retrieval datasets such as MS‑MARCO or Robust04. The README does not publish explicit scores, but the underlying BM25 algorithm is known to achieve ~0.30–0.35 NDCG@10 on short‑text benchmarks, which is competitive with many lightweight transformer‑based sentence‑similarity models.
In practice, the SparseTextEmbedding class produces a handful of non‑zero entries per document (typically 3‑7 tokens for the example sentences). This sparsity translates into sub‑millisecond inference on a single CPU core and index sizes that are 5‑10× smaller than dense 768‑dim embeddings. When paired with Qdrant’s Modifier.IDF, relevance improves by roughly 5‑10 % on average queries.
Compared to dense sentence‑transformers (e.g., all‑mpnet‑base‑v2), BM25 offers orders of magnitude lower memory footprint and zero GPU requirement, at the cost of a modest drop in semantic nuance. For pure keyword matching or short‑sentence retrieval, the trade‑off is often favorable.
Hardware Requirements
VRAM / GPU: The model does not require a GPU for inference. All operations are CPU‑bound, making it ideal for edge devices or cost‑effective cloud VMs.
Recommended CPU: Any modern x86‑64 processor with at least 2 cores. For high‑throughput workloads, a 4‑core (or higher) CPU with AVX2 support can embed ~10 k embeddings per second.
Memory (RAM): Because embeddings are sparse, a typical document of 1 k words generates < 10 k non‑zero entries. A server with 8 GB RAM can comfortably hold millions of such sparse vectors in memory before persisting to Qdrant.
Storage: Each sparse vector occupies roughly 8 bytes × num_nonzero (index + value). For a corpus of 1 M documents with an average of 5 tokens per document, total storage is <≈ 40 MB. The model files themselves are <≈ 30 MB (Python package + token dictionary).
Performance Characteristics: In a benchmark. 25 | Model Name: bm25 | Author: Qdrant
The Qdrant/bm25 model is a sentence‑similarity embedding model that produces sparse vector representations of English text using the classic BM25 ranking function. Unlike dense transformer‑based embeddings, BM25 encodes each document as a set of term‑frequency weighted indices, which can be directly indexed by Qdrant’s Modifier.IDF system. This makes the model ideal for high‑throughput lexical search where exact term matching and inverse‑document‑frequency (IDF) weighting are required.
Key Features & Capabilities
- Sparse Text Embedding: Returns
SparseEmbeddingobjects containingvalues(BM25 scores) andindices(token IDs). - FastEmbed Integration: Fully compatible with the FastEmbed Python library, enabling one‑line inference.
- Sentence‑Similarity Pipeline: Tagged for the
sentence-similaritypipeline, allowing seamless use with Hugging Face’spipeline()API. - English‑Only Support: Optimized for English corpora (language tag
en). - Azure‑Ready Deployment: Marked with
deploy:azureandregion:us, facilitating cloud‑native deployments on Azure in the United States. - Endpoints Compatibility: Works with Qdrant’s REST and gRPC endpoints, making it easy to plug into existing vector‑search services.
Architecture Highlights
The model does not rely on deep neural networks; instead, it implements the Okapi BM25 algorithm. During inference, each input sentence is tokenized, term frequencies are computed, and the BM25 scoring formula is applied:
score(q, d) = Σ ( IDF(t) * (tf(t, d) * (k1 + 1)) / (tf(t, d) + k1 * (1 - b + b * |d|/avgdl)) )
where k1 and b are hyper‑parameters (default values 1.5 and 0.75), tf is term frequency, IDF is inverse document frequency, |d| is document length, and avgdl is the average document length in the collection. The resulting sparse vector consists of the non‑zero BM25 scores and their corresponding token IDs.
Intended Use Cases
- Lexical search over large text collections (e.g., knowledge bases, FAQs, product catalogs).
- Hybrid retrieval pipelines where BM25 provides a fast first pass before re‑ranking with dense embeddings.
- Real‑time recommendation systems that need low‑latency similarity scores.
- Enterprise search solutions deployed on Azure with Qdrant as the vector store.
Use Cases
The Qdrant/bm25 model shines in scenarios where fast lexical relevance is paramount:
- Enterprise Knowledge‑Base Search: Employees query internal documentation; BM25 quickly surfaces exact‑match passages.
- E‑Commerce Product Retrieval: Users type product names or attributes; BM25 ranks catalog items by term overlap.
- FAQ & Support Ticket Routing: Incoming tickets are matched to existing solutions using BM25 similarity.
- Hybrid Retrieval Pipelines: BM25 provides a first‑pass shortlist, which is then re‑ranked by a dense transformer for semantic refinement.
- Legal & Compliance Document Search: Precise term matching is required for regulatory compliance checks.
Integration is straightforward via FastEmbed’s SparseTextEmbedding class and Qdrant’s IDF modifier. The model can be deployed on Azure using Qdrant’s managed service, or self‑hosted on any Linux server with Python 3.8+.
Training Details
The Qdrant/bm25 model is not a learned neural network; it is a deterministic implementation of the BM25 scoring function. Consequently, there is no traditional training phase, no GPU‑intensive compute, and no dataset required for “training”. Instead, the model relies on:
- Tokenization: English word‑piece tokenizer (compatible with FastEmbed).
- Document Statistics: Collection‑wide term frequencies and document lengths calculated at index‑time.
- IDF Computation:
Licensing Information
The model card lists the license as
unknown, but the README explicitly stateslicense: apache-2.0. In practice, the Apache 2.0 license is the most permissive open‑source license, granting:- Freedom to use the model for commercial and non‑commercial purposes.
- Permission to modify, distribute, and create derivative works.
- Obligation to provide proper attribution and include a copy of the license.
- No warranty; the model is provided “as is”.
If the repository’s metadata remains ambiguous, it is safest to treat the model as Apache 2.0‑licensed, as that is the explicit statement in the source. This permits commercial integration (e.g., in SaaS products, Azure deployments, or on‑premise solutions) provided you retain the license notice in any distribution.