Skip to content

BM25

BM25 is a keyword-ranking function. It uses term frequency, term rarity across documents, and document-length normalization; term repetition eventually saturates instead of increasing the score forever.

For ERR_CONN_RESET_42, BM25 can strongly reward the exact rare token. An embedding may blur it with other network errors.

BM25 can miss a paraphrase with no shared terms. Dense retrieval can match paraphrases but struggle with exact identifiers. Hybrid search combines their strengths.

Raw BM25 and cosine scores are not automatically comparable. Use a tested normalization or a rank-based method such as reciprocal rank fusion.