Opening your learning space
Starting the app …
Opening your learning space
Starting the app …
BM25 scores documents for a query using term frequency, term rarity and document-length normalization.
Free to browse · flashcards or a multiple-choice quiz · import from Essential
Formula
dimensionless ranking score; k1 and b are dimensionless
| Symbol | Meaning | Unit |
|---|---|---|
| Frequency of query term t in document D | count | |
| |D|/avgdl | Document length relative to corpus average | dimensionless |
| Term-frequency saturation and length-normalization parameters | dimensionless |
\mathrm{BM25}(D,Q)=\sum_{t\in Q}IDF(t)\frac{f(t,D)(k_1+1)}{f(t,D)+k_1(1-b+b|D|/\mathrm{avgdl})}BM25 sums contributions over query terms. Term-frequency impact saturates with k1, while b controls length normalization. A common IDF variant is ln((N−df+0.5)/(df+0.5)); implementations differ in details. Parameters are usually tuned empirically. The formula is a ranking model and does not produce calibrated relevance probabilities; query-term weights may be added.
BM25 sums contributions over query terms. Term-frequency impact saturates with k1, while b controls length normalization. A common IDF variant is ln((N−df+0.5)/(df+0.5)); implementations differ in details. Parameters are usually tuned empirically. The formula is a ranking model and does not produce calibrated relevance probabilities; query-term weights may be added.
BM25 scores documents for a query using term frequency, term rarity and document-length normalization.
Defining relation
The equation states the defining relation within its stated domain.
Use the example for Okapi BM25 ranking to explain which inputs determine the requested output.
The example connects concrete inputs to its result.
BM25 scores documents for a query using term frequency, term rarity and document-length normalization.
The relation applies only under its stated assumptions.
Applying the relation to a different case without checking its stated assumptions.
Check the validity range before substituting values: BM25 sums contributions over query terms. Term-frequency impact saturates with k1, while b controls length normalization. A common IDF variant is ln((N−df+0.5)/(df+0.5)); implementations differ in details. Parameters are usually tuned.
Formula cluster
BM25 scores documents for a query using term frequency, term rarity and document-length normalization.
For f=3, k1=1.2, b=0.75, document length 100, average length 100 and IDF=2, the term contribution is 2·3·2.2/(3+1.2)=3.143.
Rank documents by statistical term match in lexical search systems.
Here is how to work through a typical Okapi BM25 ranking (BM25 = Σ IDF · tf-saturation · length-normalization) task step by step:
Task
Use the example for Okapi BM25 ranking to explain which inputs determine the requested output.
Solution path
The example connects concrete inputs to its result.
BM25 scores documents for a query using term frequency, term rarity and document-length normalization.
The relation applies only under its stated assumptions.
The relation \mathrm{BM25}(D,Q)=\sum_{t\in Q}IDF(t)\frac{f(t,D)(k1+1)}{f(t,D)+k1(1-b+b|D|/\mathrm{avgdl})} summarizes BM25 scores documents for a query using term frequency, term rarity and document-length normalization. Read it as a model for defined quantities, not as an automatic claim about every real situation. In the example For f=3, k1=1.2, b=0.75, document length 100, average length 100 and IDF=2, the term contribution is 2·3·2.2/(3+1.2)=3.143., symbols are connected to concrete values and the result is interpreted in context. Validity limit: BM25 sums contributions over query terms. Term-frequency impact saturates with k1, while b controls length normalization. A common IDF variant is ln((N−df+0.5)/(df+0.5)); implementations differ in details. Parameters are usually tuned Source: Stanford Introduction to Information Retrieval, Chapter 11: Probabilistic Information Retrieval and BM25.
First write down the requested quantity and all given values with their symbols. Substitute them into the defining relation and check unit consistency. The example For f=3, k1=1.2, b=0.75, document length 100, average length 100 and IDF=2, the term contribution is 2·3·2.2/(3+1.2)=3.143. provides a worked check: formula and result must have compatible scale and meaning; round only at the end. Validity limit: BM25 sums contributions over query terms. Term-frequency impact saturates with k1, while b controls length normalization. A common IDF variant is ln((N−df+0.5)/(df+0.5)); implementations differ in details. Parameters are usually tuned Source: Stanford Introduction to Information Retrieval, Chapter 11: Probabilistic Information Retrieval and BM25.
The formula applies only when quantities are defined as in the source and background. Check boundary cases, measurement conditions and whether an approximation rather than equality is intended. Substitution can be algebraically correct yet technically wrong when assumptions fail or the population or system boundary changes. Validity limit: BM25 sums contributions over query terms. Term-frequency impact saturates with k1, while b controls length normalization. A common IDF variant is ln((N−df+0.5)/(df+0.5)); implementations differ in details. Parameters are usually tuned Source: Stanford Introduction to Information Retrieval, Chapter 11: Probabilistic Information Retrieval and BM25.
The stated units are: dimensionless ranking score; k1 and b are dimensionless. Convert values to a consistent unit system before substitution; counts, percentages and dimensionless ratios are not interchangeable. The variable list states the role of each symbol. Dimensional analysis catches many errors but does not replace checking the formula's assumptions. Validity limit: BM25 sums contributions over query terms. Term-frequency impact saturates with k1, while b controls length normalization. A common IDF variant is ln((N−df+0.5)/(df+0.5)); implementations differ in details. Parameters are usually tuned Source: Stanford Introduction to Information Retrieval, Chapter 11: Probabilistic Information Retrieval and BM25.
Comparison helps when both quantities address the same question but emphasize different properties. Report the definition, input data, threshold or averaging with the value. The source Stanford Introduction to Information Retrieval, Chapter 11: Probabilistic Information Retrieval and BM25. supports the definition used here; other conventions can differ. Choose the measure to match the learning or analysis goal. Validity limit: BM25 sums contributions over query terms. Term-frequency impact saturates with k1, while b controls length normalization. A common IDF variant is ln((N−df+0.5)/(df+0.5)); implementations differ in details. Parameters are usually tuned Source: Stanford Introduction to Information Retrieval, Chapter 11: Probabilistic Information Retrieval and BM25.
Quanta exam set
Curated exam set for "Okapi BM25 ranking":
Question (front)
Which formula describes Okapi BM25 ranking?
Answer in your set
Question (front)
How do you rearrange Okapi BM25 ranking for Defining relation?
Answer in your set
Question (front)
Which common mistake happens with Okapi BM25 ranking?
Answer in your set
+ 7 more cards: units, variables, derivation, example, exam task
The formula set contains 10 cards. After importing, review them and start practicing; your ratings determine later review intervals.
This list names subject references and further reading. A page or section number appears when it is part of the reference; these are not verbatim quotations.
Create a curated FSRS exam set for BM25 = Σ IDF · tf-saturation · length-normalization: formula recall, variables, derivation, rearrangement, worked example, common mistakes and exam context.
Curated formula set · LaTeX · FSRS spaced repetition · import from Essential