What is BM25? Term frequency and document length in relevance ranking
Understand BM25 through model codes and error strings, including rare terms, frequency saturation, length normalization, and differences from factual accuracy.
Understand the concept
BM25 ranks text relevance using query-term occurrences and rarity with term-frequency saturation and document-length effects. It supports lexical retrieval rather than generation or truth assessment. Scores depend on corpus and settings and are not directly comparable across indexes or interpretable as answer probabilities.
Repeated terms do not add unlimited linear relevance
A repeated error code affects relevance through saturation rather than a guaranteed tenfold benefit from ten occurrences. Common corpus terms discriminate less than rare terms that identify a particular instruction.
Length normalization addresses document-length differences, with parameters and analysis affecting results. Elastic and Azure expose settings. Tuning scores does not fix split identifiers or missing indexed text.
Exact terms help while paraphrases can remain difficult
Full product codes or error strings provide lexical signals. Vague descriptions without the documentation’s wording can be missed. Query expansion or semantic retrieval may help, while retaining exact identifiers to avoid neighboring models.
An outdated document can rank highly through exact terms. BM25 does not enforce versions or access. Filter metadata and inspect source applicability. No search index or measured algorithm comparison was created here.
Tune with fixed questions and concrete errors
Check known-document hits and reasons for low ranking. Compare fields and parameters for irrelevant high-ranked text; address wording when terms do not match. Fix corpus versions to distinguish data changes from ranking improvements.
Vector and lexical scores can use different scales, so raw addition can be misleading. Hybrid search may use rank fusion, subject to evaluation. Better retrieval still needs checks that generation uses all qualifications correctly.
Checked sources
These sources support the concepts and methods described here. Examples and test scope are labeled separately; check the version of the tools you use.