Evaluation in Information Retrieval
Prerequisite Knowledge
This lecture builds on the following concepts from earlier lectures. If any feel unfamiliar, review the linked notes before proceeding.
Previously Covered in This Subject
- Information need and query formulation — covered in Lecture 1 (How a Retrieval System Runs)
- What counts as relevant — covered in Lecture 1 (What Counts as Relevant and Smart)
- Term weights with TF-IDF — covered in Lecture 2 (The Vector Space Model: Weights, Angles, and Ranking)
- Cosine similarity and ranking — covered in Lecture 2 (The Vector Space Model: Weights, Angles, and Ranking)
9.1 Why Search Engines Need Evaluation
A search engine earns continued use only when its results feel worth returning to. Looks alone do not keep users. Speed helps, cost helps, but the deciding factor is whether the results match what the user hoped to find. This section sets up that motivation and names the first group of measures that let us compare one engine against another. Indexing speed, latency, cost, relevance, and user happiness form the opening ledger against which every later score is read.
Why would a user abandon a fast search tool after one try? Because speed without useful results feels empty. This section asks what makes results worth returning to.
9.1.1 Three Quantifiable System Measures
Three measures can be counted directly without asking users for opinions. The first is indexing speed. Indexing speed (how fast new material becomes searchable), measured in documents per hour or gigabytes per hour, decides coverage. The example used is simple: an engine that indexes 100 gigabytes per hour can cover far more of the web in the same time than an engine that manages only 10 gigabytes per hour. With billions of pages waiting, that gap decides coverage.
To see the gap in concrete terms, take a 1,000-gigabyte crawl. At 100 gigabytes per hour the crawl finishes in 10 hours. At 10 gigabytes per hour the same crawl needs 100 hours, which is 90 hours longer. A news-heavy collection that changes each day cannot wait 100 hours, so the slower engine serves stale answers while the faster engine stays fresh.
The second is search latency, also called turnaround time. Latency (the gap between sending a query and seeing results) breaks flow when it grows. Users prefer 50 milliseconds over 5 seconds, even though 5 seconds sounds small on its own. Waiting breaks flow, and repeated waiting pushes users away. A useful picture is a shop counter: if the shopkeeper answers at once, the line keeps moving, but if each customer waits 5 seconds extra, a queue of 100 users loses more than 8 minutes in total.
The third is cost per query. Cost per query (computation and hardware burned for one request) decides whether an engine can run at scale. Every query burns computation and hardware. If one engine answers with half the hardware of another, it is more economical to run at scale. Large web engines serve millions of queries per hour, so a small per-query saving grows into a large operational saving. For instance, saving even a fraction of a cent on each of 10 million daily queries frees budget for larger indexes or faster machines.
Three system measures that need no user opinion: indexing speed tells how much new material becomes searchable per hour, search latency tells how long one query waits for an answer, and cost per query tells how much hardware each answer burns. Together they tell whether users can be served quickly and cheaply.
These three — speed, latency, and cost — tell whether users can be served quickly and cheaply. They do not yet tell whether users are happy with what they got. That limit matters: an engine can index fast, answer in 50 milliseconds, and cost little, yet still lose users if its ranking misses the need.
Picture a chart with response time on the horizontal axis in milliseconds and share of users who stay on the page on the vertical axis. The line starts high near 50 milliseconds and bends down steeply past one or two seconds toward 5 seconds. The landmark is the drop between instant and slow: the same result set keeps users when fast and loses them when slow. The takeaway is that latency multiplies the value of relevance rather than replacing it.
Scope: Indexing speed, latency, and cost apply to any engine size, but they assume a fixed collection and a fixed query load. When the collection doubles or the query rate spikes, the same hardware gives slower latency and higher cost, so the three numbers must be read together. Assumption: Measurements assume repeated queries under similar conditions. A single fast query does not prove a fast engine.
Pitfalls: A common trap is treating low latency as proof of good results. A second trap is comparing indexing speed across different document lengths without normalizing to gigabytes or document counts. A third trap is ignoring cost: a demo that answers fast on one machine may fail when asked to serve millions of queries per hour.
Recap: System health starts with indexing speed, search latency, and cost per query, but those three cannot speak for result quality. The next step is user happiness, where relevance takes the central role and leads into benchmark design.
Web-scale engines tune all three at once: crawl bandwidth for indexing speed, caching and index layout for latency, and cluster sizing for cost per query. Those choices set the stage on which relevance scores are later compared.
9.1.2 User Happiness and the Central Role of Relevance
Once hardware and setup are strong enough, attention shifts to user happiness. Happiness depends on several factors. Latency still matters because no one likes to wait. Size of the collection matters because a larger index can answer more needs. Ease of the user interface matters because even a person with no training should be able to type and search.
The most important factor is relevance. Relevance (whether a retrieved document actually helps with the need behind the query) decides continued use. A fast engine that returns off-target documents keeps a user for one try only. After that the user learns not to trust it and moves on. Think of a vending machine that returns change in one second but gives the wrong drink: the speed is noted once, the wrong drink is remembered.
Think of relevance as a helpful neighbor test. If you ask a neighbor where to fix a bicycle tire and the neighbor answers fast but points to a bakery, you stop asking that neighbor. Speed did not help because the answer missed the need.
A concrete habit shows how demanding users are. On average, a user stays on each page of top-ranked results for only about 8 seconds. That short window leaves no room for slow or weak ranking. If the first screen does not look useful, the user leaves. This 8-second behavior is one reason ranking quality and latency are treated together when judging web search. The 8-second glance motivates latency and relevance focus: the engine has seconds, not minutes, to show something useful.
Eight-second check: Suppose two engines answer the same need. Engine A shows two useful links in the first 8 seconds. Engine B shows none in 8 seconds but shows five useful links after 60 seconds of paging. Most users keep Engine A and leave Engine B, even though Engine B found more in total. The sense-check is plain: what arrives inside the attention window counts more than what arrives after the user has gone.
Q: Why favor one search tool over another when so many tools exist, is it just the interface? A: No. Interface ease helps, but the main reason is relevance of what comes back. A tool that returns more useful material for the same need wins, even if interfaces look similar. Latency, collection size, and interface are supporting factors, while relevance decides quality.
Recap: User happiness rests on latency, collection size, interface ease, and above all relevance. Relevance decides whether fast answers are worth trusting, which is why the rest of the lecture builds fair tests and scores around it.
9.2 Fair Comparison Setup and Information Need Versus Query
Before scores can be compared, the test itself must be fair. Every engine must face the same documents, the same queries, and the same judgments. This section explains that shared setup and then draws the key line between a short query and the larger human need behind it. Benchmark collection, queries, and judgments make fair comparison possible, while the wine need-versus-query case shows why keyword overlap alone cannot stand in for relevance.
How can three engines be ranked without letting easier questions flatter the weaker one? By fixing the documents, the queries, and the relevance labels before any engine runs.
9.2.1 Benchmark Document Collection Queries and Judgments
The standard method has three fixed parts. First, fix a benchmark document collection. For example, take 100,000 documents and require engine one, engine two, and engine three to all be tested on exactly that set. Only a shared collection puts scores on a common scale.
Second, fix a benchmark set of queries. Subject matter experts help build a pool of queries, and that same pool is run on every system. Call them S1, S2, and S3 for three engines under test. Shared queries stop an engine from looking good only because it faced easier questions.
Third, fix relevance judgments. For each query and each retrieved document, someone or some agreed measure must say relevant or not relevant. Human experts can supply those labels. In class the focus is on quantifiable measures that stand in for those labels. Only after all three parts are fixed can relevance scores be compared across engines.
Fair test needs three shared parts: a benchmark document collection that every engine searches, a benchmark set of queries built with subject matter experts, and relevance judgments that mark each query-document pair as relevant or not relevant. Call the engines S1, S2, and S3 and run the same pool on each.
An everyday picture helps. Think of three runners timed on different tracks, one downhill and two uphill. The times cannot be compared. A benchmark is the shared track: same distance, same surface, same stopwatch. Only then does a faster time mean a faster runner rather than an easier track.
Shared-track check: Engine S1 scores 0.80 on 10 easy queries over 100,000 documents. Engine S2 scores 0.70 on 10 hard queries over a different 50,000 documents. The gap proves nothing about engine quality because the documents, queries, and judgments differ. Run both S1 and S2 on the same 100,000 documents, the same query pool, and the same relevance judgments, and the higher score then points to the stronger engine. Sense-check: same ground first, scores second.
Scope: The three-part setup fits batch comparison where queries are known in advance. It assumes relevance judgments stay fixed during the test. When needs drift or new documents arrive daily, the benchmark must be refreshed or scores lose meaning. Assumption: Judges apply one shared reading of each query. If judges change the reading midway, score gaps mix engine change with test change.
9.2.2 Information Need Versus Query With the Wine Example
An information need — the real question in a person's mind — is written here as . A query — the few words typed into a search box — is written here as . The two are not the same, and evaluation cares about the first, not just word overlap with the second.
where is a statement such as a full sentence, is the short typed form, each is a single query token, and is the number of tokens in the query.
The spoken description in class was: a person wants to know whether drinking red wine is more effective at reducing risk of heart attacks than white wine. That full sentence is the information need , where is a statement of the underlying need. With recent language-model tools a person might paste the whole sentence, but a classic search engine gets only a short query such as red wine, white wine, heart attack. Here the query terms are , , , , , each a single query token.
The engine returns a document , where is a retrieved item, that reads in spirit: at the heart of his speech was an attack on the wine industry lobby for downplaying the role of red and white wine in drunk driving. Every keyword matches. Overlap is close to 100 percent. Yet the document is about drunk driving and industry lobbying, while the need was about heart health and which wine helps more. So the document is not relevant.
Think of a shopping list versus a dinner plan. The list says tomatoes, cheese, basil. The plan is a vegetarian lasagna for six guests. A bag with tomato soap, cheese crackers, and basil perfume matches every word yet misses the dinner. Words matched, need missed.
The takeaway is direct: keyword overlap does not imply relevance. Matching words is not the same as satisfying the need. User happiness depends on useful information, not on shared tokens. This gap is why early keyword systems could look strong on term counts yet disappoint users, and why later models moved toward ranking by need rather than by count.
Red wine heart attack versus drunk driving: Information need asks which wine helps the heart. Query is red, wine, white, heart, attack. Returned document contains red, wine, white, heart, attack and discusses lobbying and drunk driving. Term overlap is near complete, but heart in means courage in speech and attack means verbal attack, not heart attack as illness. Relevance against is not relevant. Sense-check: shared tokens did not answer which wine helps the heart.
Q: For the wine query, is the drunk-driving document relevant since all words match? A: No. Each term red, wine, white, heart, attack appears, but the meaning misses the need. The need asks which wine helps the heart, while the document discusses lobbying and drunk driving. Relevance is judged against the information need , not against overlap with the query .
9.2.3 Why the Same Query Needs Shared Judges
The same short query can mean different things to different people, so judgments must come from a shared setup. Subject matter experts define the intended need for each benchmark query, fix the document set, and mark what counts as relevant. That shared ground lets engine one, two, and three be ranked fairly. Without it, a score difference might reflect different test conditions rather than better retrieval.
A single word shows the problem. The query python may mean a pet snake or a programming language. One judge marking snake pages relevant and another marking code pages relevant will rank the same engine differently. Fixing one reading, one collection, and one label set removes that swing.
Q: Who supplies queries for evaluation when the same query can be read in many ways? A: Subject matter experts supply and fix the query set together with the document collection and the relevance labels. With benchmarks set in advance, all engines face the same reading of each query, so score gaps reflect engine behavior rather than shifting interpretations.
Large programs follow the same habit. The Text Retrieval Conference supplies shared collections and topics, while NIST assessors supply relevance judgments, so teams compare results on common ground rather than on private tests.
Pitfalls: A frequent slip is judging relevance against the query instead of the need . A second slip is letting each engine bring its own queries or its own judges and then comparing scores. A third slip is trusting term overlap counts as relevance labels without expert checks.
Recap: Fair scores need a shared document collection, shared queries, and shared judgments, with relevance read against the information need . With that ground fixed, set-based scores for unranked retrieval can be trusted to compare S1, S2, and S3.
9.3 Unranked Evaluation With Precision Recall F-Score and Accuracy
Unranked evaluation treats retrieval as a set with no order. A document is either pulled back or not, and either relevant or not. This matches a binary model where rank one versus rank ten has no meaning yet. Ranked lists come later. Here the tools are the classic supervised-learning scores, restated in retrieval language. Precision reports quality of what came back while recall reports completeness of the catch, with the combined F-score and the accuracy warning completing the set.
If order does not count and each document is simply kept or left out, how is quality measured? By counting how many kept items were relevant and how many relevant items were kept.
9.3.1 Mapping Retrieval Onto True Positive and Related Counts
Start from the familiar two-by-two table. Rows hold actual labels, columns hold predicted labels. In retrieval language, actual true means relevant, actual false means not relevant, predicted true means retrieved, predicted false means not retrieved.
That mapping gives four counts. A true positive — a relevant document that was retrieved — is written , where is a count. A false positive — a not-relevant document that was retrieved — is written , where counts retrieved items that miss the need. A false negative — a relevant document that was missed — is written , where counts relevant items left behind. A true negative — a not-relevant document correctly left out — is written , where counts correctly ignored items.
| Predicted retrieved | Predicted not retrieved | |
|---|---|---|
| Actual relevant | : retrieved and relevant | : relevant but missed |
| Actual not relevant | : retrieved but not relevant | : not relevant and left out |
A practical tip for building the table without slips: keep rows for actual and columns for predicted every time. Then falsely predicted as positive can only sit in one cell, and the remaining off-diagonal cell must be the false negative. One student found the board layout flipped between actual and predicted, and this row-for-actual habit resolved the mismatch.
Retrieval reading of the confusion table: wherever the classic table shows true, read relevant; wherever it shows false, read not relevant; wherever it shows predicted true, read retrieved. Rows stay as actual, columns stay as predicted, so , , , keep one stable meaning.
Q: In the table on the board the not-retrieved false negatives did not seem to line up with the usual layout? A: The two axes were transposed in that drawing, with actual and predicted swapped relative to the usual habit. Keep one habit fixed: rows for actual, columns for predicted. Then a false positive is predicted positive but actually negative, and the other error must be the false negative. The habit keeps the mapping stable even when a diagram flips sides.
9.3.2 Precision as Quality and Recall as Completeness
Precision looks along the predicted column. The spoken form was: of the total predicted as true, how many were actually true. The reconstructed LaTeX is:
where is precision, counts retrieved-and-relevant, and counts retrieved-but-not-relevant. The denominator is the total retrieved set. In retrieval words: how many retrieved documents are relevant. Precision measures quality of what came back. Precision of retrieved documents uses relevant counts among retrieved items, with true positive mass in the numerator.
Recall looks along the actual row. The spoken form was: of the available actual true values, how many were predicted as true. The reconstructed LaTeX is:
where is recall, is as above, and counts relevant-but-not-retrieved. The denominator is the total relevant set in the collection. In retrieval words: how many relevant documents were retrieved. Recall measures completeness of the catch. Recall of relevant documents uses retrieved mass among relevant items, with false negative mass showing what was left behind.
Precision and recall side by side: precision divides retrieved-and-relevant by all retrieved , while recall divides the same by all relevant . One asks how clean the catch was, the other asks how complete the catch was.
A memory aid used in class: wherever the classic table shows true, read relevant; wherever it shows false, read not relevant; wherever it shows predicted true, read retrieved. That substitution turns the familiar table into the retrieval table without new memorization.
Small-number sanity run: A system retrieves 8 documents. Of those 8, 6 are relevant and 2 are not relevant, so and . The collection holds 12 relevant in total, so . Then precision is and recall is . Quality is fairly high at 75 percent, but completeness is only half. Sense-check: half the relevant set is still out of the retrieved set.
Picture precision and recall as two views of a fishing net. Precision asks what share of the net contents are keepers. Recall asks what share of the lake keepers ended in the net. A tiny net with two keepers has high precision but low recall, while a lake-wide net has high recall but low precision.
Scope: Unranked precision and recall assume binary labels and a fixed retrieved set. They ignore rank, graded usefulness, and duplicate or redundant answers. When order or partial relevance matters, ranked measures take over. Assumption: The total relevant count is known or judged well enough to trust the denominator.
9.3.3 Tradeoff and the Combined F-Score
Pushing one score up often drags the other down. Tighten retrieval to raise precision and more relevant items get left out, so recall falls. Loosen retrieval to raise recall and more off-target items slip in, so precision falls. When false negatives are tuned hard, false positives tend to rise, and the reverse holds as well.
The combined score is the harmonic mean of the two. The spoken form was: harmonic mean of precision and recall, which with a common denominator puts the product in the numerator. The reconstructed LaTeX is:
where is the balanced F-score, is precision as defined above, and is recall as defined above. The harmonic mean of precision recall gives a combined score that stays low when either input is low. If a task needs high sensitivity to relevant items, recall is weighted more. If false alarms hurt more, precision is weighted more. By default the balanced form reports overall behavior in one number that respects the tradeoff.
Why harmonic mean: the harmonic mean punishes a weak side more than a plain average. Returning every document gives recall 1 but near-zero precision, and the plain average still reads about 0.50, which misleads. The harmonic mean for that same run drops near zero, which reports the failure honestly.
Harmonic versus plain average: Take and from a return-everything run on a rare need. The plain average is . The harmonic form is . The second number near 4 percent tells the real story: near-zero precision cannot be hidden behind perfect recall. Sense-check: the low side controls the combined score.
The general weighted form lets a task tilt the balance:
where sets the tilt, values below 1 stress precision, and values above 1 stress recall. The balanced is the case .
9.3.4 Why Accuracy Alone Can Mislead With One Million Documents
Accuracy sounds like the best single number, but with skewed classes it can deceive. The worked case in class used 1,000,000 documents in total. Out of that total, 20 are relevant and 999,980 are not relevant. Here counts are exact: total , relevant , not relevant .
Now suppose a system predicts every document as not relevant. The table becomes: because no relevant document was retrieved, because nothing was retrieved at all, because all 20 relevant items were missed, and because every not-relevant item was correctly left out. Students first guessed other splits, then settled on this split by checking row and column totals against the 1,000,000 total.
Accuracy in LaTeX is:
where each symbol is the count defined above and the denominator equals . Here accuracy uses true negatives and total documents in one ratio. Substitution gives:
which equals about 99.998 percent, reported in class as 99.99 percent. Yet the engine retrieved zero relevant documents. The user received nothing useful. The model learned nothing; it only exploited the imbalance between 20 and 999,980. Precision for this run is , which is undefined and treated as 0 for reporting, while recall is . Ninety nine percent accuracy pairs with total retrieval failure.
One million documents accuracy trap with 20 relevant: Total , relevant 20, not relevant 999,980. Predict all not relevant, so , , , . Accuracy is , yet precision is 0 and recall is 0 and is 0. Sense-check: a score near 100 percent that helps no user cannot be trusted alone.
The lesson is pointed: never trust accuracy alone in retrieval or in any skewed supervised task. Always ask for precision, recall, and the combined score alongside it. Papers that report only accuracy on skewed collections should prompt a check for the other measures before trusting the claim.
Q: What are the table values when all one million documents are predicted not relevant? A: True positives are 0 and false positives are 0 since nothing was retrieved. False negatives are 20 since all relevant items were missed. True negatives are 999,980. Accuracy is then 999,980 divided by 1,000,000, about 99.99 percent, even though zero relevant documents reached the user.
Pitfalls: Treating accuracy as a relevance score on skewed data is the main trap. A second trap is swapping rows and columns when building the table under time pressure. A third trap is reading as a plain average and missing how strongly a low precision or low recall pulls it down.
Exam note: Be ready to map any confusion table into retrieved versus relevant in seconds, using rows for actual and columns for predicted, and to build the one-million-document cross-tab that shows why high accuracy can pair with zero retrieved relevant items.
Recap: Precision reports quality of what came back while recall reports completeness of the catch, and the harmonic keeps both honest. With set-based scoring firm, the next step adds rank order and curves.
9.4 Ranked Lists Precision-Recall Curves and Interpolated Precision
Real engines return ranked lists as in web search, with rank one, rank two, rank three, and so on. Users scan from the top, so evaluation must respect order. This section moves from set-based scores to rank-aware curves and shows how to smooth them for fair visual comparison. Ranked curve precision uses sawtooth recall behavior that interpolated smoothing then calms.
Why is a whole-list score not enough when users rarely leave page one? Because a relevant item at rank 2 and the same item at rank 80 feel very different to the reader.
9.4.1 From Unranked Sets to Rank-Aware Scoring
Classic precision, recall, and F-score look at the whole retrieved set at once. Rank-aware scoring instead asks at each cutoff , where is a rank position such as 1, 2, 3, and onward: what are precision and recall among the top only. That family includes precision at , mean average precision, mean reciprocal rank for binary relevance with two states relevant or not relevant, and normalized discounted cumulative gain for graded relevance with levels such as not relevant, fairly relevant, good, and excellent.
Binary relevance keeps two states. Graded relevance allows many levels. Both appear in practice because some needs accept partial matches while others need a single right answer. The next subsections build the curve machinery that binary ranked measures share.
Rank-aware idea: fix a cutoff , keep only the top items, and compute precision and recall inside that prefix. Slide from 1 through the list and plot the pairs. Order now matters because early misses lower every early prefix score.
Think of reading a ranked list as climbing stairs with a basket. Each step adds one document to the basket. Precision asks how full of keepers the basket is at that step, while recall asks how many of all keepers in the building are already in the basket. The basket view makes clear why scores change at each rank.
9.4.2 Precision-Recall Curve at Each Rank With a Four-Document Walkthrough
For one query, compute precision and recall at cutoff one, then top two, then top three, and so on, and plot precision against recall. Each engine then owns one curve. A stronger engine sits closer to the upper right, where both precision and recall stay high together. With only two engines a glance can decide, but with ten or more engines overlapping curves become hard to read, which motivates numeric summaries later.
The toy walkthrough used four documents in rank order, labeled A, B, C, D. Labels in class were A relevant, B not relevant, C relevant, and the last item relevant. At only the top item counts. Precision is 1 out of 1, which is 1. Recall was reported as 1 out of 4, which is 0.25. The spoken accounting treated the denominator as 4 in this walkthrough, so the numbers below keep that accounting exactly as given.
At the top two are considered. One of two is relevant, so precision is 1 out of 2, which is 0.5. Recall stays 1 out of 4, which is 0.25, since no new relevant item entered. At two of three are relevant, so precision is 2 out of 3, about 0.667. Recall becomes 2 out of 4, which is 0.5. At three of four are relevant, so precision is 3 out of 4, which is 0.75, and recall is 3 out of 4, which is 0.75.
Four-document ranked precision recall sawtooth walkthrough: Order is relevant, not relevant, relevant, relevant. At , precision and recall . At , precision and recall . At , precision and recall . At , precision and recall . Plotted points are , , , . Sense-check: recall never fell while precision dipped at the not-relevant rank and rose again after.
Plotted across cutoffs, precision jumps up and down while recall climbs and never falls. That up-and-down shape is the sawtooth, also called jigsaw, pattern. The reason is simple. When the next item at is not relevant, recall stays flat but precision drops because the denominator grew without a new hit. When the next item is relevant, both can rise. So precision creates the teeth, while recall is monotone increasing as more of the list is included. Precision teeth with flat recall at dead ranks explain the jagged line.
Picture recall on the horizontal axis from 0 to 1 and precision on the vertical axis from 0 to 1. The raw line starts high on the left, drops straight down at fixed recall when a miss arrives, then jumps up and right when a hit arrives. Landmarks are the vertical drops at dead ranks and the rising jumps at hits. The takeaway is that the raw shape is honest but hard to read across engines.
Q: What causes the sawtooth ups and downs, precision or recall? A: Precision causes the teeth. Recall only stays flat or rises as grows, since more of the list can only add relevant items or leave the count unchanged. Precision falls when a non-relevant item enters the top and rises again when the next relevant item arrives, which draws the jagged line.
9.4.3 Interpolated Precision for Smooth Comparison
Jagged curves are hard to compare, so each recall level is replaced by the best precision at or beyond it. The spoken form was: at each recall take the maximum precision over all ranks with recall at least that large. The reconstructed LaTeX is:
where is interpolated precision at recall , is measured precision at a recall from the raw curve, and the maximum runs over all greater than or equal to . The interpolated precision maximum recall envelope smooths teeth by carrying the best later value backward. Bounds not stated beyond the observed curve are handled by carrying forward the available maximum, as in the examples below.
Interpolated precision in words: look to the right of recall on the graph, find the tallest raw precision at or past , and report that height at . Dips are lifted to the envelope, so the line can only stay flat or fall as recall grows.
A small illustration from class used recall points 0.25, 0.4, 0.55, 0.8, and 1.0. At recall 0.25 the maximum over all later precisions is 1, so the interpolated value is 1. At recall 0.4 the later maximum is 0.8, even though the raw value near 0.4 was about 0.6, because the higher 0.8 occurs later and the goal is a smooth envelope rather than the dip. At recall 0.55 the later maximum among the remaining points is again 0.8, since the top two points are now ignored and the best of the rest rules. At recall 0.8 with fewer points left the value follows the remaining maximum, and at recall 1 the last point closes the curve. The result is a decreasing smooth line that is far easier to compare across engines than the raw teeth. No quantifiable single number comes out yet; the gain at this stage is visual comparability, with numbers to follow.
Envelope arithmetic on five points: Raw pairs are , , , , . Then , , , , . The raw dip 0.60 at 0.40 is lifted to 0.80 by the later peak. Sense-check: the smoothed line never rises when moving right.
Scope: Interpolation assumes a user would read a little further to reach a higher-precision prefix. That fits recall-oriented reading but overstates patience of first-page-only users. Assumption: Recall denominators are known and fixed per query. If relevant counts are pooled or incomplete, recall levels shift and envelopes move with them.
Pitfalls: A common slip is taking the max over past recalls instead of future recalls, which builds the wrong envelope. A second slip is reading a smoothed high value as if it were measured at that exact rank. A third slip is comparing raw and smoothed curves across engines as if they shared one scale.
Recap: Ranked scoring plots precision against recall at each cutoff, precision teeth explain the sawtooth while recall stays flat or rises, and the max-over-future envelope gives smooth interpolated precision for fair visual reads. Fixed recall levels and averaging come next.
9.5 Eleven-Point Interpolated Average Precision and the TREC Benchmark
Even smoothed curves are awkward when many engines or many queries are involved. The eleven-point method fixes a shared x-axis so curves can be averaged and overlaid fairly. This section explains the eleven levels, the mapping rule, and the large benchmark where the average is taken. Eleven point average fixed recall levels turn many jagged runs into one comparable line.
How can fifty different queries with different recall steps share one graph? By sampling each smoothed curve at the same eleven recall marks and averaging mark by mark.
9.5.1 Eleven Fixed Recall Levels and the Averaging Idea
Researchers fixed eleven recall levels from 0 to 1 in steps of 0.1. In symbols the set is , where each is a standard recall level and the step is 0.1, giving 11 points in total. For each level, bring the interpolated precision and plot it. For many queries, take the arithmetic mean at each level across queries and plot that mean curve. That mean curve is the eleven-point interpolated average precision picture for the engine.
where is the eleven-point value at standard recall for one query, is the smoothed precision from the prior section, is the number of queries, and is the mean across queries at that fixed level.
The Text Retrieval Conference — a large evaluation program co-sponsored by NIST, the national standards body, and started in 1992 to support large-scale text retrieval experiments — supplies the kind of shared infrastructure this needs. The plot discussed in class showed such a curve for 50 different queries on one system of that family. Each query first yields its own precision-recall behavior, then the 50 are averaged level by level. The x-axis never moves since it is always the same eleven points; only the averaged precisions on the y-axis change. That shared scale is what makes cross-engine comparison fair.
Why eleven fixed marks: raw recalls land anywhere, so per-query curves cannot be averaged point by point. Sampling every curve at 0.0 through 1.0 in steps of 0.1 gives eleven shared slots. Averaging inside each slot is then fair because every query contributes at the same recall.
Picture eleven vertical slots along the recall axis. Each query drops one smoothed height into each slot. The engine line joins the eleven slot means. With 50 queries the line is stable: one odd query moves a slot mean by at most one-fiftieth of its swing.
9.5.2 Mapping Raw Interpolated Values Onto the Eleven Points
Raw ranks do not land on 0.0, 0.1, and so on, so a mapping rule is needed. The rule stated in class: map every standard recall level to the nearest available recall value that is greater than or equal to it, and carry over that interpolated precision. In other words, look forward to the next real recall at or above the standard level and borrow its score.
The worked mapping used a top-10 list whose raw interpolated behavior was: at recall 0.25 the value is 1, at recall 0.5 the value is 0.67, at recall 0.75 the value is 0.6, and at recall 1.0 the value is 0.5. Note the duplicate-recall detail: when two rows share recall 0.25, both keep interpolated precision 1, because recall did not move and there is no second value to plot at the same x. Smoothing keeps one value per recall position.
Now build the eleven-point row. Recall 0 in the new table looks forward to 0.25 in the raw table and takes 1. The same holds for 0.1 and 0.2, so all three take 1, since 0.25 is the closest available value at or above them and 0.3 would already lie beyond 0.25 and cannot borrow from it. For 0.3, 0.4, and 0.5, the next available value at or above is 0.5, so all three take 0.67. For 0.6 and 0.7, the next available at or above is 0.75, so both take 0.6. For 0.8, 0.9, and 1.0, the closing value is 0.5, since 0.8 lies beyond 0.75 and must look forward to 1.0. That forward-looking maximum rule is the whole logic, repeated level by level.
Eleven point mapping raw interpolated precisions to standard recall: Raw borrowed table is , , , . The eleven-point row is 0.0 to 0.2 all 1.00, 0.3 to 0.5 all 0.67, 0.6 to 0.7 both 0.60, and 0.8 to 1.0 all 0.50. Check one slot: standard 0.3 looks forward past 0.25 to the next available 0.50 and borrows 0.67. Sense-check: each standard slot borrows from the first raw recall at or above it, never from below.
This construction is per query. With 50 queries, repeat the eleven-point row for each query and then average. For example, at recall 0 the mean is the sum of the 50 interpolated values at 0 divided by 50. If each is 1, the mean is . Do the same at 0.1 through 1.0 and plot the 11 means. That final line is the engine summary that can sit next to another engine summary on identical axes. The arithmetic mean over fifty interpolated precisions at each level is the whole averaging step.
Q: At recall 0 across 50 queries the interpolated value is 1 each time, so is the mean just 1 plus 1 up to 50 divided by 50? A: Yes. The mean at a fixed recall level is the ordinary arithmetic mean. Add the 50 per-query interpolated precisions at that level and divide by 50. The same averaging repeats at each of the eleven levels, which is why the x-axis stays fixed while the y-values become means.
Q: The left table shows 10 ranks while the right table shows 11 points, is the left K fixed at 10? A: In that example the raw list used the top 10. The right side is always 11 points by construction. If the raw list had used top 20 instead, those 20 would still be compressed onto the same 11 standard levels by the forward-looking rule. The 10-to-11 pairing in the example reflects that particular top-10 choice, not a general equality.
9.5.3 Small-Number Check of the Duplicate-Recall Rule
When recall stays at 0.25 across two rows, the interpolated precision stays at 1 for both rows rather than dropping to 0.67 on the second row. The reason is smoothing: with no movement on the x-axis there cannot be two different y-values at the same x. The maximum over all points at or beyond 0.25 is still 1, so both rows report 1. The later 0.67 belongs to recall 0.5 and only starts to apply once the standard level reaches forward to 0.5.
Duplicate recall single smoothed value envelope: Two neighboring ranks both sit at recall 0.25, with raw precisions 1.00 and 0.50. The envelope at 0.25 is for both rows. The value 0.67 tied to recall 0.50 does not leak backward into 0.25. Sense-check: one x holds one smoothed y.
Q: When recall stays the same across two rows, why not take the max that includes the lower 0.67? A: Because both rows sit at the same recall 0.25, and a single x should carry a single smoothed y. The maximum over everything at or beyond 0.25 is 1 from the first row, so the smoothed value at 0.25 remains 1. The 0.67 enters only when the standard level moves forward to where 0.5 is the next available recall.
Scope: Eleven-point averaging assumes pooled or complete judgments give stable recall denominators across 50 queries. With very few queries the means swing widely. Assumption: The forward-borrow rule is applied per query before averaging. Averaging raw recalls first and then smoothing would mix different x positions unfairly.
Pitfalls: Borrowing backward from below instead of forward from above is the main slip. A second slip is treating top-10 raw length as tied to eleven standard points. A third slip is averaging raw precisions at mismatched recalls without fixed slots.
Recap: Eleven standard recalls from 0.0 to 1.0 give a shared x-axis, forward borrowing maps each raw envelope onto those slots, duplicate recalls keep one smoothed value, and arithmetic means across queries give one comparable curve per engine. Single-number summaries for top ranks come next.
9.6 Precision at K R-Precision Average Precision and Mean Average Precision
Curves help the eye, but a single number per engine helps decisions. Users also care most about the first screen, not the whole list. This section introduces the top- family that rewards putting relevant items early, with worked numbers and a textbook exercise comparing two systems. Precision among top cutoff results, average precision over relevant positions per query, and mean average precision across queries form one ladder.
If most readers stop after ten results, should rank 80 count as much as rank 2? The top- family answers no and scores the head of the list hardest.
9.6.1 Precision at K and Its User-First Motivation
Most users look at first-page results and rarely open page two or three. After years of web use, people expect the answer within the first few clicks. None of the full-list curves isolates that habit directly. Precision at , also written , does exactly that by scoring only the top .
The spoken form was: among top results, how many are relevant. The reconstructed LaTeX is:
where is the cutoff rank and the numerator counts relevant items with rank less than or equal to . Precision among top cutoff results uses only the head of the list. For example, asks in the first 10 how many are relevant. That matches lived behavior where low-ranked items are seldom checked. Web engines tune heavily for the first page because that is where continued use is won or lost.
Precision at in one line: keep the first ranks, count relevant inside, divide by . No recall denominator is needed, which makes it easy to explain but sensitive to how many relevant items exist in total.
A five-item demo used green for relevant and red for not relevant in order. The order is relevant, not relevant, relevant, not relevant, relevant. Precision at one is 1 out of 1, which is 1. Precision at two is 1 out of 2, which is 0.5. Precision at three is 2 out of 3, about 0.667. Precision at four is 2 out of 4, which is 0.5. Precision at five is 3 out of 5, which is 0.6. If the second item had also been relevant, the top three would all be relevant and the early precisions would all be 1, which previews why averaging only at relevant positions rewards early hits.
Five item precision cutoff green relevant demo: Pattern is R, N, R, N, R. Steps are , , , , . If the run had been R, R, R, N, N, the head scores would read , which shows how early hits lift every later head average. Sense-check: a miss at rank 2 halves the score at once.
9.6.2 R-Precision When the Total Relevant Count Is Known
R-precision — precision at where is the known total number of relevant documents — fixes from knowledge rather than from habit. The spoken form was: if relevant documents exist, score only the top 4. The reconstructed LaTeX is:
where is that known relevant total. If 3 of the top 4 are relevant, the score is 3 out of 4. Use this when there is a rough prior idea of how many relevant items exist; otherwise a free such as 10 or 20 is more natural. At this cutoff precision equals recall, since both divide the same head count by the same , which is why this point is also called the break-even point.
R-precision when total relevant count is known: Suppose and the top 4 read R, N, R, N. Then 2 of 4 are relevant, so R-precision is and recall at 4 is also . A perfect run of R, R, R, R would score . Sense-check: the cutoff scales with the task instead of staying fixed at 10.
Picture two engines on the same need with . Engine A head is R, R, N, N for 0.50. Engine B head is R, N, N, N for 0.25. The gap is read in one glance without curves.
9.6.3 Average Precision Per Query and Mean Across Queries
Average precision goes one step further by rewarding early placement directly. It averages but only at positions where the item is relevant, ignoring non-relevant positions entirely. Earlier the demo scored every including even though rank two was not relevant. Average precision skips such positions.
The per-query LaTeX in class notation, with marking the relevant total, is:
where is average precision for one query, is the length of the ranked list considered, is at cutoff , equals 1 when the item at rank is relevant and 0 otherwise, and is the total number of relevant documents for that query. Average precision over relevant positions per query keeps only hits in the sum. The verbal bridge is: for every relevant document measure precision up to its rank, add those precisions, then divide by the number of relevant documents. The symbol in the board formula marks the relevant total, not a second .
The same five-item demo gives at relevant ranks one, three, and five only. At rank one precision is 1 out of 1. At rank three precision is 2 out of 3. At rank five precision is 3 out of 5. With relevant items:
which was reported as about 0.76 for that query. Step by step, the bracket sums to , divided by 3 gives about 0.756, rounded to 0.76. A two-query illustration then gave average precision 0.65 for query one and 0.25 for query two, showing how early versus late placement moves the per-query number even when totals match.
Average precision as area: is roughly the area under the raw precision-recall steps for one query. Early hits keep precision high across more recall, so area grows. Late hits add only low-precision slices, so area stays small.
Mean average precision averages those per-query values across the query set. The reconstructed LaTeX is:
where is mean average precision, is the number of queries, and is average precision for query . Mean average precision across queries gives the engine number. The words average and mean mark two stages: average within one query across its relevant positions, then mean across queries for the engine. Same documents and same queries must be used for every engine, or the means are not comparable.
Two-query MAP arithmetic: Query one has and query two has . Then . If query two improved to 0.65 through earlier placement, would rise to . Sense-check: each query weighs the same in the outer mean even when relevant counts differ.
A sharp contrast makes the intent plain. Engine A places relevant items at ranks 1, 2, 3, 4, 5. Engine B places them at ranks 20, 50, 60, 70, 80. Engine A is preferred because users meet useful items at once, while engine B buries them where few look. Higher signals relevant items consistently near the top; lower signals they exist but sit far down with high rank numbers. The board formula with the sum over relevance indicators and the outer mean over is exactly this two-stage idea written compactly. Early ranks lift average reciprocal intuition: hits near the top enter with near 1, while hits at rank 50 enter with near a small fraction.
A longer two-query table made the arithmetic concrete. Query one had relevant marks at ranks 1, 3, 6, 8, and 9. Precisions used were 1 out of 1, 2 out of 3, 3 out of 6, and onward through the later relevant ranks, summed and divided by the relevant count to form query-one average precision. Query two had its own marks with precisions 1 out of 2, 2 out of 3, 3 out of 7, and 4 out of 10, summed and divided by 4 to form query-two average precision. Students called out each fraction in turn — 1 by 2, 2 by 3, 3 by 7, 4 by 10 — and the per-query averages followed. The mean of the two per-query averages is the two-query .
Q: Can the last part about average versus mean be repeated, it feels tangled? A: Yes. Ignore the outer mean first and look at one query. At each relevant rank write , add those values, and divide by the number of relevant items for that query. That quotient is average precision, for example 0.76 for query one. Repeat for query two, query three, and so on. Then take the ordinary mean of those per-query averages. That outer mean is mean average precision for the engine, which is why the name carries both words. Average within query and mean across queries for the engine is the full habit.
9.6.4 Textbook Exercise With Systems S1 and S2
A short exercise compared two systems on one query with four relevant documents in total, so . This is the textbook exercise with systems precision comparison where early placement wins. Mean average precision for system one was 0.6, built from precisions at its relevant positions including 1 out of 4-type terms at ranks such as 1, 3, 9, and 10 as worked on the board. Mean average precision for system two was 0.492. The inference is that both return four relevant items, yet system one earns more by placing them earlier. Getting relevant items into top ranks matters most for a strong .
The rank strings in the exercise read, leftmost as top rank: System 1 as R, N, R, N, N, N, N, N, R, R and System 2 as N, R, N, N, R, R, R, N, N, N. Both return four relevant documents, yet System 1 shows them earlier with hits at 1 and 3, while System 2 waits until 2 and 5. Both return four and earlier placement gives higher score, which is the whole lesson.
R-precision on the same exercise uses directly. System one shows pattern RNRN in the top four, with 2 relevant among the first 4, so R-precision is 2 out of 4. System two shows fewer early hits with pattern NRNN-type behavior in the top four, with 1 relevant among the first 4, so R-precision is 1 out of 4. The order matches the order, with system one ahead.
Systems S1 and S2 head-to-head: With , S1 top four R, N, R, N gives R-precision and MAP 0.6, while S2 top four N, R, N, N gives R-precision and MAP 0.492. Both return four earlier-or-later relevant sets, but S1 banks two head hits against one. Sense-check: the MAP gap and the R-precision gap point the same way because both reward the head of the list.
Q: What is MAP of system one and system two, and does the gap make sense? A: System one MAP is 0.6 and system two MAP is 0.492. The gap makes sense because both return four relevant documents but system one shows them earlier. Earlier relevant ranks raise each term that enters the average, so early placement lifts and with it .
Q: With four relevant documents known, what is R-precision for each system? A: Here , so score the top four only. System one has 2 relevant in the top four, so 2 out of 4. System two has 1 relevant in the top four, so 1 out of 4. System one leads on R-precision as it did on . Top four relevant leads precision in both views.
Scope: , R-precision, , and assume binary relevance and known relevant totals per query. Unretrieved relevant items enter as zeros. When relevance is graded or only the first answer matters, graded or reciprocal scores fit better. Assumption: Cutoffs and pools are shared across engines. A top-10 cannot be set beside a top-1000 .
Pitfalls: Averaging at all ranks instead of only relevant ranks is the main slip. Dividing by retrieved count instead of relevant total is a second slip. Reading as a per-query score instead of an engine mean across queries is a third slip.
Exam note: Be ready to compute all three — , and , and R-precision — on a small rank string and to state in one line why earlier hits raise the score. Show precision-at-each-relevant-rank columns so partial steps stay checkable.
Recap: scores the head, R-precision scales the head by known , averages head precision at hits within one query, and the mean across queries gives engine . Single-answer needs call for an even sharper head score next.
9.7 Mean Reciprocal Rank for Single-Answer Needs
Some needs have only one right answer. Asking who leads a well-known company has one correct response, not a set of equally good documents. The same holds for many question-answering setups, chatbots, FAQs, and voice helpers where one short answer is expected. Scoring a full set of relevant items misses the point there. What matters is where the first correct answer lands. Reciprocal first relevant answer mean scoring fits that habit.
When only one answer counts, should ranks after the first hit add any credit? No. The user stops at the first correct line, so scoring should stop there too.
9.7.1 Reciprocal Rank and Its Mean Across Queries
The method finds the rank of the first relevant document and takes its reciprocal. The spoken form was: identify the first relevant rank, then invert it so farther answers score less. The reconstructed LaTeX is:
where is reciprocal rank for one query and is the position of the first relevant item. Across queries take the mean:
where is mean reciprocal rank, is the number of queries, and is the first-relevant rank for query . Reciprocal rank first relevant answer mean averaging is the full two-step habit: invert the first-hit rank per query, then average across the query set.
Reciprocal rank in words: a first hit at rank 1 scores 1, at rank 2 scores one half, at rank 3 scores one third, and so on. Distance from the top is punished fast because single-answer users will not page far.
The discount is steep by design. Rank one gives 1 out of 1, which is 1. Rank two gives 1 out of 2, which is 0.5. Rank five gives 1 out of 5, which is 0.2. That rapid fall matches the user cost: an answer buried fifth is far less useful when only one answer was wanted. Like other cross-engine scores, the same queries must be run everywhere before means are compared.
First-hit walkthrough: Query A returns N, R, N, N, so first relevant rank is 2 and . Query B returns N, N, N, R, so first relevant rank is 4 and . Query C returns R, N, N, N, so first relevant rank is 1 and . With , . Sense-check: one top hit lifts the mean more than two late hits combined.
A tiny demo fixed the idea. If the list starts relevant, non-relevant, non-relevant, non-relevant, the first relevant rank is 1 and the score is 1. If the relevant item slips to second, the score drops to half, so the second engine must rank below the first. Averaging those reciprocals over all queries gives the engine-level . Like precision at , average precision, and R-precision, this is a binary-relevance measure with two states, but it looks only at the first hit rather than at all hits.
Picture rank on the horizontal axis and reciprocal score on the vertical axis. The points 1, 0.5, 0.33, 0.25, 0.2 trace a curve that falls fast then flattens. The landmark is the halving from rank 1 to rank 2: one slip costs half the credit. The takeaway is that single-answer tuning lives or dies on the very first ranks.
Single-answer scoring fits who-is-leader questions, factoid help, FAQ lookup, and voice-helper prompts where users expect one spoken answer rather than a reading list. A voice helper that speaks the fifth candidate first fails even when the correct name sits second.
Scope: Reciprocal rank fits needs with one right answer or where the first good answer ends the task. It ignores recall depth and graded quality by design. Assumption: Each query has at least one relevant item in the judged pool. Queries with no judged answer need a stated rule, often scored as 0, before means are compared.
Pitfalls: Averaging ranks first and then inverting is the main slip: the mean of ranks 1 and 3 is 2, whose reciprocal is 0.5, while the correct mean of reciprocals is about 0.667. A second slip is rewarding extra hits after the first. A third slip is comparing across different query sets.
Recap: Reciprocal rank inverts the first-hit rank per query and the mean across queries gives engine . When answers admit degrees of usefulness rather than one right hit, graded discounted scoring takes over next.
9.8 Graded Relevance and Normalized Discounted Cumulative Gain
Binary labels are not enough when results can be excellent, good, fair, or not relevant. A fair item in rank one should not earn the same credit as an excellent item in rank one, and an excellent item on page five should not earn the same credit as the same item on top. Normalized discounted cumulative gain, widely used for web and learning-to-rank evaluation, handles both ideas at once. Graded excellent discount with cumulative ideal normalized ratio scoring is the core habit here.
What if an answer can be perfect, helpful, barely related, or useless? Binary right-or-wrong scoring throws away that shade, so a graded gain plus a rank discount is needed.
9.8.1 Two Guiding Ideas and the Gain Scale
Two ideas drive the design. First, highly relevant documents are more valuable than marginally relevant ones. An excellent match should contribute more gain than a fair match. Second, the usefulness of a relevant document falls as its rank drops. Users rarely open lower ranks, and even when they do they give those items less weight. A useful item seen late still counts, but it counts for less. Excellent late items earn discounted credit because attention fades down the page, which the logarithm encodes.
To make that concrete, assign graded gains. The scale used in class was excellent , good , fair , and not relevant . Here each number is the gain of the item at rank , where and onward. A top item with gain 3 contributes 3 if it sits first. The same gain placed lower must be discounted rather than discarded.
Two guiding ideas as one rule: larger gain for stronger relevance and smaller weight for deeper rank. Gain says how good the item is, discount says how far the reader must scroll, and their product says how much the placement is worth.
Think of concert seats. Excellent seats in row one are worth full price, the same excellent seats in the last row are still excellent seats but worth less because the view is distant. Grade sets the seat type, rank sets the row, and discounted gain sets the ticket value.
9.8.2 Discounted Cumulative Gain With Worked Numbers
Discounting uses the inverse of the logarithm of the rank. The spoken form was: each gain multiplied by 1 over log base 2 of rank, then added across ranks. The lecture form keeps rank one whole and discounts from rank two onward, while the compact textbook form shifts the denominator to avoid dividing by zero. Both habits give the same worked numbers when applied consistently.
The lecture shorthand writes the per-rank weight as 1 over of rank with rank one taken as undiscounted. The compact reconciled form used for scoring is:
where is discounted cumulative gain up to rank , is the graded gain at rank , and the denominator is the discount that grows with rank. Discounted cumulative gain with logarithm rank discount is the standard classroom reduction. The verbal bridge is: relevance score times 1 over log base 2 of rank, with rank-one handled as full gain since cannot divide. In class the first item kept its full gain of 3, the second used 2 times 1 over , the third used its gain times 1 over , the fourth rank used 1 over , and so on.
Notation note: texts often write the gain as over to stress excellent items even more, while the lecture uses linear values 3, 2, 1, 0 for hand arithmetic. The lecture keeps in the numerator to match the board; the exponential variant is noted as the standard text form and both share the same rank-one handling once denominators match.
Why the two writings agree can be checked line by line. Lecture shorthand says weight at rank is for with rank 1 whole. Compact form says weight is for all with no special case. In the worked lists both give weight 1 at (lecture by rule, compact since ), weight 1 at only under the lecture shorthand versus under compact, so small numeric gaps can appear if forms are mixed. The fix used throughout is to pick one form per query and use it for both actual and ideal lists, which keeps the ratio fair. Dimensional check passes since gain over a pure number stays a gain, boundary check passes since deeper ranks discount more, and spot-check at rank 4 gives weight in lecture shorthand, which halves the gain as expected.
The ten-item walkthrough assigned gains across ranks, for example document one excellent with 3, document two good with 2, document three with 3, and several zeros and lower gains after. Discounted terms were formed one by one. The third rank needed , about 1.59, so its discounted contribution was its gain divided by about 1.59, about 1.68 in the worked line. A zero gain times any discount stays zero, so not-relevant positions add nothing. Cumulative addition then ran: 3 alone, then 3 plus 2 equals 5, then 5 plus about 1.68 equals about 6.89, then plus 0 stays 6.89, then plus 0.39 reaches about 7.28, continuing to a total of about 9.61 at the end of the list. Ten item discounted cumulative gain total 9.61 is the reconciled lecture total.
Ten-item DCG build: Gains in rank order start 3, 2, 3, 0, 1, with later gains bringing the undiscounted sum to 16. Discounted steps under lecture handling are rank 1: , rank 2: for cumulative 5.00, rank 3: shown in class rounding near 1.68 to 1.89 range with cumulative near 6.89, later discounted adds reach . Undiscounted 16 versus discounted 9.61 shows the late-placement price. Sense-check: zeros add nothing at any rank.
Without discounting the same gains would have summed directly to 16 through steps like 3 plus 2 equals 5, then 8, 9, 10, 11, 12, 13, up to 16. The drop from 16 to 9.61 shows the price of placing strong gains late. That price is the point: higher ranks keep more of their gain, lower ranks keep less, which mirrors how attention fades down the page.
The logarithmic form is not arbitrary. Users are far less likely to inspect deep ranks, so weight should fall quickly at first and then more gently. An inverse-log discount captures that behavior in one simple denominator. Think of folding paper: early folds halve attention fast, later folds add less change, which is the log shape in daily form.
Scope: assumes graded gains are on a shared scale and ranks start at 1 with the stated rank-one rule. It assumes the same discount on every query. Assumption: Gains 3, 2, 1, 0 are treated as spaced steps in class arithmetic. If a task values excellent far above good, the exponential text gain fits better and must be stated.
9.8.3 Ideal Ranking and Normalization With Two Examples
Raw cannot be compared across queries with different numbers of relevant items. A query with 30 relevant documents can pile up far more gain than a query with 3, even when both engines order equally well. The fix is to divide by the best achievable score on that query. Normalized gain actual divided by ideal puts every query on a 0 to 1 scale.
Build the ideal order by sorting the same retrieved gains from large to small: all excellent 3 items first, then good 2 items, then fair 1 items, then zeros. Score that ideal list with the same discount and cumulative steps to get ideal discounted cumulative gain:
where is the ideal score and is the same cutoff. Then normalize:
where is normalized discounted cumulative gain at cutoff . Every score now lies on a 0 to 1 scale, so a three-relevant query and a thirty-relevant query can be compared fairly. Steps stay the same in both worlds: assign gains, apply discounts, take cumulative sums; only the input order changes from actual to ideal before the ratio.
Ideal sort in words: take the same multiset of gains, sort large to small with the same discount and accumulate rule, call that total , and report actual over ideal. Perfect ordering scores 1 by construction.
In the ten-item example the actual discounted cumulative values reached 3, then 5, then about 6.89, and on to 9.61, while the ideal discounted cumulative values ran higher at each point, for example about 7.89 where actual showed 6.89. Point-by-point ratios such as 3 over 3, 5 over 6, 6.89 over 7.89, and so on form the normalized curve. The same receive-discount-then-accumulate routine appears on both sides; the ratio is the only new step.
A compact top-five check used gains 2, 1, 0, 2, 0 across ranks one through five. The ideal sort of those gains is 2, 2, 1, 0, 0. Actual at 5 summed the discounted terms, including 2 at rank one, 1 times 1 over at rank two, 0 skipped, and 2 times 1 over log at rank four, for a total of 4. Ideal summed the sorted version, including 2 at rank one, 2 times log term at rank two, and 1 times 1 over log base 3 at rank three, for a total reported as 4.63. The top five normalized ratio ideal comparison gives the ratio:
about 0.86, or 86 percent. On the same documents and same top-five cutoff, 90 percent would beat this system and anything below 86 percent would lose to it. A separate four-document ground-truth table with two ranking functions and precomputed scores was left for hands-on comparison on the same principle.
Top-five NDCG arithmetic: Actual order 2, 1, 0, 2, 0 gives under lecture handling. Ideal order 2, 2, 1, 0, 0 gives . Then , about 86 percent. Swap the actual head to 2, 2, 1, 0, 0 and the ratio rises to 1.00. Sense-check: moving the second 2 from rank 4 to rank 2 lifts discounted gain because the discount shrinks.
Q: Can the ideal part be redone from the start, what do IDCG inputs look like? A: Start from actual gains such as 3, 2, 3, 2, 0, 0, 1, 2, 2, 3, 0, 1, 2, 3, 0 in retrieved order and keep them as the actual inputs. Then sort the same multiset from large to small to form the ideal order, with all 3 items first, then 2 items, then 1 items, then 0 items. Apply the same per-rank discount 1 over log base 2 of rank with rank-one kept whole, then accumulate. Discounted actual sums are and discounted ideal sums are ; actual divided by ideal is the normalized score. Sort large to small with the same discount and accumulate ratio is the whole redo.
Q: The board shows 3 times 1 over log base 2 of 1 for the first ideal item, but log of 1 is 0, so is that not infinity? A: Correct that cannot divide. In the worked numbers rank one was kept as whole gain without log division — 3 stays 3, and the log discount starts at rank two where . The compact formula encodes the same habit by shifting the denominator; the class shorthand wrote rank directly and treated rank one as a special whole-gain case. Rank one whole gain with logarithm starting at the second rank keeps the ratio unchanged once both sides share the same rank-one rule.
Scope: needs a stated cutoff and the same rank-one rule on both sides. It assumes the ideal sort uses the same gain multiset as the actual list. Assumption: Cutoff or must be fixed before comparing engines. Different cutoffs give different ratios.
Pitfalls: Dividing by zero when on queries with no relevant gains is the main trap; state a rule such as score 0 or drop the query. A second trap is mixing lecture and compact discounts between actual and ideal. A third trap is reading without its cutoff, since and differ.
Exam note: Show discount and cumulative columns for , , and at the stated cutoff and write rank-one handling assumptions in direct words. Label gain, discount, discounted gain, and cumulative sum per rank so steps stay checkable.
Recap: Graded gains value excellent above fair, log discounts value early above late, cumulative sums collect the worth, and the actual-over-ideal ratio gives comparable on a 0 to 1 scale. That closes the ranked family from curves through single numbers to graded lists.
Exam Guidance Summary
Open-book final-term access is expected, so study should stress why each operation exists and when it helps, not memorized arithmetic alone. Pre-midterm material was smaller in volume but dense with tiny details, so review those details alongside the newer ranking measures. The stated split is at most about 20 percent from pre-midterm and about 80 percent from post-midterm. The closing paper is expected to cover the full syllabus within that split.
How to study for this lecture: practice mapping tables fast, computing small-number head scores by hand, and stating rank-one and denominator choices in words. Speed with the table plus one-line reasons earns more than silent arithmetic.
Be able to map any confusion table into retrieved versus relevant in seconds, using rows for actual and columns for predicted. Expect small-number tasks on , R-precision with equal to the known relevant total, per-query average precision, two-query , reciprocal rank and , and with and at a stated cutoff such as 5. Show work in tables where ranks and gains are involved, since stepwise precision, discount, and cumulative columns make partial credit and checking far easier. Write assumptions in direct words when a denominator or rank-one rule is ambiguous, for example how rank-one discount was handled. Precision reports quality of what came back while recall reports completeness of the catch; higher means relevant items sit consistently near the top, while lower with the same count means they sit farther down.
Table habit for the exam: For rank tasks write columns rank, gain or relevance, , and running sum. For gain tasks add discount , discounted gain, and cumulative . Fill row by row, keep rank one whole, then form or from the columns. The table itself becomes the check.
Exam note: Map confusion tables with rows for actual and columns for predicted, show precision, discount, and cumulative columns at each rank, state the rank-one rule, and link higher to earlier placement in one line.
Key Industry Applications
Web search engines such as large general engines and scholarly engines are compared on shared document and query benchmarks before relevance claims are trusted. Indexing speed in gigabytes per hour, latency in milliseconds versus seconds, and hardware cost per query decide whether an engine can serve at web scale even before relevance is judged. The first-results-page habit and the roughly 8-second glance per top page explain why , R-precision, average precision, , and reward early placement. Single-answer needs such as factoid lookup, FAQ answering, chatbots, and voice helpers motivate reciprocal-rank scoring where only the first correct position matters. Multi-level judgments such as excellent, good, fair, and not relevant motivate for web and learning-to-rank evaluation where partial relevance is common. The Text Retrieval Conference program with its shared collections and query sets provides the common ground that lets different teams compare results fairly.
From lab scores to shipped systems: benchmark collections give fair ground, head-sensitive scores protect the first page, single-answer scores protect voice and FAQ flows, and graded scores protect feeds where partial matches still help.
For example, a shopping site tunes and for its first page, a help assistant tracks for one-answer prompts, and a video or news feed tracks with excellent, good, fair, and not relevant levels because near-misses still hold value. In each case the Text Retrieval Conference habit applies: fix documents, queries, and judgments first, then compare engines.
Takeaway: Industry picks the score that matches user patience: head scores for browsers, reciprocal scores for single answers, and discounted graded scores for feeds with partial relevance.
IR Lecture 9 notes · Evaluation in Information Retrieval
Sections Breakdown
Motivates evaluation with indexing speed, latency, cost, and relevance as the deciding factor for user trust.
Fixes shared collections, queries, and judgments, and separates the typed query from the underlying information need.
Maps retrieval onto the confusion table and builds precision, recall, F-score, and the one-million-document accuracy trap.
Scores ranked prefixes at each cutoff, explains the precision sawtooth, and smooths curves with interpolated precision.
Samples smoothed curves at eleven fixed recall levels and averages across queries on shared TREC ground.
Rewards early placement with head-sensitive cutoffs, per-query averages, and the engine-level mean.
Scores single-answer tasks by inverting the first-hit rank and averaging across queries.
Combines graded gains with logarithmic rank discounts and normalizes actual gain against the ideal order.
Exam Revision Notes
Below is the distilled, exam-ready core. Every entry comes from the full explanation above. Use this section for rapid review; return to the main notes when a point needs more context.
Why Search Engines Need Evaluation
Must-know: Relevance decides quality; speed, latency, cost support it.
Top pitfall: Treating low latency as proof of good results.
Self-check: Why does an 8-second glance make ranking and latency joint concerns?
Connects to: 9.2
Fair Comparison Setup and Information Need Versus Query
Must-know: Judge relevance against need I, not query overlap Q.
Top pitfall: Judging relevance by keyword overlap.
Self-check: Why is the drunk-driving wine document not relevant?
Connects to: 9.1, 9.3
Unranked Evaluation With Precision Recall F-Score and Accuracy
Must-know: Precision=TP/(TP+FP); Recall=TP/(TP+FN); F1=2PR/(P+R).
Top pitfall: Trusting accuracy alone on skewed collections.
Self-check: What are table values when all 1M docs are predicted not relevant?
Connects to: 9.4
Ranked Lists Precision-Recall Curves and Interpolated Precision
Must-know: Interpolated precision is max precision at or beyond recall R.
Top pitfall: Taking max over past recalls instead of future.
Self-check: What causes sawtooth teeth, precision or recall?
Connects to: 9.3, 9.5
Eleven-Point Interpolated Average Precision and the TREC Benchmark
Must-know: Map each standard recall to next available recall at or above it, then average.
Top pitfall: Borrowing backward instead of forward.
Self-check: Why do duplicate recalls share one smoothed value?
Connects to: 9.4, 9.6
Precision at K R-Precision Average Precision and Mean Average Precision
Must-know: AP averages P(k) at relevant ranks; MAP means AP across queries.
Top pitfall: Averaging P(k) at all ranks instead of relevant ranks.
Self-check: Why does earlier placement lift AP and MAP?
Connects to: 9.5, 9.7
Mean Reciprocal Rank for Single-Answer Needs
Must-know: RR=1/rank_first; MRR is mean of RR over queries.
Top pitfall: Averaging ranks then inverting instead of mean of reciprocals.
Self-check: What is MRR for first-hit ranks 2, 4, 1?
Connects to: 9.6, 9.8
Graded Relevance and Normalized Discounted Cumulative Gain
Must-know: DCG sums rel/log discount; NDCG=DCG/IDCG on 0-1 scale.
Top pitfall: Mixing discount forms between actual and ideal lists.
Self-check: How is rank one handled when log2(1)=0?
Connects to: 9.6
Was this lecture useful?
BitsNotes AI Assistant
Subject Notes AssistantConfigure AI Chat
Choose how to access the chatbotSigned in as
Powered by BitsNotes — 20 messages per day. No API key needed. Want unlimited access? Use "Bring Your Own Key" mode.
Sign in to use AI Chat
Get 20 free AI messages per day to ask questions about your lecture notes. Sign in with Google or GitHub — it takes 5 seconds.
Sign In to BitsNotesSwitch to "Bring Your Own Key" tab above for unlimited access with any OpenAI-compatible provider.