In a traditional backend service, you can often check correctness with automated tests. If a function should return 42 and it does, the test passes. GenAI systems are harder to evaluate because there often isn't one correct answer. Ask the same question twice, and the model may give two different but equally valid responses. A small change to the system prompt can also improve some answers while making others worse.
Evaluation helps you understand these changes. Without it, you can't confidently compare models, tell whether a retrieval change improved answer quality, or catch quality problems developing in production.
In this chapter, we'll cover how to build evaluation datasets, grade open-ended responses, evaluate RAG systems and agents, and use evaluations as regression tests.