AI Interview Handbook
CHAPTER 04PRIORITY 0

Evaluation & AI Quality Engineering

Create representative datasets, layered metrics, calibrated judges, slice analysis, regression gates, safety tests, and feedback loops.

22 min read Interview drills

Learning objectives

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

  • Translate product value and failure consequences into component, end-to-end, safety, and operational quality criteria.
  • Build a versioned, representative golden set with explicit provenance, splits, slices, and leakage controls.
  • Select deterministic checks, human review, retrieval metrics, execution checks, and calibrated model judges appropriately.
  • Diagnose changes with an error taxonomy and slice analysis rather than relying on one aggregate score.
  • Design CI release gates and online experiments that account for variability, practical significance, cost, and latency.
  • Evaluate prompt injection, sensitive-data leakage, unsafe tool use, tenant isolation, refusal, and escalation behavior.

1. Quality is a decision system, not a score

An evaluation system exists to make decisions: continue iterating, merge a change, canary it, expand rollout, roll back, investigate a slice, or escalate a risk. Start by writing the decision and the consequence of a false pass or false fail. Only then choose metrics and thresholds. A single “quality score” cannot represent correctness, evidence use, safety, latency, cost, and user value without hiding important trade-offs.

Build a quality tree

For an enterprise policy assistant, the top outcome might be “authorized users resolve policy questions accurately and quickly.” Decompose it into: relevant current evidence retrieved; answer claims supported; citations resolvable; uncertainty handled; unauthorized information never disclosed; correct escalation on ambiguous or high-risk questions; and acceptable latency/cost. Attach at least one measure and one failure example to each leaf.

CriterionMeasureDecision role
Required evidence is presentRecall@k / evidence coverageDiagnose retriever and packer
Claims follow evidenceHuman or calibrated claim-level faithfulnessGeneration quality gate
Answer resolves taskTask-specific rubric / execution successEnd-to-end comparison
Tenant boundary holdsDeterministic adversarial testNon-negotiable release blocker
User experience is timelyp50/p95/p99 end-to-end and stage latencyGuardrail / capacity decision
Economics are viableCost and tokens per successful taskRoute/rollout decision

2. Engineer the dataset before the evaluator

A golden set is a versioned collection of inputs, expected properties, metadata, and judgments. “Golden” means reviewed, traceable, and stable enough for comparison—not perfect or frozen. OpenAI recommends task-specific tests that reflect real distributions and continued human calibration; LangSmith and Langfuse both support offline-to-production feedback loops.

Four complementary sources

  1. Curated core: expert-written canonical and boundary cases.
  2. Production traces: privacy-reviewed samples of common, failed, costly, uncertain, and novel interactions.
  3. Adversarial cases: injection, leakage, malformed input, unavailable tools, contradictory sources, and no-answer examples.
  4. Synthetic expansion: reviewed, provenance-labeled paraphrases or rare combinations; supplements, not proof of representativeness.

Each record should include stable ID, input, reference evidence or expected behavior, rubric, risk, source/provenance, created/reviewed dates, language, tenant/data class, intent, difficulty, and applicable evaluators. Preserve an immutable raw trace reference separately when allowed. Redact or synthesize sensitive values before placing cases in developer-visible stores.

Split by how data can leak

Keep development examples for iteration, validation for thresholds, and a sequestered test set for final claims. Group by source document, user/thread, template, or time so near-duplicates do not cross splits. Repeated optimization makes validation data de facto training data; preserve a final untouched set.

Version everything that changes meaning

Version dataset, judgments, rubrics, corpus/parser/retrieval, prompt/model/tools, evaluators, sampling, and environment. Store hashes and a changelog. A score without dataset and evaluator versions is not reproducible evidence.

3. Match metrics to the failure boundary

Component scores localize defects; end-to-end scores reveal interactions. Retrieval recall can rise while excess context harms answers; correct tool selection can still carry invalid arguments.

