Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Eight chapters, four retrieval techniques, word overlap, embeddings, hybrid search, re-ranking, and every single time the case for “this one is better” was one or two examples: a question that failed before and passed after. That’s how this whole series has argued for each improvement, and it’s worth being honest about what that actually is: anecdote, not measurement.

This chapter builds an actual test set and measures all four techniques against it, at once, side by side. Some of what it finds is exactly what you’d expect. At least one result won’t be.

Chapter 9 of 10 · Evaluation & integration

Where we left off: Eight chapters, four retrieval techniques, and every case for “this one is better” has been one or two hand-picked examples. That’s anecdote, not measurement.

What we fix now: Build an actual labeled test set and measure all four retrieval techniques against it, at once, side by side. At least one result won’t be what you’d expect.

By the end, you can:

  • explain recall@k and why the choice of k depends on what happens downstream

  • measure multiple retrieval techniques on the same test set instead of arguing from single examples

  • trace a specific, surprising result back to its actual cause instead of just accepting the number

Source

Recall@k

Recall@k: out of every test question, what fraction had the correct chunk somewhere in the top k results? k=1 asks a strict question, was the very first result correct. Larger k is more forgiving, it credits a method for getting the right answer close to the top, not necessarily first.

A real, aggregate confirmation of the whole series’ argument so far: embeddings genuinely do better than word overlap across this test set, not just on Chapter 2’s one carefully chosen example. Now add the other two techniques.

Hybrid search is the best performer here, a real jump over plain embeddings. But look at the last line: hybrid plus re-ranking is worse than hybrid alone, not a tie, a genuine drop. That’s not what Chapter 8 would have predicted on its own, re-ranking fixed a real problem there. It’s worth actually looking at why, instead of taking the number’s word for it.

The correct answer was sitting at rank 1 after hybrid search, already right. Re-ranking then looked at just the top 3 and, using its own token-level scoring, confidently moved a different section above it. The hand-built re-ranker from Chapter 8 fixed one specific failure (dilution from averaging) but it isn’t a strictly-better general signal, it has its own blind spots, and those blind spots can demote a correct answer just as easily as they can promote one. There’s no way to know this from a single crafted example, only from measuring across many.

The story shifts at k=3: word overlap and embeddings catch up to each other, both often have the right answer nearby even when they don’t rank it first. Which k actually matters depends on what happens next in the pipeline: if only the top-1 chunk gets handed to a generation step, recall@1 is the number that matters. If the top 3 get handed over together, recall@3 is closer to the truth. There’s no single “the” accuracy number for a retrieval system, only a number for a specific k, chosen for a specific reason.

Quick check

Before moving on, answer for yourself (no peeking ahead):

  1. Why did adding re-ranking on top of hybrid search make recall@1 worse instead of better? Was Chapter 8 wrong that re-ranking helps?

Check your reasoning ▸

Chapter 8 wasn’t wrong, its example was real and correctly diagnosed, but re-ranking fixes one specific failure mode (dilution from averaging) and has its own blind spots elsewhere. On this test set, the hand-built re-ranker demoted at least one already-correct answer, showing that a fix which helps in one crafted example isn’t guaranteed to help in aggregate, exactly why this chapter measures instead of assuming.

  1. Recall@1 and recall@3 told noticeably different stories for word overlap and embeddings. Which one would you trust more if you knew the next step in the pipeline only ever looks at a single retrieved chunk?

Check your reasoning ▸

If only the top-1 chunk ever reaches the next step, recall@1 is the number that actually matters, recall@3 measures something the pipeline never uses. A good answer explicitly connects the right metric to what happens downstream, rather than picking whichever number looks better.

  1. This chapter’s test set has 14 questions and was written by one person. What specific kinds of mistakes could that introduce, and how would you notice them?

Check your reasoning ▸

A strong answer names concrete risks: the author’s own assumptions about what counts as “correct” could be wrong or debatable, the questions could unintentionally favor phrasing similar to the handbook’s own wording, and 14 questions is too few to catch rare failure patterns. Noticing these requires a second reviewer, a larger and more diverse set, or comparing against real user questions rather than author-invented ones.

  1. If you had to pick exactly one configuration from this chapter to ship in a real system, based purely on the recall@1 numbers, which would you pick, and what would you still want to check before trusting that choice completely?

Check your reasoning ▸

Based purely on these numbers, hybrid search alone is the strongest recall@1 performer here. A careful answer still flags what these numbers don’t cover: only 14 questions, one author’s labels, and recall@k measuring retrieval only, not whether generation and citation downstream actually use the retrieved chunk correctly.

  1. The test set includes “what department is 4477” as a trap question specifically because Chapter 7 showed embeddings failing on it. What would you expect word overlap alone to score on that specific question, and why?

Check your reasoning ▸

Word overlap should actually do reasonably well here, since “4477” is a literal, shared token between the question and the IT Support section, exactly the kind of exact-match signal word overlap is built to catch. This is a good moment to notice that no single technique is uniformly worst either: word overlap’s weakness is paraphrase, a different weakness than embeddings’ weakness on this same question.


You can now: measure retrieval techniques against an actual labeled test set instead of arguing from one example at a time, and you’ve traced a result the series’ own earlier chapters wouldn’t have predicted back to its real cause.

But one problem remains: this series has built one technique after another, but never asked what happens when you try to combine everything at once, and how many of these fixes actually survive contact with each other.

Next → Chapter 10: The Capstone