BM25 ranks documents by estimating query relevance from term frequency, inverse document frequency, document length, and term-frequency saturation. It is a sparse retrieval option for retrieval-augmented generation when queries closely match document wording and speed matters. section 7.4
Choose BM25 by balancing retrieval behavior and operational constraints:
- Prefer sparse retrieval when computational efficiency is important or query terms are expected to match document text closely. section 7.4
- Contrast BM25 with TF-IDF, which lacks BM25’s additional treatment of document length and term-frequency saturation. section 7.4
- Consider dense retrieval such as DPR when semantic matching and nuanced language understanding outweigh computational cost. section 7.4