Retrieval and RAG

  • Retrieval: precision@k, recall@k, MRR, nDCG, filtered slices, and evidence coverage after packing.
  • Grounding: claim-level support by retrieved evidence, citation correctness, citation completeness, and contradiction.
  • Answer: task correctness/completeness, relevance, instruction adherence, appropriate uncertainty, and abstention.

Faithfulness and correctness differ: an answer can repeat stale evidence faithfully or be correct yet unsupported. Evaluate both. Ragas exposes RAG and agent metrics, but inspect definitions, prompts, model dependence, and intermediate outputs before using any as a gate.

Agents and tool use

  • Goal/task completion and correct terminal state.
  • Tool-selection precision/recall and unnecessary-call rate.
  • Argument schema and semantic validity; authorization/policy result.
  • Trajectory efficiency: calls, retries, replans, repeated steps, tokens, and wall time.
  • Side-effect correctness, duplicate effects, recovery, and escalation.

Deterministic output checks first

Use exact match for known classifications, JSON Schema for structure, parsers/compilers for code or queries, executable tests for calculations, database comparisons for extraction, and policy engines for allowed actions. A deterministic checker is cheaper, faster, repeatable, and easier to debug than a model judge when the property is mechanically decidable.

4. Calibrate human and model judgment

Human review is nuanced but slow and variable. Model judges scale but inherit prompt sensitivity, bias, position/verbosity preferences, and domain blind spots. Prefer deterministic checks, use humans for ground truth/high-risk ambiguity, and calibrate model judges for broader coverage.

Write an operational rubric

Replace “good answer, 1–5” with observable anchors. For faithfulness, label material claims supported, contradicted, or absent from evidence. Define required and harmful task behavior, give boundary examples, and permit “insufficient information.”

Measure annotator behavior

Train reviewers on shared cases, blind variant identity, randomize order, and double-label a stratified subset. Track agreement by criterion/slice and adjudicate. Low agreement can expose training, rubric, evidence, or unsettled-requirement problems.

Calibrate an LLM judge

  1. Build a held-out, human-labeled calibration set with hard and boundary cases.
  2. Give the judge only the information the rubric requires; prevent candidate metadata from revealing the variant.
  3. Prefer categorical or pairwise decisions with explicit anchors when absolute numeric scoring is unstable.
  4. Test candidate-order reversal, verbosity, self-preference/provider, reference leakage, and prompt-injection inside the content being graded.
  5. Measure agreement, confusion matrix, false-pass rate on high-risk cases, and stability across repeated runs.
  6. Version judge model, prompt, temperature/settings, rubric, and calibration result; recalibrate after change.

Do not let the judge’s explanation substitute for correctness. Store reasoning as debugging material, not proof. If a judge is weak on a critical slice, route that slice to a deterministic check or human review. For release gates, prioritize the false-pass cost: an evaluator that misses unsafe behavior is worse than one that occasionally sends a safe run for review.

5. Turn failures into an error taxonomy

Aggregate scores show population movement; error analysis chooses the repair. Give each failure a primary stage, symptom, likely cause, consequence, and owner. Secondary tags can capture interactions.

Primary stageExample failureLikely owner or experiment
Data/parseTable row or policy exception lostParser/chunking fixture and reprocessing
RetrievalRelevant evidence absent from candidatesEmbedding, sparse route, filters, ANN depth
Ranking/packingEvidence found then dropped or truncatedFusion, reranker, dedupe, token allocation
GenerationUnsupported claim despite sufficient evidencePrompt/model/grounding control
Tool/controlWrong tool, invalid argument, repeated effectSchema, policy, state machine, idempotency
Safety/privacyInjection obeyed or cross-tenant disclosureAuthorization boundary and incident response
OperationsTimeout, cost cap, stale version, failed fallbackBudgets, capacity, recovery, routing
EvaluationLabel/rubric/judge is wrongAdjudication and evaluator recalibration

Slice before celebrating

