Recall@K and Precision@K
In this article
- Compute Recall@K and Precision@K for questions that have one or several relevant passages, and say what each one divides by.
- Average both over a set of cases, leaving out the cases that have no relevant passage and reporting them apart.
- Explain why a missing label lowers both scores, and check label coverage before you blame the retriever.
- Choose K from what the next stage actually reads.
- Terms defined here: Precision@K.
Overview
Your search step returns three passages for every question. You want to know two things: did the passages that hold the answer get through, and how much of what got through was useful? Those questions divide by different things. Get the division wrong and a perfect search looks mediocre, or a broken one looks fine.
Here the setting is invented: Brightline, a home-internet provider, runs a support assistant that puts the three best-matching pieces of its help pages and router manuals into each request, and its team checks it against a saved set of 60 questions. You will compute the two standard retrieval scores by hand and in 25 lines of Python, average them the right way, and watch both scores move while the search itself stays exactly the same.
Sign in to keep reading
The rest of this article opens with an account. An account also keeps your progress and quiz results on every device, and lets you follow news for up to five topics.
Still to read in this article
- Two questions, two denominators
- Several relevant passages
- Averaging over cases
- When the labels are incomplete
- Picking K and reading the pair
- Common mistakes
- In production
- Sources
- Check yourself, 13 questions