Stanford Online

Stanford CME295 Transformers & LLMs | Autumn 2026 | Lecture 7 - LLM Evaluation

Published 2026-11-21 · Duration 1:45:00

Summary

This lecture provides a comprehensive guide to evaluating Large Language Models (LLMs) and AI agents, focusing on the transition from human-centric evaluation to scalable, automated methods. Key topics include quantifying output quality using metrics like Pass@k and LLM-as-a-Judge (LLAJ), analyzing the failure modes of the Observe-Act-Plan agent loop, and understanding the complexities of modern benchmarking (e.g., Benchmaxxing and Pareto frontiers). The central theme is the necessity of an 'eval-driven' mindset in AI development.

Download summary

Key takeaways

  1. LLM Evaluation Challenges 24:01

    LLM performance is difficult to quantify because tasks are vast (code, summarization, reasoning) and outputs are often non-deterministic, meaning there is no single correct reference answer.

  2. LLM-as-a-Judge (LLAJ) Mechanics 36:18

    LLAJ leverages the LLM's understanding capabilities to act as a judge, requiring the input of the prompt, the target criteria, and the candidate response. This process can be optimized via 'prompt hillclimbing' to achieve a target metric (e.g., recall).

  3. Agent Failure Modes 1:00:27

    Agent failures can occur at three stages: 1) Tool prediction failure (e.g., hallucinating a tool), 2) Backend computation failure (e.g., returning an error instead of a value), and 3) Final response generation failure (e.g., failing to surface relevant JSON data).

  4. Benchmarking Risks 1:32:18

    Benchmarks, while useful, are prone to 'Benchmaxxing'—where models optimize for proxy metrics (like line count) rather than actual user capability, leading to a mismatch between score and perceived quality. This is governed by 'Goodhart's Law.'

More digests on LLM Evaluation

Technical details

  • Evaluation Metrics 1111s

    Metrics include Cohen's kappa (which compares observed agreement to expected random agreement) for subjective criteria, Pass@k (the probability that at least one of k attempts succeeds), and traditional NLP metrics like BLEU, METEOR, and ROUGE.

  • LLAJ Biases 2897s

    LLAJ models exhibit biases, including position bias (preferring a certain position) and verbosity bias (preferring more verbose answers), which must be mitigated by careful prompt design.

  • Agent Tooling and Context 3977s

    Tool prediction failures can stem from poor tool routing, hallucinating non-existent APIs, or the API description lacking sufficient detail. Solutions include refining API names and using structured outputs.

  • Optimization and Guardrails 4837s

    The Pareto frontier defines the optimal boundary between quality and cost. To ensure benchmark integrity, techniques like BenchGuard are used to check for expected input formatting and problem solvability.

Mentioned resources

Channel & topics

Watch on YouTube · Back to latest

This independent, AI-assisted summary is provided for commentary and informational purposes. It may contain errors or omit important context. Please watch the original video for the creator's complete presentation. Video, thumbnail, and related copyrights belong to their respective owners.