Stanford CME295 Transformers & LLMs | Autumn 2026 | Lecture 7 - LLM Evaluation
Stanford Online
What evaluation means 0:06
LLM performance can mean several things, but this lecture focuses on quality. Quality includes whether an answer is correct, relevant, safe, well written, or useful. That is hard because one model can do many tasks, from code and summary writing to math and creative stories. It is also hard because some outputs have no single right answer, and newer systems, like agents, add more steps and more places for failure.
Rating and pass at k 6:01
Human ratings help, but people can disagree, especially on subjective labels like usefulness. Agreement must be checked, and Cohen's kappa compares observed agreement with chance agreement. Humans are also slow and costly, so a second approach uses fixed references and rule-based checks for tasks like code and math. For those settings, pass at k measures the chance that at least one of k attempts succeeds, and it can be estimated from sampled outputs.
Reasoning metrics 25:01
Pass at k is the share of attempts that succeed. With temperature set to zero, you get the same output every time, so pass at k does not change. As temperature rises, the model explores more answers and the metric often improves, until too much temperature makes answers drift away from reasonable ones. For tasks like coding, where test cases can check success, pass at k is useful. For math, where no checker is available, consensus at k uses majority vote across attempts.
Judging with LLMs 33:31
For natural language tasks, reference scores like BLEU and METEOR compare outputs to reference texts, but they miss many valid paraphrases and still need human-made references. A newer approach is LLM as a judge. You give the model the prompt, the answer, and a rubric, then ask for a score and a rationale. Teams refine that prompt by sampling examples, measuring precision and recall, and using constrained decoding or structured outputs so the judge returns a fixed format such as JSON.
Judge model biases 46:00
Ask the judge twice, swapping A and B, and watch for answers that change with position. Length can also sway the model. A short correct answer may lose to a longer one, so the prompt should say that length does not decide correctness. The judge may also favor its own output over a human one. To reduce that self-enhancement bias, avoid using the same model as judge when you can.
Judge setup and agents 50:01
A binary score such as pass or fail is often cleaner than a 1-to-10 scale. Ask for the rationale before the score, then calibrate the judge against human ratings. Because these models are not deterministic, lower temperature or use several samples and majority vote. The field is still changing, and new decision models aim to output calibrated probabilities instead of text. The lecture then turns to agents and the observe-act-plan loop, where tool use must be evaluated step by step.
Tool output shape 1:06:00
Hallucinations can appear when a tool gives no feedback. If you ask the model to turn on the lights and it gets nothing back, it may claim the action happened anyway. The fix is to make tool output easy to read, trimmed, and clearly structured. When the final response misses the useful JSON, the problem is often that the output is too noisy or the fields are not labeled well enough for the model to find them.
Benchmarking model strength 1:11:01
Agent evaluation also looks at time horizon, meaning how long a task takes an expert and when an agent can succeed at least half the time. Model indexes then split intelligence into general facts, knowledge work, coding, and science, each built from several benchmarks. Some use LLMs as judges, some use pairwise comparisons, and coding or science tasks can be checked with hidden tests and other deterministic checks.
Benchmark drift and gaming
Small changes in benchmark wording can move scores a lot. The lecture uses Deep Suite as an example: asking for dates in Zulu time instead of PT, or changing a casing rule, was enough to drop model scores and reshuffle rankings. The point is that benchmark numbers can look stable while hiding fragility. To fight this, people use private benchmarks, zero data retention agreements, and task sets built around real business needs. The talk also warns about shortcutting, like cloning a repo with the fix already inside or using internet access to search for answers. Goodhart’s law applies here: once a measure becomes the target, it stops being a good measure.
AI-generated summary. It can be wrong or incomplete - check anything that matters against the original.