Choose slices from risk and plausible causes: intent, language, policy regime, tenant/data class, document type, exact identifier, multi-hop, no-answer, tool, route, cohort, and age. Report counts and uncertainty; define critical slices before the experiment.

Inspect paired deltas

List paired improvements and regressions. Equal means can hide replacing harmless style errors with one security failure. Inspect largest negative deltas and every invariant violation; track severity and consequence.

6. Build release gates that tolerate variability, not regressions

CI compares immutable baseline and candidate configurations on a pinned dataset/evaluator suite. Record environment and inspectable responses when policy permits. Invalidate caches for every changed prompt, model, retrieval, or tool dimension.

def release_decision(base, candidate):
    hard_fail = any(candidate[name] != 1.0 for name in (
        "tenant_isolation", "schema_valid", "no_duplicate_effect"
    ))
    quality_drop = candidate["task_success"] < base["task_success"] - 0.02
    slow = candidate["p95_ms"] > 1.10 * base["p95_ms"]
    costly = candidate["cost_per_success"] > 1.15 * base["cost_per_success"]
    return "block" if hard_fail or quality_drop or slow or costly else "canary"

# Thresholds above are illustrative; derive real gates from product risk.

Hard invariants require every applicable case to pass. Comparative metrics need both absolute floors and allowable deltas. Critical slices need their own gates. Cost and latency are guardrails. Treat missing evaluator output as a failure or explicit “inconclusive,” never as a pass. Keep a small smoke suite on every change and a larger suite on scheduled runs or release candidates, while ensuring high-risk cases remain in the fast gate.

Account for stochastic and sampling uncertainty

Use paired comparisons and report intervals via paired bootstrap or another appropriate method; inspect discordant binary outcomes. Repeat a stratified subset to estimate variance. Never average away safety failures, and weigh practical—not only statistical—significance.

Move online carefully

Shadow, then canary or A/B test using a randomization unit that avoids contamination. Predefine outcome, guardrails, exposure, stop rules, and analysis; monitor assignment and segment regressions. Never expose an unsafe variant for statistical power.

7. Close the offline–online quality loop

Offline datasets provide controlled repeatability; production provides distribution reality. Instrument traces with application, prompt, model, retrieval, tool, evaluator, and release versions plus safe outcome metadata. Sample common traffic randomly for prevalence, and oversample rare/high-risk signals for discovery. Keep weighting clear: a risk-enriched review queue cannot estimate population quality without correcting its sampling design.

Production signals are evidence, not ground truth

Track feedback, completion, abandonment, reformulation, escalation, citations, corrections, latency, cost, and denials. Each is confounded: clicks reflect position and silence may mean abandonment. Calibrate proxies with reviewed traces.

Choose tools by data model and exit path

Tool familyStrength to investigateQuestions before adopting
Custom Python + pytestTransparent deterministic checks and CI controlWho builds dataset UI, annotation, comparison, and trace joins?
LangSmithDatasets, experiments, traces, human/code/model/pairwise evaluatorsFramework coupling, hosting/data policy, export, cost, evaluator versioning?
LangfuseTrace/observation/session scores, experiments, annotation, self-host optionDeployment operations, feature/version compatibility, retention, export?
Ragas / DeepEvalReusable RAG/agent metrics or pytest-oriented evaluation harnessDo metric definitions and judges correlate with domain humans?
Observability platformProduction tracing, sampling, drift, latency/cost dashboardsCan it represent datasets, ground truth, evaluator provenance, and CI?

Keep manifests and core evaluators portable. Export scores, case/trace references, and versions. OpenTelemetry semantics evolve and content can be sensitive; pin conventions and avoid message bodies by default.

8. Make safety and privacy executable

Build adversarial cases from actual inputs: user text, retrieval, tools, files, connectors, memory, and tenant data. Use the NIST Generative AI Profile to structure governance, then translate it into system-specific controls and tests.

