The smallest eval that is still real
Every evaluation, however fancy, is the same three moves: take questions whose right answer you already know (a golden set), run the system, and compare. The rest of the track adds better questions, better metrics, and automation - but this loop is the whole idea. We build it today over Recall, the RAG assistant from the RAG course, and we make the score move in your browser before a line of Python.
Golden set, run, compare 7 min live
A golden set is a list of questions paired with the answer (or the document) that should come back. You run the system on each question and check whether it got the right one. Count the hits and you have a metric. That is evaluation, stripped to its bones.
LiveWhat makes a set "golden"3 min▶
Golden just means "we agreed on the right answer in advance". For a retriever, the right answer is usually "which document should come back for this question". Our golden set has twelve questions across Recall's three corpora, each tagged with the one chunk that should rank first.
- Known answers are the whole point. Without a right answer to compare against, you are back to vibes. The golden set is where human judgment gets captured once, so the machine can check against it forever.
- Small but representative beats big but skewed. Twelve honest, varied questions teach you more than a thousand near-duplicates. Session b2 is entirely about building these well.
- It doubles as a regression net. Once the set exists, every future change gets re-scored against it automatically. Today's twelve questions are the seed of the CI gate in b8.
LiveHit Rate and MRR, without the jargon3 min▶
Two metrics answer the two questions you actually have about a retriever: did the right document come back at all, and how high did it rank?
- Hit Rate@k = the fraction of questions where the right document showed up in the top k results. "@3" means "somewhere in the top 3". It answers did we find it.
- MRR (Mean Reciprocal Rank) = the average of 1 divided by the rank of the right document. Right answer at position 1 scores 1.0; at position 2, 0.5; at position 3, 0.33. It answers how high did it rank - and only the first correct hit counts.
- Rank over threshold. Early on, trust the ranking (and these rank-based metrics) more than any absolute similarity score, which drifts by model.
Watch the score move 8 min live
Numbers on a slide are forgettable; a number you can move is not. Below is a real evaluation running in your browser - twelve golden questions against Recall's retriever. Change k and watch Hit Rate climb, MRR hold steady (it does not care about k past the first hit), and the misses turn to hits.
Live★ Build-along: your first scorecard6 min▶
Click k=1, then k=3, then k=5. Watch Hit Rate rise as the net widens, watch which questions flip from miss to hit, and notice Precision@1 (right answer ranked first) stay put - because widening k cannot change what is already at position 1.
Read the table underneath the bars: each row is a golden question, its expected chunk, what actually ranked first, the rank the right answer landed at, and whether that counts as a hit at the current k. That table is a bug report and a to-do list in one - every miss is a retrieval improvement waiting to happen.
Self-studyThe same numbers in Python4 min read▶
Outside the browser the loop is identical: for each golden question, retrieve, find the rank of the expected id, and roll up. Here it is from scratch, then the one-liner the ecosystem gives you.
And with LlamaIndex, the same metrics come from a built-in evaluator - you supply the golden set and it reports hit rate and MRR (plus precision, recall, NDCG) for you.
Read the scorecard like a to-do list ★ 10 min · the scorecard above
A scorecard is only useful if it changes what you do next. Mine the one above for actions.
Find the misses. At k=1, note every question whose right answer was not ranked first. Write down what actually came back instead.
Diagnose one. Pick a miss and read the expected chunk. Why did the retriever prefer something else - shared words with a wrong chunk, a vague question, a genuinely ambiguous case? This instinct is the whole of retrieval tuning.
Watch MRR vs Hit Rate. Note a question that is a "hit" at k=5 but ranked 5th. Hit Rate calls it a win; MRR barely rewards it. Which metric would you trust for a system that only shows users the top result?
Reflect. In one line: is this retriever good enough to ship for a support bot that shows one answer? Your k=1 Precision is the number that decides.
Before session b2 ◐ 40 min total
- Implement the from-scratch
evaluate()on any retriever you have (or a toy one over five documents) and confirm Hit Rate@1 ≤ Hit Rate@3 always holds. - Add one deliberately hard golden question where the right answer shares no keywords with the query, and watch it drag MRR down.
- Write down three real questions your own system gets, with the answer you wish it gave - your first golden entries for b2.
- Read: LlamaIndex's retrieval evaluation guide and the Wikipedia entry on Mean Reciprocal Rank.
Official sources covered
Taught from official docs. This page covers ~80% of their working content on first-metric retrieval evaluation - the rest (hosted runners, full metric suites) lands in later sessions.
Three questions before you go 🎯 ◐ 90 seconds
1 · A "golden set" is...
Golden means the right answer was agreed in advance, so the machine can check against it forever. Without known answers you are back to vibes.
2 · The right answer is retrieved at rank 2. Its contribution to MRR is...
MRR uses 1/rank of the first correct hit. Rank 2 gives 0.5; rank 1 gives 1.0; never found gives 0. Only the first hit counts.
3 · Widening k from 1 to 5 can raise Hit Rate but leaves Precision@1 unchanged because...
Hit Rate@k counts a hit anywhere in the top k, so a bigger k finds more. Precision@1 only cares about position 1, which widening k cannot alter.