Skip to content

Free guide

Build an evaluation that can block a bad release

Turn ambiguous quality claims into labeled cases, error costs, release thresholds and a feedback loop.

Why it matters

A product manager decides which errors can harm people or operations. A developer records enough evidence to compare versions consistently and reproduce a regression.

Core concepts

Build a representative set

Include ordinary examples, rare but costly mistakes, missing information and legitimate refusals. Keep a held-out set separate from prompt development. Record the source, desired answer, acceptable alternatives and risk class. Use synthetic or properly approved data.

Separate precision from recall

Precision asks how many items marked positive were right. Recall asks how many true positives were found. With 8 correct positive predictions, 2 false positives and 4 missed positives, precision is 8/10 and recall is 8/12. Choose thresholds based on error cost and review capacity.

Evaluate uncertainty and grounding

Track unsupported claims, inappropriate actions and correct abstentions separately from overall accuracy. A model’s own confidence score can be badly calibrated. Compare it with labeled outcomes before using it to route work. Use human review for judgment calls and document disagreement.

Monitor after launch

Log model and prompt versions, relevant retrieval IDs, outcomes, latency and cost with appropriate redaction. Compare performance by important subgroups, document types and time windows. Convert new failure patterns into regression cases while preserving an independent evaluation set.

Try it step by step

  1. Write a rubric with a critical failure, a minor failure and a correct abstention. Have two reviewers grade the same ten cases.
  2. Compare your candidate and baseline on the same held-out inputs. Inspect disagreements and the worst segments.
  3. Name rollout blockers, acceptable review load, monitoring cadence and who can disable or adjust the system.

Use an evaluation card with dataset version, task, baseline, metric definitions, severe-error gate, segment results and release decision.

Worked example

Fictional example: A model labels 98 out of 100 forms correctly. The two mistakes both approve documents that require review. The aggregate score masks a critical failure category, so a release gate specific to that category is needed.

Python
true_positive, false_positive, missed_positive = 8, 2, 4
precision = true_positive / (true_positive + false_positive)
recall = true_positive / (true_positive + missed_positive)
print(f"Precision {precision:.0%}; recall {recall:.0%}")
# Precision 80%; recall 67%

Common mistake

Changing prompts against the test set until it passes, then reporting those same results as independent evidence.

Practice exercise

Run the code. Change false positives from two to six. Identify which metric moved and why. Then state whether lower precision would overload a team that reviews all positive cases.

Check your understanding

Which dataset provides the best independent release check?

  1. The examples used to refine every prompt
  2. A held-out set with known answers and costly edge cases
  3. Only the happy paths in the demo
Show answer

A held-out set with known answers and costly edge cases. Holding out cases reduces overfitting and including high-cost errors tests the release risk.

Takeaway

Name the mistake you can least afford before calculating an average.

Further reading

Browse more lessons