Test the full threat path

  • Prompt injection: direct user instructions and indirect instructions embedded in retrieved pages, documents, tool output, or memory.
  • Sensitive information: secrets, PII, hidden prompts, credentials, and private records requested directly or inferred through side channels.
  • Tenant isolation: IDs from another tenant, mixed-index candidates, cached responses, trace views, and shared memory.
  • Unsafe tool use: unauthorized tool, excessive scope, altered action after approval, malicious URL/arguments, duplicate effect, and ambiguous timeout.
  • Policy behavior: refusal consistency, over-refusal on benign requests, safe alternatives, and correct human escalation.
  • Robustness: malformed encoding, extreme length, empty/contradictory evidence, unavailable dependencies, and partial streaming.

Measure attack success rate, sensitive-data disclosure, unauthorized-action rate, false refusal, escalation precision/recall, time to detection, and recovery behavior by attack surface. Hard security boundaries should be enforced deterministically and must pass every applicable test. Model-based red teaming can expand cases, but manually validate coverage and preserve sequestered attacks to reduce test gaming.

Protect the evaluation system itself

Datasets and traces contain revealing failures. Apply minimization, access control, encryption, retention/deletion, tenant partitioning, and audit. Treat candidate text as untrusted judge input; sandbox code evaluators with minimal permissions. Send production content externally only under an approved data contract.

Syllabus checkpoint: metric language and evaluation tooling

Faithfulness, groundedness, and relevance

Teams use these labels inconsistently, so define the rubric before quoting a score. A practical convention is: faithfulness asks whether answer claims are supported by supplied evidence; groundedness asks whether the answer is anchored to the authorized source context rather than unsupported model knowledge; relevance asks whether the response addresses the user’s actual request. Add completeness and citation correctness separately—a faithful answer can still omit the decisive exception.

Deterministic checks, probabilistic scoring, and human annotation

Use deterministic checks for schemas, required fields, citations that resolve, forbidden strings, permissions, exact calculations, and known invariants. Use probabilistic scoring for semantics that tolerate legitimate variation, but calibrate thresholds and uncertainty. Human annotation needs an operational rubric, examples near decision boundaries, blinded ordering where possible, adjudication, agreement measurement, and recorded annotator context. Sampling must represent important slices rather than only easy or recently failed cases.

Choose a platform by the evaluation loop, not the dashboard

LangSmith and Langfuse can manage traces, datasets, experiments, and feedback with different hosting and ecosystem trade-offs. RAGAS and DeepEval provide useful evaluation building blocks; custom Python harnesses remain valuable for exact product contracts. Arize Phoenix and commercial Arize capabilities add tracing/evaluation and observability workflows. OpenTelemetry supplies vendor-neutral trace context and export. Regardless of tool, require dataset, prompt, model, judge, code, and environment versions plus links from aggregate regressions to inspectable traces.

Interview playbook

Use QUALITY to answer an evaluation-system design prompt:

  1. Q — Question and consequence: Which release/product decision, and what does a false pass cost?
  2. U — User distribution: traffic, important slices, risks, and no-answer/edge behavior.
  3. A — Artifacts and annotations: dataset sources, provenance, rubric, splits, versions, and privacy.
  4. L — Layers of measures: deterministic, component, end-to-end, human, judge, safety, and operations.
  5. I — Inspect errors: paired deltas, taxonomy, severity, slices, uncertainty, and evaluator failures.
  6. T — Threshold and trial: hard invariants, regression gates, shadow/canary/A-B design, rollback.
  7. Y — Yield feedback: production sampling, adjudication, new cases, ownership, and change cadence.

Common traps

  • Choosing metrics before defining the product decision and failure cost.
  • Using one aggregate judge score with no rubric, calibration, or slice analysis.
  • Calling synthetic questions representative without validation against production.
  • Tuning prompt, threshold, and evaluator on the same test set and reporting it as generalization.
  • Allowing quality gains to compensate mathematically for security or privacy violations.
  • Comparing unpaired runs with changed corpus, parser, environment, and model all at once.
  • Treating user feedback, clicks, or judge explanations as uncontested ground truth.
  • Building dashboards without an owner, alert/action threshold, or rollback path.

