We use analytics cookies.We use cookies to analyze site traffic and improve your experience.
Loading...
AI Engineering · Evals
Free preview: the first part of this 20-part lesson.
Already bought the course? Sign in to read the whole lesson.
this lesson is part of
Generative AI and Agentic AI Engineering
Unlock this lesson and the 203 other paid lessons
$35 once, by PayPal
See the Generative AI and Agentic AI courseread the rest of this lesson in
Generative AI and Agentic AI Engineering
Unlock this lesson and the 203 other paid lessons
$35 once, by PayPal
See the Generative AI and Agentic AI coursein Evals
This lesson is part of the AI Engineering course. Unlock the full course, a separate one-time payment, for lifetime access.
One-time payment by card or PayPal
Get Lifetime AccessOne-time payment: UPI, card or netbanking
Get Lifetime AccessFoundation lessons of this course are free, no payment needed. Try them now
Somebody raises k on the retriever. Recall@k improves, the change is approved, and it ships. A week later the answers are worse and nothing in the diff explains it.

Both of those numbers are from one run, on the same twenty questions and the same ranking. Neither is a mistake and neither is the whole picture.
Here is the setting, for anyone new to it. A RAG system () answers a question in two steps. First a retriever searches a collection of documents and returns the ones that look most related to the question, in order. Then a language model reads the top few of those documents and uses them to answer. The number of documents handed to the model is called k.
Choosing k looks like an easy decision. A bigger k means the right document is more likely to be somewhere in what the model sees. So teams raise k, watch the retrieval metric go up, and ship. The hidden question is whether the model can still find the right document once it is surrounded by more of the wrong ones.
In this lesson I measure both halves on the same run. The retrieval number rose from 9 of 20 questions at k of 1 to 18 of 20 at k of 20. The number of questions where the model then picked the right document peaked at 10 of 20 at k of 5 and fell to 6 of 20 at k of 20. I show where each number comes from, work the arithmetic by hand, test whether the fall is more than chance, and end with what to report so that this cannot happen to you silently.