TF-IDF and BM25
A family of ranking functions used by search engines to estimate the relevance of documents to a given query, based on probabilistic foundations and incorporating term frequency saturation and document length normalization.
Method
BM25 scores a document as a sum over query terms of IDF-weighted saturated term frequencies, with length normalization controlled by parameters k1 and b. Derived from the binary independence model and 2-Poisson framework. Easy to implement and tune; remains a strong baseline.
Applications
Web search, enterprise search, e-commerce product search, legal and medical document retrieval, first-stage retrieval in multi-stage ranking pipelines, RAG retrieval stages.
Advantages
Simple, fast, and remarkably effective; strong baseline that is hard to beat without semantic models; interpretable; mature and widely deployed.
Limitations
Bag-of-words (no semantics or order); limited handling of synonyms and paraphrases; parameters need tuning per collection; less effective for very short or very long documents without adjustment.
Alternatives
Dense retrieval (Sentence Transformers, DPR), learned sparse retrieval (SPLADE), classic TF-IDF, language-model-based IR, hybrid sparse+dense. Top Algorithms & Models — Part 2 (101–200) Research Compendium
Sources
Educational reference only, not professional advice.
All algorithms