Question bank

These questions test whether evaluation evidence can support a production release decision.

Q1How do you define “good” for a RAG assistant?

Strong answer outline

  1. Start from user task and failure consequences.
  2. Decompose retrieval, packing, evidence support, answer correctness, citations, abstention, safety, latency, and cost.
  3. Mark objectives, guardrails, and hard invariants separately.

Follow-up probes

  • Can a faithful answer be wrong?
  • Which metric blocks release?
Self-check

Pass if quality is a decision-linked hierarchy; fail if “accuracy and helpfulness” are the only criteria.

Q2How would you build a representative golden set?

Strong answer outline

  1. Combine curated core, privacy-reviewed production traces, adversarial cases, and reviewed synthetic expansion.
  2. Annotate provenance, risk, slices, evidence, rubric, and expected behavior.
  3. Group splits to prevent near-duplicate/source leakage and version the manifest.

Follow-up probes

  • How do you find rare failures?
  • When is a case removed?
Self-check

Pass if distribution, leakage, provenance, and maintenance are explicit; fail if size is the main quality claim.

Q3What is the difference between retrieval and generation evaluation?

Strong answer outline

  1. Retrieval asks whether judged evidence is found and ranked/packed.
  2. Generation asks whether the response uses supplied evidence correctly and completes the task.
  3. Use fixed-context and fixed-retrieval experiments to isolate failures.

Follow-up probes

  • Where do citations belong?
  • What if the model knows the correct answer without evidence?
Self-check

Pass if the boundaries and isolation tests are concrete; fail if one “RAG score” is used.

Q4When should you use an LLM as a judge?

Strong answer outline

  1. Use for semantic/subjective criteria not cheaply decidable in code and at useful scale.
  2. Define anchored rubric and calibrate against held-out human labels.
  3. Test bias/stability and route critical uncertainty to humans or deterministic controls.

Follow-up probes

  • Why might pairwise be easier?
  • How do you detect judge drift?
Self-check

Pass if judge error is measured and governed; fail if a strong model is assumed objective.

Q5How do you calibrate a model judge?

Strong answer outline

  1. Create double-reviewed held-out labels with boundary cases.
  2. Blind variant, randomize order, specify evidence/rubric, and test adversarial candidate text.
  3. Report confusion matrix, agreement, false-pass rate, repeated-run stability, and slice gaps.

Follow-up probes

  • Which threshold optimizes safety?
  • What triggers recalibration?
Self-check

Pass if calibration has a dataset and acceptance criteria; fail if prompt iteration on examples is called calibration.

Q6Why can an aggregate improvement be unsafe to ship?

Strong answer outline

  1. Averages weight severity and slices poorly and can hide invariant violations.
  2. Inspect paired regressions, critical slice gates, and error taxonomy.
  3. Give a concrete case such as cross-tenant leakage or strict-filter recall loss.

Follow-up probes

  • How do you choose critical slices?
  • What if a slice is very small?
Self-check

Pass if counts, severity, and uncertainty constrain the decision; fail if slicing is retrospective cherry-picking.

Q7Design a CI gate for a prompt or model change.

Strong answer outline

  1. Pin baseline/candidate, dataset, corpus, evaluators, versions, and environment.
  2. Run hard invariants plus overall/critical-slice floors and paired deltas; add latency/cost guardrails.
  3. Fail closed on missing critical results, publish per-case diffs, then canary if passed.

Follow-up probes

  • How do you keep CI affordable?
  • How do you handle flakiness?
Self-check

Pass if reproducibility, diagnostics, and rollout follow the score; fail if one average threshold merges all risks.

Q8How do you account for non-deterministic outputs?

Strong answer outline

  1. Use paired cases and fixed versions/settings; estimate repeat variability on a stratified subset.
  2. Report intervals and discordant cases, not only point estimates.
  3. Keep deterministic invariants and never average away catastrophic failures.

