Evaluating AI

7. Evaluating AI#

A demo that works once is not evidence that an AI system works. This chapter shows how to define what good enough means for a business task, build a test set, measure results, and decide where human review is still required.

  • Evaluation Design: Good evaluation starts with the business task, a representative test set, and a clear standard for success.

  • Metrics: Compare systems on paired cases and check model-judge results against human verdicts.

  • Human Review: Use sampling, reviewer agreement, and controlled pilots to decide whether results justify a change.

Chapter Video

This explainer shows how one language model can score another model’s output against defined criteria.

LLM-as-a-judge: evaluating LLMs with LLMs (5:41) by Evidently AI

Hosted on YouTube; property of its original creator, embedded here for educational reference only.

Learning Objectives

By the end of this chapter, you will be able to:

  1. Define task criteria and separate mandatory checks from average scores.

  2. Distinguish representative evaluation sets from diagnostic edge cases.

  3. Compare supplied outputs using metrics, rubrics, and paired results.

  4. Design human sampling, agreement review, and escalation.

  5. Calculate quality and review diagnostics with Python.

  6. Design evaluation of financial exceptions and connect workflow results to the investment assumptions being tested.

  7. Compare model-judge verdicts with human judgments and interpret uncertainty in paired results and controlled pilots.

Chapter Flow

Concept Map

Glossary

#

Term

Explanation

1

Evaluation criterion

A stated condition used to judge a result.

2

Test set

Cases reserved for assessment under documented conditions.

3

Edge case

An unusual or boundary condition useful for diagnosis.

4

Rubric

Criteria and anchors for structured judgments.

5

Exact match

Agreement with a reference under an explicit normalization rule.

6

Paired comparison

Comparison of alternatives on the same cases.

7

Sampling

Selecting cases for review from a defined population.

8

Agreement

Consistency between judgments, which does not establish truth.

9

Escalation

Routing uncertainty or a consequential issue to an empowered reviewer.

10

Sampling frame

The cases eligible for selection into a review sample.

11

Baseline

The standard a new system must beat, usually the current process rather than the previous prompt.

12

Leakage

A test case that also appeared in material used to build the system, such as a prompt example.

13

LLM judge

A model asked to grade another model’s output against a rubric; it must itself be checked against human verdicts.

14

False accept

An output a checker passes that a trusted reviewer would fail.

15

Cohen’s kappa

Agreement between two raters corrected for the agreement expected by chance.

16

Verbosity bias

A judge’s tendency to favor longer answers regardless of support.

17

Position bias

A judge’s tendency to favor the answer shown first; tested by swapping display order.

18

Sign test

A paired test that asks whether improvements and regressions are split more unevenly than chance would produce.

19

Confidence interval

A range of true rates consistent with the observed result; wide for small samples.

20

Retrieval failure

A wrong answer whose source article was never retrieved, as distinct from a failure to use it.

21

Controlled pilot

A comparison on real work in which conditions are assigned by a rule, not by choice.