interviewpath
  • 0day streak
  • 10total XP
  • Level 1
0/6

Unit 7 · ML & applied AI · Lesson 11 of 13

Evaluating ML and LLM systems

Designing evaluations that show whether an ML or LLM system works: datasets that reflect real use, explicit success criteria, error analysis, graders (code, human and model judges) and their biases, nondeterminism, and regression checks in CI. Evaluation skill is what makes every other ML decision defensible.
About 4 h 30 minFocus mode

Step 1: Learn the ideas

  • Evaluation datasets from real usage; coverage and slices
  • Task success definitions and rubrics
  • Error analysis and failure taxonomies
  • Code-based graders, human review and LLM-as-judge
  • Judge bias and calibration against human labels
  • Nondeterminism: sampling, repeated trials, pass@k and pass^k
  • Statistics: intervals, paired comparisons and sample size
  • Capability versus regression suites; CI integration
  • Offline evaluation versus online monitoring and A/B tests

Why it matters

Without evaluation, every change to a prompt, model, retriever or tool is a guess, and regressions reach users first. Applied AI and ML interviews ask how you would know a system works, how you would compare two versions, and why anyone should trust a model-based grader. Clear answers show product sense and scientific discipline at the same time.

Core ideas

Start from real cases. Build the dataset from logged or realistic inputs, support tickets and observed failures, covering the slices that matter (languages, customer types, edge cases), not from a handful of demo prompts. Practitioner guidance suggests that twenty to fifty well-chosen tasks are enough to start while changes still have large effects; grow the set as the system matures and differences shrink. Keep a frozen held-out portion for decisions you do not want to overfit.

Define success precisely. For each task, write down what passing means in terms two experts would agree on. Prefer checking outcomes (the record exists, the tests pass, the answer contains the right figure) over checking the exact path the system took. Use separate criteria or partial credit when a task has several parts, such as correct facts, correct format and the correct tool action.

Error analysis first. Read a sample of outputs, write a short note on each failure, group the notes into categories and count them. This shows which failures are frequent and which are severe, and often reveals that a "model problem" is really a retrieval, data or prompt problem. Repeat after every significant change.

Graders.

  • Code-based: exact match, regular expressions, schema validation, unit tests, state checks. Fast, cheap and reproducible, but brittle to valid variation.
  • Human: domain experts or trained annotators with a rubric. The reference standard, but slow and costly; measure inter-annotator agreement to learn how well-defined the task is.
  • Model-based (LLM-as-judge): scalable for open-ended criteria such as faithfulness or tone. Known biases include position bias (favoring one slot in a pairwise comparison), verbosity bias (favoring longer answers) and self-preference; judgments can also vary between runs. Mitigate by swapping answer order, using specific rubrics with one criterion per call, asking for evidence before the verdict, allowing an "unknown" verdict, and above all calibrating against human labels on a sample. Report agreement, for example Cohen's kappa, and re-check whenever the judge model or prompt changes.

Nondeterminism. Sampling makes outputs vary between runs on the same input, and serving infrastructure can add variation even at temperature zero. Run several trials per task and report per-task success rates. Two summaries help: pass@k, the chance that at least one of k trials succeeds (relevant when a person or system can choose among attempts), and pass^k, the chance that all k succeed (relevant when users expect consistent behavior). Report means with confidence intervals, compare versions with paired analysis on the same tasks, and remember that small evaluation sets cannot detect small improvements.

Regression suites in CI. Separate capability evaluations (hard tasks, low pass rates, for measuring progress) from regression evaluations (tasks the system should always pass). Run the regression suite on every change to prompts, models, retrieval or tools; fail the build on drops beyond measured noise, track cost and latency too, and review output diffs, not only aggregate scores. Promote capability tasks into the regression suite once they are reliably solved.

Offline is not online. Offline evaluation approximates real use; production monitoring, user feedback and online experiments measure it. Close the loop by turning production failures into new evaluation tasks.

Common misconceptions

  • "A public benchmark score predicts my system's quality." Benchmarks measure other tasks and may be contaminated; build an evaluation for your use case.
  • "LLM judges are objective." They have systematic biases and must be calibrated against human labels for each criterion.
  • "Temperature zero makes evaluation deterministic." It is not guaranteed; run repeated trials and report variance.
  • "An average score is enough." Averages hide slice failures; report per-slice results and read transcripts.
  • "Grading the exact sequence of steps is more rigorous." It penalizes valid alternative solutions; grade outcomes and constrain only the steps that matter, such as forbidden actions.
  • "The score went up, so the system improved." Check the interval, the slices, and whether the grader or dataset changed.