Follow-up probes

  • Should you retry a failed eval case?
  • What if provider snapshots change?
Self-check

Pass if uncertainty changes the decision procedure; fail if rerunning until green is acceptable.

Q9How do you prevent evaluation-set leakage?

Strong answer outline

  1. Group related sources/templates/users and deduplicate semantically before splitting.
  2. Separate development, validation, and sequestered test; control access.
  3. Track repeated optimization against a split and refresh/rotate when it becomes training data.

Follow-up probes

  • Can synthetic paraphrases cross splits?
  • How does corpus leakage differ?
Self-check

Pass if leakage mechanisms are domain-specific; fail if random row splitting is assumed sufficient.

Q10How would you evaluate a tool-using agent?

Strong answer outline

  1. Score outcome, correct terminal state, tool selection, arguments, authorization, side effects, and recovery.
  2. Evaluate trajectory efficiency and unnecessary/repeated calls.
  3. Inject tool errors, ambiguous writes, approval changes, and malicious results.

Follow-up probes

  • Can two different trajectories both pass?
  • How do you grade a partial success?
Self-check

Pass if trace and system effects matter beyond final prose; fail if answer relevance is the primary agent metric.

Q11What is a useful error taxonomy for RAG?

Strong answer outline

  1. Separate parse/data, retrieval, rank/pack, generation, citation, safety, operations, and evaluator errors.
  2. Assign primary cause, severity, slice, and owner.
  3. Review taxonomy coverage and merge/split labels only when actionability improves.

Follow-up probes

  • What if multiple stages contribute?
  • How does taxonomy change prioritization?
Self-check

Pass if labels route to experiments or owners; fail if categories are just “hallucination” and “bad retrieval.”

Q12How do offline and online evaluation work together?

Strong answer outline

  1. Offline provides controlled references and regression comparison.
  2. Production sampling discovers distribution shift, rare failures, and real outcomes.
  3. Adjudicated traces become versioned offline cases; offline fixes go through shadow/canary and online confirmation.

Follow-up probes

  • How do you sample without bias?
  • Which online signals are confounded?
Self-check

Pass if there is a closed, privacy-reviewed loop; fail if monitoring is called evaluation without labels or action.

Q13How would you test prompt-injection resistance?

Strong answer outline

  1. Cover direct and indirect injection across every untrusted input surface.
  2. Measure tool/data effects and disclosures, not just whether text says it resisted.
  3. Test deterministic capability/authorization boundaries, over-refusal, escalation, and sequestered variants.

Follow-up probes

  • Can an LLM judge grade injection safely?
  • How do you test tool-result injection?
Self-check

Pass if a model mistake is contained by system controls; fail if one jailbreak list or system-prompt phrase is the defense.

Q14How do you choose among LangSmith, Langfuse, Ragas, DeepEval, and a custom harness?

Strong answer outline

  1. Define needs: datasets, annotation, traces, online sampling, CI, hosting/data policy, metrics, and collaboration.
  2. Prototype one workflow and verify evaluator transparency, versions, export, access, cost, and exit path.
  3. Keep core manifests and deterministic evaluators portable.

Follow-up probes

  • Which tool would you know deeply?
  • When is self-hosting worth it?
Self-check

Pass if comparison follows architecture and governance; fail if feature count or popularity decides.

Q15A candidate improves quality but increases cost and latency. How do you decide?

Strong answer outline

  1. Quantify practical quality gain and affected high-value slices.
  2. Compare p95/p99 and cost per successful task against product budgets and value.
  3. Consider selective routing, reranking depth, caching, or canary; state reversal/stop conditions.

Follow-up probes

  • What if users prefer it online?
  • How do you value fewer severe failures?
Self-check

Pass if the decision uses user value, risk, and Pareto trade-offs; fail if quality always wins or cheapest always wins.

Proof artifact: a versioned RAG release gate

Build a local, vendor-neutral evaluation harness for the public-data RAG system from chapter 2. It should compare baseline and candidate, publish case-level diffs, and return a failing process status when a release gate is violated. All thresholds and results are portfolio examples, not claims about Purnendu’s work history.

