BM25
Qdrant/bm25
published Jun 2024 · updated Jan 2025
BM25 is a sparse text embedding model based on the Okapi BM25 ranking function for estimating the relevance of documents to a search query.
specs
| Task | Sparse Text Embedding |
| Architecture | BM25 (Okapi BM25 ranking function) |
| Embedding Type | Sparse (bag-of-words with TF-IDF weighting) |
| Output Format | SparseEmbedding with values and indices arrays |
about this model
Qdrant/bm25 is a sparse embedding model that generates BM25-weighted sparse vectors for document and query relevance scoring. It implements the Okapi BM25 ranking function, a probabilistic retrieval framework that estimates document relevance based on term frequency and inverse document frequency.
How it works
The model outputs sparse embeddings where each dimension corresponds to a token's BM25 score. These vectors are designed to be used with Qdrant’s IDF modifier for efficient nearest-neighbor search. The underlying inference is powered by ONNX Runtime, enabling fast, CPU-based execution with minimal dependencies.
Key characteristics
- Produces sparse embeddings – each vector contains non-zero values only for terms present in the input text.
- Compatible with Qdrant’s sparse vector indexing and search capabilities.
- Optimized for lightweight deployment: no GPU required, small library footprint via FastEmbed.
- Suitable for lexical retrieval tasks where exact term matching and IDF weighting are important.
Performance notes
As a classic BM25 implementation, this model provides deterministic relevance scoring based on term statistics. No benchmark results are provided in the model card; performance depends on the target corpus and query characteristics. It is best evaluated in combination with Qdrant’s retrieval pipeline.
best for
- ·Keyword-based document retrieval
- ·Hybrid search pipelines combining sparse and dense embeddings
- ·Baseline ranking for search relevance experiments
FAQ
BM25 is a ranking function that estimates document relevance based on term frequency and inverse document frequency.
BM25 produces sparse vectors based on exact term matching, while dense models capture semantic similarity.
Use the FastEmbed library with SparseTextEmbedding and model name "Qdrant/bm25". For hosted API, use gigarouter's OpenAI-compatible endpoint with your API key.
Input: text documents. Output: SparseEmbedding objects with values and indices arrays.
No, it is designed for keyword-based retrieval, not semantic similarity.
We're benchmarking and onboarding BM25 as a hosted, OpenAI-compatible API. Sign in for free credit and be ready when it lands, or tell us you want it and we'll prioritize it.