7.1 Evaluation Taxonomies, Metric Families & Golden Datasets
Key Takeaways
Track complementary evaluation dimensions: task correctness, grounding, tool trajectory and outcomes, latency/cost, and safety including false refusals. Set targets from the actual application requirements.
Prefer reliable programmatic assertions for mechanically testable requirements; use calibrated model grading for semantic criteria and domain experts for ambiguous or high-stakes judgments.
Stratified golden datasets must sample happy-path, boundary, multi-turn, abstention, and adversarial cases while strictly isolating few-shot prompt exemplars from held-out evaluation sets to prevent data leakage.
Version golden datasets semantically alongside prompt templates, tool schemas, and model identifiers, feeding anonymized production failures continuously into regression suites.
Evaluation Taxonomies, Metric Families & Golden Datasets
Core Principle: Ad-hoc manual spot-checks fail silently as prompts, tools, and model checkpoints evolve. Production-ready Claude architectures treat evaluation as a layered automated test suite—combining deterministic assertions, calibrated model-based grading, and stratified, versioned golden datasets.
Five Complementary Metric Families
Measuring only final-answer "quality" hides regressions in cost, compliance, or execution reliability. Enterprise architects track complementary metric families across release gates so improvements in one dimension cannot silently degrade another.
| Metric Family | Concrete Signals & Metrics | Illustrative project-specific target | Primary Grader |
|---|---|---|---|
| 1. Task Accuracy & Schema Validity | Exact match on IDs/enums, JSON Schema conformance, unit-test pass rate | 99.5%+ schema validity; task-specific accuracy SLA | Programmatic assertions |
| 2. Faithfulness & Hallucination Rate | Claim-level grounding against retrieved context, unsupported-claim rate, citation precision | Project-defined supported-claim threshold; review high-stakes failures | LLM-as-a-judge + NLI |
| 3. Tool-Use & Trajectory Correctness | Tool selection precision, argument validity, step-efficiency ratio, fault-recovery rate | Valid tool calls plus verified final state; no unauthorized actions | Sandbox state + trajectory grader |
| 4. Latency & Unit Cost per Task | TTFT, p50/p95/p99 end-to-end latency, TPOT, total cost per resolved ticket | p95 TTFT under 800 ms; p95 E2E under 4.5 s; unit cost ceiling | Telemetry + billing ledger |
| 5. Safety, Policy & False-Refusal Rate | PII leakage rate, policy violation rate, benign false-refusal rate | No observed critical leaks in test set; project-defined false-refusal limit | Policy classifier + red-team suite |
These are illustrative metrics and example thresholds, not Anthropic benchmarks or guarantees. Set acceptance criteria according to user needs, risk and representative measurements.
Interpreting Trade-Offs Across Families
In a hypothetical release, a prompt refactor that raises Faithfulness from 92% to 97% by instructing Claude to quote full policy clauses verbatim may simultaneously double output tokens, pushing p95 end-to-end latency from 3.2 seconds to 6.1 seconds and raising unit cost per task by 45%. Similarly, tightening system-prompt guardrails to eliminate Policy Violations often spikes the False-Refusal Rate on legitimate edge queries (such as a security analyst pasting suspicious log lines). Tracking all five families on a unified scorecard forces explicit engineering trade-offs before deployment.
Programmatic vs. Model-Graded vs. Human Evaluation
Selecting the wrong evaluator tier wastes budget or introduces unnecessary variance. Architects apply a strict evaluation hierarchy: exhaust deterministic checks first, apply LLM-as-a-judge for semantic nuance, and reserve human experts for calibration and high-liability adjudication.
| Evaluator tier | Relative trade-off | Best-fit verification targets |
|---|---|---|
| Programmatic / deterministic | Typically fastest and least expensive; limited to mechanically checkable criteria | JSON Schema, exact account IDs, allowed enums, isolated unit tests and final-state checks |
| Model-graded | Scalable semantic judgments, but potentially variable and biased; calibrate against human judgments | Groundedness, tone, synthesis completeness and qualitative policy adherence |
| Human expert | Flexible domain expertise, comparatively expensive and subject to disagreement | Rubric development, ambiguous cases, calibration and high-risk adjudication |
The Fail-Fast Gating Pattern
In a CI pipeline running 1,000 test cases per pull request, invoking an LLM judge on malformed JSON wastes tokens and obscures root causes. Structure the pipeline as a cascade:
- Stage 1 — Deterministic Gate: Validate JSON Schema via Pydantic, run regex checks for forbidden PII patterns, verify exact currency amounts and record IDs, and run authorized tests in isolated, disposable fixtures. Cases failing mandatory Stage 1 checks fail immediately. You can still sample failures for diagnostic semantic grading.
- Stage 2 — Semantic Judge Gate: Pass Stage 1 survivors to calibrated LLM judges evaluating faithfulness, completeness, and policy tone.
- Stage 3 — Periodic Human Audit: Sample edge failures and representative production passes at a risk-appropriate cadence with domain experts to detect metric drift.
Derive Eval Cases from the Business Process
Start with the decision the evaluation must support. For a ticket-routing change, the desired business outcome is correct assignment with no unnecessary escalation, not generic prose quality. Sample a representative set of actual task types, with appropriate data minimization, and have domain owners label the expected routing decisions and acceptable alternatives. Check the resulting queue assignment deterministically, grade the usefulness of the summary with a calibrated rubric, measure time and cost per correctly routed ticket, and separately require authorization and safety invariants. Include missing data and ambiguous cases for which escalation is the appropriate outcome. If changing only a prompt, freeze the model and fixtures; if changing a model, evaluate the actual candidate configuration. Use the resulting evidence to make the specific release decision rather than treating the average score as a universal capability measure.
Building Stratified Golden Datasets
A golden dataset built exclusively from clean, single-turn user questions creates false confidence. Rare boundary conditions can cause costly incidents even when average accuracy looks good. Effective golden sets use stratified sampling across operational strata; an example allocation (not an official standard) is:
- Happy-Path Baseline (30%): High-frequency, well-formed queries that protect core business capabilities against regressions.
- Boundary & Edge Cases (25%): Ambiguous dates, multi-currency conversions, near-threshold limits, empty arrays, and conflicting metadata.
- Multi-Turn State Tracking (20%): Conversations spanning 4 to 10 turns where users revise constraints, correct earlier entities, or refer to prior tool outputs.
- Abstention & Unanswerable Cases (15%): Requests where the required fact is absent from retrieved documents or an upstream tool lacks authority, verifying that Claude abstains rather than fabricating.
- Adversarial & Policy-Boundary Probes (10%): Defensive safety test cases and legitimate boundary queries testing false-refusal boundaries.
Preventing Data Leakage and Dataset Overfitting
A frequent architectural failure occurs when engineers copy high-performing examples from the golden dataset into the system prompt's few-shot section, or tune prompt wording repeatedly against a single static test file. Both practices cause data leakage and eval overfitting: offline accuracy climbs toward 99% while real-world production accuracy stagnates.
Enforce three strict dataset partitions:
- Prompt Exemplar Pool: Dedicated examples approved for few-shot prompting and RAG example stores—never scored in regression runs.
- Development (Dev) Eval Set: Stratified set used during active prompt and retrieval iteration.
- Held-Out Blind Test Set: Immutable benchmark accessed only by automated release gates or rotated quarterly, reducing the opportunity to tune prompts specifically to its quirks.
Versioning and the Trace-to-Eval Flywheel
Golden datasets are code artifacts. Store them under semantic versioning (for example, eval-suite-v2.4.0) pinned in CI alongside the exact model_id, system prompt commit hash, tool definitions, and retrieval index snapshot. When production monitoring flags a hallucination or tool-loop failure, minimize and remove sensitive data as applicable, verify the expected behavior with a domain SME, and promote the trace into the next minor release of the golden dataset—turning every production incident into permanent regression coverage.
Key Exam Traps
- Relying solely on LLM judges for structured fields: Using a model judge to check whether a date format or JSON key is valid introduces latency, cost, and non-determinism where schema validation is direct and normally cheaper.
- Polluting eval sets with prompt few-shots: Reusing golden-set cases inside system-prompt exemplars inflates offline pass rates via memorization rather than generalization.
- Omitting abstention cases: A RAG evaluation suite containing only answerable queries rewards aggressive guessing and completely misses hallucination risk when retrieval returns empty or irrelevant chunks.
A fintech engineering team is building an automated CI evaluation pipeline for a Claude workflow that extracts structured loan-application fields into JSON and writes a two-paragraph underwriting rationale. Currently, they send every response directly to an LLM-as-a-judge that checks both field extraction accuracy and rationale quality in a single prompt, costing $42 per CI run and occasionally passing malformed JSON. How should the architect redesign this evaluation pipeline?
Replace all automated grading with weekly human underwriting reviews to eliminate model-judge variance.
Split the pipeline into a deterministic Stage 1 gate (JSON Schema, regex, and exact numeric/ID assertions) that fails fast before passing valid outputs to a Stage 2 LLM judge for the rationale.
Increase the LLM judge's temperature to 0.7 and run majority voting across five judge calls for every JSON field.
Move 50% of the golden dataset examples into the system prompt's few-shot section so fewer malformed JSON responses reach the judge.
An enterprise customer-support assistant powered by Claude is upgraded with stricter system-prompt instructions to prevent unauthorized refund promises. After the change, policy violations drop from 1.8% to 0%, and JSON schema validity stays at 99.9%. However, support supervisors report that customers asking legitimate questions about expired warranty options are now being turned away with generic policy refusals. Which metric family was missing from the release scorecard?
Task Accuracy & Schema Validity
Tool-Use & Trajectory Correctness
Time-to-First-Token (TTFT) and TPOT Latency
False-Refusal Rate within the Safety & Policy Compliance family
Over three months of prompt iteration, a team's offline evaluation accuracy on a 250-case golden dataset climbs from 78% to 96%. Yet when the prompt ships to production, customer satisfaction drops and hallucination tickets rise. Post-mortem inspection reveals that developers repeatedly inspected failed golden cases to write targeted prompt rules and pasted 15 challenging golden cases into the prompt's few-shot examples. What architectural safeguard should have prevented this?
Strictly separating a Prompt Exemplar Pool, an iterative Dev Eval Set, and an immutable Held-Out Blind Test Set used only for release gating.
Removing all adversarial and abstention cases from the golden dataset so prompt tuning focuses exclusively on common queries.
Using the exact same 250 cases in both training and evaluation while doubling the weight of happy-path questions.
Disabling dataset versioning so engineers always test against whatever live queries arrived in the last hour.
An architecture team is curating a 400-case stratified golden dataset for a legal contract-review RAG assistant. Which dataset composition best uncovers production failure modes before deployment?
400 single-turn happy-path contract summaries extracted from the top five most common NDA templates.
350 synthetic translations paired with 50 latency stress-test prompts containing identical text.
A stratified mix covering happy-path baselines, boundary clauses, multi-turn revisions, unanswerable abstention cases where clauses are missing, and adversarial/policy-boundary probes.
400 cases copied directly from the few-shot examples inside the production system prompt.
Sections you finish are checked off in the contents.