ML//RAG//BM25
BM25 (Best Matching 25) is the classic keyword ranking algorithm of information retrieval. It scores documents by term frequency, inverse document frequency and a normalization by document length.
BM25 (Best Matching 25) is the classic keyword ranking algorithm of information retrieval. It scores documents by term frequency, inverse document frequency and a normalization by document length.
It is still competitive with embeddings for exact-match queries, and most production RAG combines BM25 with vectors (hybrid search), where BM25 catches the exact term matches that semantic embeddings miss.