On the 225 Cranfield queries, with one shared text pipeline and standard settings, mean average precision is 0.010 for strict Boolean AND (no results for 216 queries), 0.220 for the Binary Independence Model without relevance information, 0.294 for TF-IDF with lnc.ltc cosine weighting, and 0.307 for BM25 ($k_1 = 1.2$, $b = 0.75$). TF-IDF and BM25 each beat the BIM far beyond chance (paired randomization test, $p < 0.001$). BM25's lead over TF-IDF, 0.012 in MAP, is not significant ($p = 0.075$; bootstrap 95 percent interval $[-0.001, 0.026]$), although BM25 wins on more queries, 129 to 84. Tuning BM25 on half the queries gained 0.003 on the other half.
Query 185, experimental studies on panel flutter, has now been ranked by every model in the course. Strict Boolean AND returns just two abstracts, both relevant, and nothing else, for an average precision of 0.222. TF-IDF reaches 0.624, the Binary Independence Model 0.659, and BM25 0.784. On this one query, each model in course order beats the one before it. But one query proves little. Across all 225 Cranfield queries, does each model beat the one before it, and are the differences larger than chance? Not quite. Ranking beats Boolean matching and BM25 beats the BIM by margins far beyond chance, but the BIM falls below TF-IDF, and BM25's lead over TF-IDF is too small for 225 queries to establish.
The course presents four models in sequence: Boolean retrieval, the vector space model with TF-IDF weighting, the BIM, and BM25. Ranking was introduced to overcome exact matching, and BM25 to add term frequency and length to the BIM. Here all four run on the same collection with the same text processing, measured with the methods of evaluation (Manning, Raghavan, and Schütze, 2008, chapters 6, 8, and 11). The experiment is small, but its results agree with what the field found at much larger scale.
Here is the route. First we fix the setup and read the results. Then we look beneath the averages, at individual queries, and ask how confident we can be in the closest difference. Finally we tune BM25 fairly and state the limits of the comparison.
Setup
Collection. The Cranfield collection comes from the experiments that founded test-collection evaluation (Cleverdon, 1967). It has 1,400 abstracts of aerodynamics papers and 225 queries, each a natural-language question written by a researcher, with graded relevance judgments (see test collections). It was loaded with the ir_datasets library (MacAvaney et al., 2021). Grades 1 to 4 were treated as relevant for binary measures. Grade 1 marks a complete answer and grade 4 a reference of minimum interest, so nDCG used 5 minus the grade as the gain. Queries have 7.2 relevant documents on average.
Text processing. Every model used the same analysis:
- lowercase;
- split on non-alphanumeric characters;
- remove a 33-word stop list (Lucene's English list);
- stem with the original Porter algorithm.
The documents average 111.6 tokens after processing, and the vocabulary has 4,803 terms.
Models.
| Model | Scoring |
|---|---|
| Boolean AND | documents containing every query term, in document order |
| TF-IDF | cosine similarity with lnc.ltc weighting (see variants of TF-IDF) |
| BIM | Robertson–Spärck Jones weight with no relevance information: $p_t = 0.5$, smoothed $u_t$, as in my HW04 (see the BIM article) |
| BM25 | $k_1 = 1.2$, $b = 0.75$, Lucene's IDF (see implementing BM25) |
Measures.
- Mean average precision over the top 1,000 results. The feedback and variant experiments in other articles rank all 1,400 documents, which makes no practical difference here.
- Precision at 10 and nDCG at 10.
- Paired randomization tests on per-query average precision (see significance testing, and Permutation Tests for why they are exact).
Results
Example (Boolean AND over all queries). Boolean AND ranked query 185's two relevant abstracts first and second, yet its MAP over all 225 queries is almost zero: 0.010. Query 185 is one of only nine queries for which it returns anything at all. The full results:
| Model | MAP | P@10 | nDCG@10 | Queries with no results |
|---|---|---|---|---|
| Boolean AND | 0.010 | 0.006 | 0.013 | 216 |
| BIM (no relevance information) | 0.220 | 0.172 | 0.268 | 0 |
| TF-IDF (lnc.ltc) | 0.294 | 0.228 | 0.356 | 0 |
| BM25 | 0.307 | 0.234 | 0.368 | 0 |
Pairwise comparisons on average precision:
| Comparison | MAP difference | Queries better | Queries worse | $p$ |
|---|---|---|---|---|
| TF-IDF over BIM | +0.074 | 166 | 51 | < 0.001 |
| BM25 over BIM | +0.086 | 192 | 25 | < 0.001 |
| BM25 over TF-IDF | +0.012 | 129 | 84 | 0.075 |
MAP condenses each model's performance into one number. The interpolated precision-recall curves, averaged over the 225 queries, show where the differences lie (see evaluating ranked retrieval):
What the results show
Each gap in the table tests one step of the course's progression. Taking them in order:
Boolean AND fails on natural-language queries. The Cranfield queries are full questions, such as "what similarity laws must be obeyed when constructing aeroelastic models of heated high speed aircraft". After stop-word removal and stemming they still have 11.6 distinct terms on average (from 3 to 29). Requiring every one of those words to appear in a document returns nothing for 216 of the 225 queries. The nine queries that do return something are among the shortest, with four to seven terms. Between them they retrieve 20 documents. Query 185, with four terms, is one of the nine.
This is the feast-or-famine problem of the Boolean model, in its famine form. Boolean retrieval was designed for short queries carefully composed by expert searchers, not for questions in plain language. On such questions, ranked retrieval returns useful results where strict conjunction returns none.
Term frequency matters. The BIM sees only whether a term is present. TF-IDF and BM25 also count how often it occurs and correct for document length. Both beat the BIM decisively, by a third or more in MAP, and on most queries individually. This reproduces a finding from the early TREC evaluations: binary probabilistic weighting fell short of weighting that used term frequency. That shortfall was the motivation for BM25 (Robertson and Walker, 1994). Query 185 is one of the 51 queries on which TF-IDF does worse than the BIM, 0.624 to 0.659.
BM25 and TF-IDF are close. BM25 is better on average and wins on more queries, 129 to 84. But the difference in MAP, 0.012, is not significant at the 0.05 level. On a small collection of short, uniform abstracts, carefully normalized TF-IDF is a strong method. BM25's advantages, saturation and tunable length normalization, have less to work with. This experiment cannot say what happens on larger and more varied collections. Robertson and Zaragoza (2009, §3.4.3) state that the saturating function of term frequency "has frequently been shown to work better than traditional" TF-IDF weighting that is linear in term frequency.
Per-query differences
A difference of 0.012 in MAP is an average over queries that differ far more individually. On query 185, BM25 beats TF-IDF by 0.160, which is far from typical. Plotting each query's average precision under the two models shows how the average arises:
Most queries sit close to the diagonal: the two models usually rank the same documents near the top. The average is decided by a few dozen queries on which they disagree sharply, in both directions. Query 185 is one of those. Only 23 of the other 224 queries show a larger difference between the two models, in either direction.
One query, scored by each model
The sharpest disagreement shows why the two models can differ so much on one query: they add up the same evidence differently. Query 17 is BM25's largest loss against TF-IDF. It asks "can the three-dimensional problem of a transverse potential flow about a body of revolution be reduced to a two-dimensional problem". That analyzes to 14 terms, among them dimension and problem twice each. It has two relevant documents, 106 and 196. TF-IDF ranks document 106 first and has an average precision of 0.514. BM25 ranks it sixth and has 0.092. The contributions of each query term to document 106 and to BM25's first-ranked document, 1108 (not relevant), show why:
| Term | df | Doc 106 tf | Doc 1108 tf | TF-IDF, 106 | TF-IDF, 1108 | BM25, 106 | BM25, 1108 |
|---|---|---|---|---|---|---|---|
| transvers | 61 | 2 | 0.086 | 5.18 | |||
| potenti | 58 | 3 | 0.099 | 5.74 | |||
| revolut | 77 | 3 | 2 | 0.090 | 0.043 | 5.23 | 3.47 |
| bodi | 293 | 4 | 5 | 0.053 | 0.030 | 2.96 | 2.58 |
| flow | 730 | 3 | 6 | 0.020 | 0.013 | 1.18 | 1.12 |
| can | 289 | 4 | 0.029 | 2.45 | |||
| three | 140 | 2 | 0.034 | 2.76 | |||
| dimension (twice in query) | 237 | 2 | 0.034 | 4.26 | |||
| problem (twice in query) | 323 | 6 | 0.038 | 5.05 | |||
| reduc | 130 | 3 | 0.040 | 3.35 | |||
| Total | 0.347 | 0.260 | 20.28 | 25.03 |
Document 106 is a 44-token abstract that matches the query's most specific words, transverse, potential, and revolution, several times each. Document 1108 is a 170-token abstract that matches eight of the query's terms, mostly general ones such as can, three, problem, and reduce. The two models treat these differently:
- TF-IDF with cosine normalization divides by the length of the document's vector. Document 1108's long vector (length 11.5, against 6.2 for document 106) dilutes each of its matches.
- BM25 lets each matching term add its own saturated contribution. The document's length only slows each term's saturation instead of dividing the whole score. So eight moderate matches beat five strong ones. Dimension and problem also count twice, because they appear twice in the query.
Lengths and normalization are the whole difference. The two models agree on which words matter, and disagree about how to add them up. On query 173, about Lyapunov's method for linear differential equations with periodic coefficients, the opposite happens. TF-IDF ranks a short nonrelevant abstract first (average precision 0.583), while BM25 ranks both relevant documents at the top (1.000).
With swings this large on single queries, an average difference of 0.012 needs a test before it is trusted. The next section applies several.
How confident is the difference?
Example (129 wins against 84 losses). BM25 beats TF-IDF on 129 queries and loses on 84. That is not enough to conclude that its mean average precision is higher on queries like these. A count of wins ignores how large each win is, and the losses include large ones, such as query 17. (The count does show that BM25 wins more often than it loses; Problem 1 below tests exactly that.) The $p$ values above come from a paired randomization test (see significance testing). If the labels "BM25" and "TF-IDF" were arbitrary, each query's difference would be as likely to point one way as the other. So the test keeps the 225 per-query differences in average precision and, in each of 20,000 trials, flips the sign of each difference at random. In 1,495 of the trials the mean difference is at least as large in magnitude as the observed 0.0124. The observed assignment of signs counts as one more sample, so the $p$ value is $(1{,}495 + 1)/(20{,}000 + 1) = 0.075$ rather than the bare fraction of trials, which is not a valid $p$ value (Theorem 6 of the permutation tests article linked above). Other ways of asking the same question agree (Paired Comparisons of Models relates them):
- A paired $t$ test gives $t = 1.80$ with 224 degrees of freedom, $p = 0.073$.
- A bootstrap 95 percent confidence interval for the mean difference, from 10,000 resamplings of the queries, is $[-0.001, 0.026]$. It barely includes zero.
- Three comparisons were made, so the chance of at least one false positive is higher than 0.05. Holm's adjustment multiplies the smallest $p$ value by 3, the next by 2, and the largest by 1. The two comparisons with the BIM remain far below 0.05, and the closest pair stays at 0.075. No conclusion changes. (Comparing Systems Across Many Tasks compares twelve runs, these among them, at once.)
"Not significant" here means that 225 queries are not enough to distinguish a difference of this size from noise in per-query results. It does not mean the models are equivalent. The interval says the true difference on queries like these is probably between a slight loss and a gain of about 0.026.
Both BM25 and TF-IDF ran with standard settings. Tuning BM25's two parameters does not open a clearer gap, as the next section shows.
Tuning BM25
To tune the parameters fairly, the 225 queries were split at random into a development set of 112 and a test set of 113, as test collections recommends. A grid search over $k_1 \in \{0.3, 0.6, 0.9, 1.2, 1.5, 2.0, 3.0\}$ and $b \in \{0, 0.25, 0.5, 0.75, 1\}$ on the development queries chose $k_1 = 1.5$ and $b = 0.75$. (The same grid, extended and evaluated on all 225 queries, is plotted in implementing BM25. It shows a broad plateau around the defaults.)
| Development queries | Test queries | |
|---|---|---|
| Default ($k_1 = 1.2$, $b = 0.75$) | 0.316 | 0.297 |
| Tuned ($k_1 = 1.5$, $b = 0.75$) | 0.320 | 0.300 |
Tuning gained 0.004 on the queries it was tuned on and 0.003 on the unseen ones. The defaults are close to optimal for this collection. That agrees with wider experience: Robertson and Zaragoza (2009, §3.5) report that values in the ranges $1.2 < k_1 < 2$ and $0.5 < b < 0.8$ are "reasonably good in many circumstances", and the usual defaults sit at the edge of the first range and inside the second. The gain on development queries slightly exceeds the gain on test queries, the usual sign of a little overfitting.
Adding relevance information
The BIM was designed to use relevance judgments, and the comparison above denies it any. The feedback articles of this unit supply them:
- Relevance feedback used the judgments of each query's top 10 documents. It raised the BIM's effectiveness on the remaining documents by nearly half, and Rocchio feedback more than doubled that of TF-IDF.
- Pseudo-relevance feedback, which needs no judgments, raised BM25's MAP from 0.307 to 0.324 with settings fixed in advance, though it harmed 91 of the 225 queries.
Limits of the comparison
The results should be read with the limits of the experiment in mind:
- One small, old collection. Cranfield is 1,400 abstracts in one technical field, and its queries are unusually long and well formed. Results on web pages, news, or short keyword queries can differ.
- One text processing pipeline. Different stop lists, stemmers, or tokenizers would change every number, though usually not the ordering of models.
- Default settings. Each model was run largely with standard settings. A model tuned more carefully may close or widen a gap.
- Four models only. The unit's other rankers are measured on the same queries in their own articles: query likelihood, the inference network's belief function, and the proximity features of term dependence models.
- No modern methods. Learned rankers and neural models, which exceed all four on collections they are trained for, are outside this comparison. Two library articles run newer methods against this article's BM25 on the same queries. Dense Passage Retrieval runs a pretrained dense retriever, whose fusion with BM25 reaches 0.419 in nDCG@10 against BM25's 0.368. Learned Sparse Retrieval runs a pretrained SPLADE model from an ordinary inverted index.
Worked problems
These problems are posed on the experiment's own numbers, since the course text sets no exercise on a comparison of this kind. Each recomputes one figure of the article from the data behind it, and the script checks every number.
Problem 1. BM25 has the higher average precision on 129 queries, TF-IDF on 84, and 12 are tied. Test with a sign test whether BM25 wins more often than chance would give, and reconcile the answer with the randomization test's $p = 0.075$.
The sign test of significance testing drops the ties and asks how surprising 129 wins in 213 trials would be if each query were a fair coin flip. Under that hypothesis the number of wins is binomial with mean $213/2 = 106.5$ and standard deviation $\sqrt{213 \times \tfrac14} = 7.30$. The observed count is $(129 - 106.5)/7.30 = 3.08$ standard deviations above the mean. The exact two-sided probability of a split at least this uneven is $p = 0.0025$.
So the two tests disagree, and both are right, because they test different statements. The sign test establishes that BM25 beats TF-IDF on more queries than it loses. The randomization test asks whether the mean difference in average precision is distinguishable from zero, and it is not, at the 0.05 level: BM25's many wins are mostly small, and its fewer losses include large ones such as query 17's 0.422. Which statement matters depends on the use. A system judged by its average over queries is described by the second.
Problem 2. The 225 per-query differences (BM25 minus TF-IDF) have mean 0.0124 and standard deviation 0.1032. Compute the paired $t$ statistic and a 95 percent confidence interval for the mean difference, and compare the interval with the bootstrap's.
The standard error of the mean is $0.1032/\sqrt{225} = 0.1032/15 = 0.00688$. The statistic is $t = 0.0124/0.00688 = 1.80$, as reported above. With 224 degrees of freedom the two-sided 5 percent critical value is 1.97, so the interval is
$$0.0124 \pm 1.97 \times 0.00688 = 0.0124 \pm 0.0136 = [-0.001,\ 0.026].$$
The bootstrap interval, which assumes nothing about the shape of the differences, is $[-0.001, 0.026]$ as well (to four decimals, $[-0.0012, 0.0260]$ against $[-0.0012, 0.0256]$). With 225 queries the mean is close enough to normally distributed that the two methods agree, and both intervals include zero by a hair.
Problem 3. Query 17 has two relevant documents. TF-IDF ranks them 1st and 69th, and BM25 ranks them 6th and 112th. Compute the average precision of each ranking.
Average precision averages, over the relevant documents, the precision at each one's rank (Mean Average Precision). For TF-IDF the precisions are $1/1$ and $2/69$, so the average precision is $(1 + 0.0290)/2 = 0.514$. For BM25 they are $1/6$ and $2/112$, giving $(0.1667 + 0.0179)/2 = 0.092$. The difference, 0.422, comes almost entirely from the first relevant document: moving it from rank 1 to rank 6 costs $(1 - 0.1667)/2 = 0.417$. With only two relevant documents, one displacement near the top decides the query, which is how a single query can outweigh dozens of small wins in a mean.
Problem 4. Verify one cell of the query 17 table: the BM25 contribution of revolut to document 106, which has 44 tokens and contains the term 3 times. The term occurs in 77 of the 1,400 abstracts, and the average length is 111.65.
The IDF is $\ln\bigl(1 + \frac{1400 - 77 + 0.5}{77 + 0.5}\bigr) = \ln 18.08 = 2.8947$. The length factor is $K = 1.2 \times (0.25 + 0.75 \times 44/111.65) = 0.6547$, well below $k_1 = 1.2$ because the abstract is short. The term frequency part is $\frac{2.2 \times 3}{3 + 0.6547} = 1.8059$, and the contribution is $2.8947 \times 1.8059 = 5.23$, as in the table. The same term in document 1108, with 2 occurrences in 170 tokens, earns 3.47: fewer occurrences, in a longer document.
What we have learned
Within those limits, the experiment shows each step of the course's progression doing what it was designed to do. Ranking answers the questions that strict Boolean matching cannot: Boolean AND returned nothing for 216 of the 225 queries. Term frequency and length normalization improve on binary weighting, by a third or more in MAP. BM25 with default settings matches or slightly exceeds standard TF-IDF weighting without needing relevance information, though 225 queries cannot show that its 0.012 lead is real. Query 185 followed the same path, from two Boolean matches to an average precision of 0.784 under BM25.
The comparison treated the models as rivals, and chose one. The per-query differences suggest another use: models that fail on different queries can be combined. Rank fusion establishes how several rankings are merged into one, and measures on the same 225 queries whether the merged ranking beats its best input. Hybrid Retrieval takes the same question to a lexical ranker paired with a dense retriever, whose wrong answers overlap far less with BM25's.
References
- Cleverdon, C. W. (1967). The Cranfield tests on index language devices. Aslib Proceedings, 19(6), 173–194. record · 11 pages
- MacAvaney, S., Yates, A., Feldman, S., Downey, D., Cohan, A., and Goharian, N. (2021). Simplified data wrangling with ir_datasets. In Proceedings of SIGIR 2021, 2429–2436. record · 2 pages
- Manning, C. D., Raghavan, P., and Schütze, H. (2008). Introduction to Information Retrieval, chapters 6, 8, and 11. Cambridge University Press. record · 102 pages
- Robertson, S. E., and Walker, S. (1994). Some simple effective approximations to the 2-Poisson model for probabilistic weighted retrieval. In Proceedings of SIGIR 1994, 232–241. record · 4 pages
- Robertson, S., and Zaragoza, H. (2009). The probabilistic relevance framework: BM25 and beyond. Foundations and Trends in Information Retrieval, 3(4), 333–389. record · 8 pages
Reviewed: verified, 16 Nov 2026 · citations checked, 16 Nov 2026 · editorial review, 23 Nov 2026 · 11 revisions