New Tool Radar

AI Concepts

How to Evaluate RAG Retrieval With a Small Test Set of Questions

Write questions with known answers, run retrieval, and measure whether the right chunks come back.

Schematic with three steps: Write the test set from your own; Run each question and record hits; Change one thing and re-measure.

You cannot improve what you do not measure, and retrieval quality drifts as the corpus and the questions change. The way to measure it is a held-out set of test questions with known answers: run each question through retrieval, record whether the chunk that holds the answer appears, and track the hit rate over time. Frameworks such as Ragas or TruLens can score faithfulness and answer relevance over the same set.

What you need

  • A set of test questions with known answers, drawn from your own documents
  • A RAG pipeline you can run the questions through
  • A notebook to record hit rate per run

Step 1: Write the test set from your own documents

Pick questions whose answers live in specific documents, and note which chunk holds each answer. Use real questions from users where you have them, not only easy ones.

Step 2: Run each question and record hits

Run retrieval for every question and record whether the answer chunk appears in the top results. The hit rate is the share of questions whose answer chunk was retrieved.

Step 3: Change one thing and re-measure

If the hit rate is low, change one thing, such as chunk size or the embedding model, and re-run the same set. Chunks that consistently score poorly are a signal to revisit chunk size, overlap or parser rules.

Worked example: synthetic retrieval evaluation

The table below is a synthetic example. It shows the expected result of an evaluation run; no pipeline was run.

Run Questions Answer chunk retrieved
Baseline 20 13
After chunk-size change 20 16
After re-ranker added 20 18
Hit rate now 20 18 of 20, or 90 percent

Expected result (UNTESTED). the hit rate rises from 13 of 20 to 18 of 20 after a chunk-size change and a re-ranker, measured on the same test set. This check was not run live; the table shows the expected result for the synthetic example.

Limits

  • Best practices can fail on your corpus: in one published benchmark of 156 queries, naive chunking beat context-aware chunking and dense-only beat hybrid, so measure before changing anything.
  • Track the metrics weekly; RAG quality degrades as your document corpus changes.
  • A test set built only from easy questions will flatter the pipeline; include the hard ones.
  • Retrieval hit rate is not answer quality; also score faithfulness and answer relevance.

Sources

See all