Generative AI · Intermediate level

Intermediate level · Module 9: Evaluating LLM and RAG Applications · Lesson 1 of 3

Evaluation Sets and Retrieval Metrics

Learners write evaluation questions with expected passages and answers, and measure whether retrieval finds the right passages.

In this lesson you will

  • Build a RAG evaluation set
  • Measure retrieval hit rate

Key concepts

question typesexpected passageshit rate at kunanswerable questionsevaluation set maintenance

The lesson

An evaluation set lists questions with the passage(s) that answer them and the key facts of a correct answer. Include several types: single-document, multi-document, numbers and tables, recently updated documents and unanswerable questions.

Retrieval hit rate at k measures how often a correct passage is among the top k retrieved. It shows whether failures come from retrieval or generation.

Keep the set under version control and add every real failure to it.

Step by step

  1. Write 40 questions across five types.
  2. Mark the expected passages.
  3. Measure hit rate at 3 and 5.
  4. Identify the weakest question type.

Practice activity

Create the project evaluation set and retrieval results.

Expected result: A balanced set with retrieval metrics by type.

Check your understanding

  1. What does hit rate at k measure?

    Show answer

    How often a correct passage is among the top k retrieved.

  2. Why include unanswerable questions?

    Show answer

    To test whether the assistant correctly declines.

Further learning

Taught live by an instructor — online or in person. Free course lessons are for self-study and do not lead to a certificate — see registration options.