Why AI Needs Evaluation

Updated · 4 min read
mediumPython 3.13aievaluationtestingqualitymetrics

Evaluation is measuring how well an AI application does its job, on many realistic cases, in a way you can repeat. A demo shows the app working once, on questions its builder chose; evaluation shows how often it works, on questions real people ask, and whether a change made it better or worse.

AI apps need this more than ordinary software because their output varies: a prompt tweak that fixes one answer can quietly break ten others.

Demo vs Evaluation

Three good answers prove little; fifty measured answers prove a lot
DemoEvaluation
QuestionsA few, chosen by the builderMany, from real use, including hard ones
Result"It works"A score, plus a list of failures
RepeatableNoYes, after every change
Finds problemsRarelyThat's its purpose

What to Measure

MetricDescription
CorrectnessIt is used to check the answer is right
GroundednessIt is used to check the answer is supported by the sources, not invented
RelevanceIt is used to check the answer addresses the question asked
SafetyIt is used to check the app declines what it should and leaks nothing private
LatencyIt is used to measure how long people wait
CostIt is used to measure what each answer costs

Three Ways to Measure

MethodDescriptionBest for
Code checksIt is used to test answers automatically with rules, such as "contains $45"Facts, formats, declines
Model-graded checksIt is used to have a model grade answers against a rubricOpen-ended answers rules can't judge
Human reviewIt is used to have people rate answersQuality, tone, and checking the other two

Common Mistakes

Testing only questions you wrote. Add real questions from users, especially ones that failed.

One overall number. Break results down by category so a failing group can't hide.

Evaluating once. Every change can break something; evaluate every time.

Interview Corner

Why isn't a successful demo enough for an AI application?

A demo shows a few chosen cases once; AI output varies across inputs and changes. Only a repeatable evaluation on many realistic cases shows how often the app works and whether changes help.

Which metrics matter for evaluating a RAG assistant?

Correctness, groundedness, relevance, safety (including correct refusals), latency and cost, broken down by type of question.

Practice

Exercise: list your cases. For an AI feature you'd like to build, write ten test questions: six typical, two tricky, and two it should refuse. For each, write what a correct answer must contain or do.

Check your understanding:

  1. What does an evaluation show that a demo doesn't?
  2. What is groundedness?
  3. When should the evaluation run?

Quick check: why AI needs evaluation

4 questions
1What did Campus Helper score on the 50-question evaluation?
2What does groundedness check?
3Which method suits open-ended answers rules can't judge?
4When should you rerun the evaluation?

Key Takeaways

Quick reference

NeedMethod
Exact factsCode checks
Open-ended qualityModel-graded checks
Ground truthHuman review
Catch regressionsRerun after every change

Was this tutorial helpful?

Lesson 109 of 186