AI evaluation basics
How to measure whether an LLM feature is good enough before you ship or after you change it.
Overview
You can’t improve what you don’t measure. AI evaluation means testing your LLM feature against representative inputs with clear success criteria — the same way you’d test code.
Build a golden set
Collect 50–200 real (or realistic, anonymised) examples covering common cases and edge cases. For each, define the expected outcome: correct classification, required fields extracted, acceptable answer themes.
Metrics that matter
- Task accuracy — did it do the right thing on your golden set?
- Format compliance — valid JSON/schema when required?
- Grounding — for RAG, did the answer use retrieved sources correctly?
- Refusal behaviour — does it abstain when context is insufficient?
- Latency and cost — acceptable at expected volume?
Regression testing
Treat prompts and model versions like code: when either changes, re-run the golden set. A small accuracy drop on edge cases is often where production breaks.
LLM-as-judge (carefully)
Using a model to score another model can scale evaluation, but validate the judge against human labels first. It inherits the judge model’s biases.
Ship criteria
Define thresholds before launch: e.g. “≥95% format compliance, ≥90% human-agreed quality on sample, zero PII leakage in test set.”
Related
Last verified: August 2026. Technology and pricing change — always confirm current details with the vendor.