Steps

  1. Create a JSONL or table-based dataset with stable IDs, input, reference evidence, expected properties, slice tags, risk, provenance, and split. Hash the manifest.
  2. Run a frozen baseline and one candidate on the same validation cases. Capture retrieval IDs, packed context, response, citations, tool/trace events, latency, tokens, cost estimate, and all versions.
  3. Implement deterministic schema, citation-resolution, tenant-isolation, and no-duplicate-effect checks; retrieval metrics; and a human-calibrated claim-support judge.
  4. Generate overall and slice tables, paired deltas, error taxonomy, invariant failures, and Pareto plots. Persist evaluator failures separately.
  5. Encode release rules: all hard invariants pass, minimum quality floor, maximum allowable regression overall and on critical slices, and latency/cost budgets.
  6. Run the small critical suite in CI. Schedule the full suite and require the report for canary promotion. Document owner and rollback trigger.

Metrics

Capture recall@20, nDCG@10, packed evidence coverage, claim support, task success, citation correctness, abstention, safety invariants, evaluator agreement on a calibration subset, p50/p95/p99 latency, tokens, cost per successful task, and failures by taxonomy/slice. Include sample counts and uncertainty.

Deliberate failure injection

  • Insert one cross-tenant evidence item and prove the invariant blocks the release even if average relevance rises.
  • Alter the judge prompt to favor verbose answers and demonstrate calibration/order tests detect drift.
  • Remove citations after generation and verify deterministic resolution/completeness checks fail.
  • Slow the reranker and confirm the latency guardrail catches the p95 regression.
  • Leak near-duplicate source questions across splits, observe the inflated score, then repair grouping and document the change.

What to present

Show the quality tree, dataset card/manifest hash, evaluator calibration matrix, baseline-versus-candidate slice report, one blocked CI run, two error traces, and the exact release decision. The strongest demonstration is a candidate with a better aggregate score that the gate correctly refuses because a critical invariant or slice regressed.

Chapter review

Evaluation engineering turns variable model behavior into bounded release decisions. It begins with product consequences and representative data, uses the cheapest valid evaluator at each boundary, calibrates human and model judgment, inspects errors and slices, and connects offline evidence to guarded production rollout. The evaluation system itself is versioned, tested, monitored, and protected.

Glossary

Golden set
A reviewed, versioned dataset with inputs, provenance, expected properties/evidence, metadata, and judgments for repeatable comparison.
Guardrail metric
A limit that an optimization may not violate, such as p95 latency or cost per successful task.
Hard invariant
A property that must always hold, such as tenant isolation; it is not averaged with softer quality metrics.
LLM-as-judge
A model-driven evaluator that applies a rubric to an output or comparison and must be calibrated like any other model component.
Paired evaluation
Comparison of variants on the same cases, enabling per-case deltas and more efficient uncertainty analysis.
Slice
A meaningful subset defined by risk, user group, intent, data, or causal mechanism.
Faithfulness
Whether response claims are supported by supplied evidence; distinct from real-world correctness.
Evaluation leakage
When test information influences development or related examples cross splits, inflating apparent generalization.

Mastery checklist

  • I can draw a product-specific quality tree and label objectives, guardrails, and invariants.
  • I can design dataset sources, provenance, grouped splits, slices, and a version manifest.
  • I can distinguish retrieval, packing, grounding, answer, agent, and operational metrics.
  • I choose deterministic evaluators whenever the property is mechanically decidable.
  • I can calibrate a model judge against blinded human labels and test its biases.
  • I can turn case failures into an actionable taxonomy and paired slice report.
  • I can specify CI gates, uncertainty handling, shadow/canary, and rollback.
  • I can design injection, leakage, tenant, tool, refusal, and escalation tests.
  • I can compare evaluation platforms while preserving portability and data governance.
Search all 12 chaptersResults include concepts, worked examples, and interview questions.