← All questions
Retrieval & EmbeddingsHard· BM25· IDF· Information Retrieval

Where does BM25’s IDF term come from, and why that form...

A strong answer follows a four-step chain: rank by probability of relevance, convert to odds and drop the query-constant prior, factorize under binary independence, and estimate from a 2x2 table. By setting the relevance parameter S to 0, the formula ln(N-nt+0.5 / nt+0.5) is derived. A weak answer merely describes the behavior of downweighting common words without explaining the mathematical origin.

Code playground (Python)