How to approach it

Treat evaluation as a product: version the dataset, graders and prompts, and keep transcripts. Practice on a small system of your own with 30 tasks, written criteria, error analysis, one calibrated judge and a script that runs on every change. In interviews, structure answers as data, criteria, graders, statistics and process.

Suggested order

  1. 1Read "Demystifying evals for AI agents" in full: the definitions of task, trial, grader, transcript and outcome; grader types; capability versus regression evals; nondeterminism; and the roadmap.
  2. 2Read Hamel Husain’s "Your AI Product Needs Evals" for a worked example of scoped tests, trace review and model-based evaluation.
  3. 3Read the LLM-as-a-judge paper’s sections on judge biases and on agreement with human preferences.
  4. 4Read "Adding Error Bars to Evals" for standard errors, clustered errors and paired comparisons, then compute an interval for an evaluation you run.
  5. 5Build the evaluation described in the practice guidance for a small system of your own, including a calibrated judge and a CI script.

Step 2: Check off what you can do

Tap each one you can genuinely do or explain. Each earns 10 XP.

Step 3: Go deeper

  • Demystifying evals for AI agentsStart here

    Anthropic Engineering

    Vocabulary and process for agent evaluation: tasks, trials, graders, outcomes, pass@k versus pass^k, capability versus regression suites.

    Open(opens in a new tab)Link responded, 5 Oct 2026
  • Your AI Product Needs Evals

    Hamel Husain's blog (practitioner)

    Practitioner process for LLM product evaluation: scoped tests, trace review, model grading and iterating on the system.

    Open(opens in a new tab)Link responded, 5 Oct 2026
  • Judging LLM-as-a-Judge with MT-Bench and Chatbot ArenaStart here

    arXiv

    Evidence on LLM-judge biases (position, verbosity, self-enhancement) and on agreement with human preferences.

    Open(opens in a new tab)Link responded, 5 Oct 2026
  • Adding Error Bars to Evals: A Statistical Approach to Language Model Evaluations

    arXiv

    Statistical treatment of evaluation results: standard errors, clustering, paired differences and power.

    Open(opens in a new tab)Link responded, 5 Oct 2026

Step 4: Practice

Pick a small LLM feature you can run (a summarizer, an extraction prompt, a RAG answerer). Collect 30 realistic inputs, write a pass/fail criterion for each, and run the system three times per input. Do error analysis on the failures and name the top three categories. Add a model judge for one subjective criterion, label 40 outputs yourself, and measure agreement plus position and length bias (swap answer order; compare long and short answers of equal quality). Report the pass rate with a bootstrap interval and pass^3. Finally, wrap the suite in a script that runs on every prompt change and fails when the pass rate drops by more than the noise you measured.

Record attempts on each problem’s page (+15 XP, +10 more when solved on your own).

Step 5: Test yourself

Answer each one out loud or on paper before you finish the lesson.

  1. Question 1Why grade outcomes rather than the sequence of tool calls?
  2. Question 2Name three LLM-judge biases and a mitigation for each.
  3. Question 3Roughly how many tasks do you need to detect a 5-point difference, and what reduces that number?
  4. Question 4What distinguishes a capability evaluation from a regression evaluation?
  5. Question 5Why does temperature zero not guarantee reproducible evaluations?
  6. Question 6How would you connect production failures to the evaluation suite?

You’re done when you can

  • Write an evaluation plan for a described LLM feature (data, criteria, graders, statistics, CI) in under ten minutes.
  • Calibrate an LLM judge against at least 30 human labels and report agreement.
  • Explain pass@k versus pass^k and choose one for a given scenario.
  • Run an error analysis and turn the top failure category into new evaluation cases.

Finish the lesson

How confident do you feel?

Lesson complete!

+50 XP

Reviews will come up on the Practice tab so it sticks.

Unlocks next: Model serving, monitoring and drift, Experimental controls for ML research, Alignment and safety evaluation research (optional)

Your notes and study time

Log study time