LLM-as-a-Judge: How to Grade AI Agents | Stanford CS329Z Lecture 13 with John Yang

LLM-as-a-Judge: How to Grade AI Agents | Stanford CS329Z Lecture 13 with John Yang — Stanford Online

Stanford Online

AI-assisted summary of LLM-as-a-Judge: How to Grade AI Agents | Stanford CS329Z Lecture 13 with John Yang — original source. Check the original for full context.

Source published:

Key ideas

  • Programmatic unit tests are deterministic and cheap but suffer from benchmark saturation and solution-space constraints, while human grading introduces high costs, annotator drift, and disagreement across complex tasks. (15:05)
  • LLM-as-a-judge provides higher correlation with human judgment than classical lexical metrics like BLEU and ROUGE, but remains prone to systematic failures including position bias and severe verbosity bias. (32:11)
  • Agent evaluation is expanding into interactive 'Agent-as-a-Judge' models that dynamically click, navigate, and verify multi-step operational trajectories for artifacts like web applications or desktop OS environments. (60:17)
  • Arithmetic mean performance conceals critical reliability dynamics; benchmarks should contrast pass@k (probability of at least one success across k trials) with pass^k (probability of consistent success across all k trials). (12:16)

Detailed notes

## Background Published by Stanford Online on YouTube on November 28, 2026, this video features a guest lecture by Stanford PhD student John Yang for CS329Z: Engineering AI Agents. The session explores how to evaluate AI agents using LLM-as-a-judge approaches, examining grader archetypes, systematic model biases, metric design, and interactive verification systems.

## TL;DR John Yang surveys the three core evaluation paradigms for agentic systems: programmatic unit tests, human annotators, and LLM judges. He traces the evolution of automated evaluation from early n-gram heuristics to RLHF reward models and multi-turn agentic trajectory graders like WebVoyager and Agent-as-a-Judge. The lecture highlights critical pitfalls in model-based evaluation, including position and verbosity biases, benchmark saturation, and the failure of zero-temperature rollouts to enforce determinism. Yang concludes by breaking down the statistical divergence between reporting pass@k for creative discovery versus pass^k for mission-critical reliability.

## Atmosphere & style The lecture maintains an analytical, pragmatic, and approachable academic tone typical of a high-level engineering seminar. Yang speaks with the grounded authority of a practitioner who has built benchmarks like SWE-bench, punctuating technical concepts with candid observations on reward hacking, imperfect test suites, and empirical agent failures. The pacing transitions seamlessly from foundational machine learning history to state-of-the-art interactive evaluators, creating an intellectually rigorous yet accessible learning experience.

## Bulletin - [15:05](https://www.youtube.com/watch?v=J61-q-mk9y0&t=905s) Programmatic unit tests are deterministic and cheap but suffer from benchmark saturation and solution-space constraints, while human grading introduces high costs, annotator drift, and disagreement across complex tasks. - [32:11](https://www.youtube.com/watch?v=J61-q-mk9y0&t=1931s) LLM-as-a-judge provides higher correlation with human judgment than classical lexical metrics like BLEU and ROUGE, but remains prone to systematic failures including position bias and severe verbosity bias. - [01:00:17](https://www.youtube.com/watch?v=J61-q-mk9y0&t=3617s) Agent evaluation is expanding into interactive 'Agent-as-a-Judge' models that dynamically click, navigate, and verify multi-step operational trajectories for artifacts like web applications or desktop OS environments. - [12:16](https://www.youtube.com/watch?v=J61-q-mk9y0&t=736s) Arithmetic mean performance conceals critical reliability dynamics; benchmarks should contrast pass@k (probability of at least one success across k trials) with pass^k (probability of consistent success across all k trials).

## Key takeaways - [00:05](https://www.youtube.com/watch?v=J61-q-mk9y0&t=5s) Benchmarks consist of three core architectural components: the environment, the problem statement, and the verification mechanism. - [04:06](https://www.youtube.com/watch?v=J61-q-mk9y0&t=246s) Programmatic unit testing fails on open-ended problems, struggles in dynamic live environments, and can penalize valid creative solutions through over-specification. - [10:19](https://www.youtube.com/watch?v=J61-q-mk9y0&t=619s) Setting sampling temperature to zero does not eliminate agent execution non-determinism across multi-turn tool-use rollouts. - [19:43](https://www.youtube.com/watch?v=J61-q-mk9y0&t=1183s) Moving verification up an order of abstraction—such as compiling code to CLI binaries rather than asserting fine-grained signatures—prevents overly constraining the model's solution space. - [21:35](https://www.youtube.com/watch?v=J61-q-mk9y0&t=1295s) Static code graders are reductive because finite test suites cannot exhaustively validate unbounded real-world solution spaces. - [23:39](https://www.youtube.com/watch?v=J61-q-mk9y0&t=1419s) Human-in-the-loop evaluation frameworks like GDP-Val and Co-Gym accommodate flexible workflows but incur steep financial costs and inter-annotator disagreement. - [30:54](https://www.youtube.com/watch?v=J61-q-mk9y0&t=1854s) LLM evaluation has evolved across three distinct phases: heuristic metric replacement, open-ended conversational preference alignment, and multi-step agent trajectory validation. - [45:01](https://www.youtube.com/watch?v=J61-q-mk9y0&t=2701s) Early preference modeling for RLHF replaced human raters with scalable reward models trained on pairwise candidate tuples. - [52:54](https://www.youtube.com/watch?v=J61-q-mk9y0&t=3174s) LLM judges suffer from position bias, where decision outcomes flip based on candidate order, necessitating symmetric order swapping or randomized dataset balancing. - [42:08](https://www.youtube.com/watch?v=J61-q-mk9y0&t=2528s) Verbosity bias causes LLM evaluators to favor longer or repetitive outputs, requiring explicit length penalties or rubric-based brevity constraints. - [01:00:17](https://www.youtube.com/watch?v=J61-q-mk9y0&t=3617s) Dynamic digital artifacts cannot be verified via static context windows alone; agentic judges must interactively execute, click, and navigate candidate outputs. - [01:08:04](https://www.youtube.com/watch?v=J61-q-mk9y0&t=4084s) Trajectory evaluators inspect intermediate execution states and tool calls to assess success even when an agent encounters minor execution anomalies. - [01:13:41](https://www.youtube.com/watch?v=J61-q-mk9y0&t=4421s) AutoMetrics solves the evaluator cold-start problem by bootstrapping a specialized metric blend from a minimal set of human-annotated examples. - [01:17:07](https://www.youtube.com/watch?v=J61-q-mk9y0&t=4627s) pass@k rewards high variance and search upside for difficult reasoning tasks, whereas pass^k strictly penalizes variance to verify mission-critical operational reliability.

## Detailed walkthrough ### [00:05](https://www.youtube.com/watch?v=J61-q-mk9y0&t=5s) Introduction and Lecture Overview

John Yang introduces the lecture focus on using language models as judges (LLM-as-a-judge) and exploring deeper details of evaluation harness design. Recapping the previous lecture, he reminds the class that benchmarks generally consist of three core building blocks: the environment, the problem statement, and the verification. That tripartite template has proven very conducive to seeding practical benchmarks across domains like software engineering, web navigation, and computer use. The goal of this lecture is to zoom in specifically on the verification block and inspect what makes it tick.

```mermaid flowchart LR accTitle: Core Building Blocks of an AI Benchmark accDescr: Three sequential blocks defining benchmark structure leading from environment and problem statement to verification. A["Environment"] --> B["Problem Statement"] B --> C["Verification\n(Focus of Lecture)"] ```

The roadmap begins by considering why verification matters and examining the spectrum of available grading mechanisms. Historically, natural language processing relied on metrics like BLEU and ROUGE to measure semantic similarity across text spans, before shifting toward human preference evaluation in platforms like Chatbot Arena. Because human evaluation is expensive and difficult to scale, research dating back to 2018–2019 began exploring whether language models could serve as reliable stand-ins. That line of inquiry laid the groundwork for Reinforcement Learning from Human Feedback (RLHF) and learned reward models. More recently, LLM-as-a-judge has evolved from static text comparison into agentic verification, where an evaluator agent interactively tests dynamic artifacts like generated websites rather than running purely static checks.

The lecture also explores the pitfalls of LLM judges, including common evaluation biases, alignment with human judgement, and grading consistency. Finally, Yang notes that the discussion will cover handling non-determinism when reporting benchmark metrics across repeated task trials (such as pass@k versus pass^k).

- Primary topics covered: motivation for verification, spectrum of graders (unit tests vs. human ratings vs. LLMs), agentic evaluation, judge biases, and reporting metrics under non-determinism. - Historical context: LLMs as evaluators trace back to early Transformer literature (2018–2019) replacing n-gram overlap metrics (BLEU, ROUGE), evolving through RLHF reward modeling to modern agentic judges.

---

[04:06](https://www.youtube.com/watch?v=J61-q-mk9y0&t=246s) The Strengths and Limitations of Unit-Test-Based Verification

Yang connects the verification discussion to the students' ongoing coursework (Homework 2), which exposes them to three representative coding and agent benchmarks: HumanEval, SWE-bench, and Terminal-Bench. These represent the primary lineage of code generation and software benchmarks established since 2021. In coding benchmarks, verification has overwhelmingly relied on programmatic unit tests, reflecting standard software engineering practices such as test-driven development (TDD), integration testing, and end-to-end testing.

Unit tests offer compelling advantages over human or model-based evaluation: they are deterministic, computationally cheap to rerun without paying human or API grading costs, and highly expressive. Even outside traditional coding benchmarks, programmatic checks can verify system state. For example, in tau-bench—which simulates interactive user conversations—a programmatic test can inspect an underlying database to ensure an order was changed to "cancelled" status after a user cancellation request. Similarly, in benchmarks like BrowserGym (WebArena) or multiple-choice exams, deterministic assertions verify exact matches efficiently.

However, programmatic verification exhibits notable failure modes when applied to open-ended agentic tasks. Many real-world problems lack a single reference solution; instruction following in Chatbot Arena involves open questions where evaluation is inherently subjective to specific evaluators. Furthermore, unit tests struggle in dynamic, evolving environments. For instance, in live web-browsing tasks, running an identical Google search query today yields entirely different results than it did four years ago. Unless environments are artificially frozen, programmatic checks can break due to temporal shifts rather than agent errors.

- Benchmarks highlighted: HumanEval, SWE-bench, Terminal-Bench, and tau-bench. - Key strengths of unit tests: determinism, reusability without incremental grading cost, and precise state verification (e.g., checking database mutations). - Key limitations: inability to handle tasks without unique ground-truth answers, subjectivity of user preferences, and brittleness in dynamic, live-web environments.

---

[08:44](https://www.youtube.com/watch?v=J61-q-mk9y0&t=524s) Verification Alignment and the Pitfalls of Partial Test Suites

Verification must align tightly with the problem statement to prevent models from gaming benchmarks or receiving credit for invalid outputs. Yang emphasizes that evaluation mechanisms must reliably separate correct solutions from broken ones:

> “Verification is certainly very important because beyond the alignment, it just it does need to be good. And so like you want your your verification to ultimately grade things that are actually correct to be marked as correct and the things that are wrong to be actually marked as wrong.”

When verification fails to enforce this standard, benchmark integrity breaks down. Yang cites research titled "The SWE-bench Illusion," which demonstrated flaws in how benchmark test harnesses evaluate proposed patches. In large software repositories, executing an entire test suite on every candidate patch is often computationally prohibitive, and native repository tests can be notoriously flaky or tightly coupled to environment quirks. Consequently, SWE-bench uses a targeted subset of unit tests associated with the specific issue rather than running the full repository suite. The authors of "The SWE-bench Illusion" discovered that many candidate patches passed the targeted evaluation checks while actively breaking other parts of the codebase when the full suite was executed, highlighting how sub-selected unit tests can create an illusion of correctness.

[10:19](https://www.youtube.com/watch?v=J61-q-mk9y0&t=619s) Verification Pitfalls and the Reality of Agent Non-Determinism

John Yang warns that automated evaluators can easily mislead researchers if their verification suites are incomplete or brittle. If an evaluation harness relies on only a partial set of test cases, it will inevitably reward flawed code by incorrectly marking broken solutions as passing. Conversely, rigid verifiers can penalize genuinely creative and correct behavior. Yang references an Anthropic blog post released alongside Claude 3.5 Opus (or prospective frontier models) evaluating $\tau^2$-bench ($\text{Tau}^2$-Bench), an expansion of $\tau$-bench across broader domains and complex user interactions. In that benchmark, the model devised a perfectly valid, high-quality solution to a problem, but the rigid automated verification suite failed to account for that alternative approach and marked it wrong. While Yang notes that these evaluation concepts seem straightforward on paper, maintaining a rigorous mental checklist is essential to prevent flawed evals from polluting results.

Moving into the core challenge of agent evaluation, Yang emphasizes that agents in multi-turn, long-horizon settings behave non-deterministically even under seemingly deterministic configurations. Students often assume that setting the sampling temperature to zero guarantees identical execution paths, but agentic rollouts frequently diverge due to underlying system interactions, tool calls, and model dynamics:

> “It's not the case that like you know, if you just turn the temperature to zero or something like that, that every time you run the model on this agent task, it's going to arrive upon the same solution every single time.”

Yang defers the deeper mathematical foundations of why this non-determinism persists despite zero temperature to core language modeling courses like Stanford CS336, maintaining the practical abstraction for CS329Z that multi-turn agent execution inevitably exhibits variance across runs.

```mermaid flowchart TD accTitle: Evaluation Verification Pitfalls accDescr: Flowchart contrasting incomplete test suites that produce false positives against rigid verifiers that produce false negatives. subgraph S1["Under-specified Tests"] A["Agent Generates Patch"] --> B["Partial Test Suite"] B --> C["Incorrectly Marked PASS (False Positive)"] end subgraph S2["Overly Rigid Tests"] D["Agent Produces Novel Valid Solution"] --> E["Brittle Test / Exact Assertion"] E --> F["Incorrectly Marked FAIL (False Negative)"] end ```

---

[12:16](https://www.youtube.com/watch?v=J61-q-mk9y0&t=736s) Evaluation Metrics for Non-Deterministic Tasks: Average, pass@k, and $\text{pass}^k$

When evaluating an agent across multiple runs—such as five rollouts where two runs solve the task cleanly while three fail—researchers must decide how to summarize that variance. Yang contrasts three primary aggregation strategies: simple averages, $\text{pass}@k$, and $\text{pass}^k$. Reporting the arithmetic mean works cleanly when rewards are strictly binary ($0$ or $1$). However, if the reward function is continuous on a scale from $0.0$ to $1.0$, an average score of $40\%$ becomes ambiguous: it obscures whether the model achieved an average partial progress of $0.4$ across all five runs, or achieved a perfect $1.0$ on two runs and completely collapsed to $0.0$ on the other three.

For frontier breakthrough tasks where discovering a single valid solution is historic, reporting $\text{pass}@k$ (the probability of at least one success across $k$ attempts) makes the most sense. Yang humorously compares this to solving unsolved mathematical challenges:

> “If I just solve the, you know, Millennium problem once, that's already insanely impressive, right?”

In coding benchmarks like HumanEval, $\text{pass}@k$ measures the model's capacity to generate working code without demanding consistency across every generation. However, using $\text{pass}@k$ in customer-facing domains like automated support agents would be catastrophic; a business cannot deploy an agent that solves a customer's billing issue only once out of ten attempts. To measure reliability, benchmarks like $\tau$-bench introduced $\text{pass}^k$ (pass-to-the-$k$), which requires the agent to succeed across every single one of the $k$ trials. As the number of rollouts $k$ increases, the curves move in opposite directions: $\text{pass}@k$ climbs upward toward $100\%$, while $\text{pass}^k$ decays rapidly toward zero.

> “At the end of the day the point of this is to communicate there's not actually one right answer for like which metric to report.”

- **Average Reward**: Simple to compute, but obscures variance and conflates uniform mediocrity with split success/failure on continuous scales. - **$\text{pass}@k$**: Measures upside potential and task solvability; well suited for code generation, mathematical discovery, and difficult research tasks. - **$\text{pass}^k$**: Measures operational consistency and reliability; mandatory for customer service and mission-critical workflows where failure on any run is unacceptable.

---

[15:05](https://www.youtube.com/watch?v=J61-q-mk9y0&t=905s) The Three Grader Paradigms and the Power of Unit Tests

Yang sets up the roadmap for the lecture by outlining three foundational grading paradigms: programmatic unit tests, human annotations, and LLM-as-a-judge. Over the course of the lecture, the class will examine trade-offs across cost, latency, nuance, and flexibility, tracing LLM evaluators from early automated text metric replacements (like ROUGE and BLEU) to human preference alignment and multi-turn action simulation.

Turning to unit testing, Yang highlights that code remains an exceptionally expressive and practical medium for evaluation, predicting that most students will rely on unit tests for their Homework 2 agent benchmarks. Even in domain-specific tasks outside traditional software development—such as bio-agent tasks in TerminalBench Science involving DNA/RNA transcription and genome sequence annotation—graders can evaluate output artifacts deterministically. Whether the task demands an exact string match (such as a 32-character nucleotide sequence of `A`, `C`, `G`, and `T`) or a flexible structural invariant (such as verifying that a specific motif repeats three times), a Python assertion or unit test script handles the verification seamlessly. Programmatic unit tests are nearly instantaneous to run, cost essentially nothing after generation, and can now be authored automatically by frontier reasoning models.

```mermaid flowchart LR accTitle: Three Grader Paradigms accDescr: Three main grading paradigms used to evaluate AI agents: Unit Tests, Human Annotation, and LLM-as-a-Judge. A["Grader Paradigms"] --> B["Unit Tests<br>Fast, deterministic, zero-cost at runtime"] A --> C["Human Annotation<br>High nuance, expensive, slow"] A --> D["LLM-as-a-Judge<br>Flexible, scalable stand-in for humans"] ```

---

[18:03](https://www.youtube.com/watch?v=J61-q-mk9y0&t=1083s) Staticness, Benchmark Saturation, and the Limits of Code Graders

Despite the speed and affordability of unit tests, their primary operational drawback is a severe lack of flexibility and nuance. Yang explains that programmatic test suites suffer from staticness. Once a task and its test suite are published, the benchmark is fixed. As models rapidly improve and learn to pass those exact unit test assertions, the benchmark becomes completely saturated, losing its ability to separate top-tier models from mediocre ones.

Yang points out that SWE-bench Verified, SWE-bench Multilingual, TerminalBench 1.0, and WebArena have all suffered this fate as agent capabilities escalated. Because each relies on deterministic unit test grading, once models pass the suite, those test cases cease to offer useful training signal:

> “In some sense, it's like very very sort of readily available, easy to generate, but it's kind of like fossil fuel in some sense, right? Like once those tests are used, like it's not going to give you sort of in training, it's not going to give you RL signal anymore.”

Once a benchmark's test suite is tapped out, it can neither guide reinforcement learning updates nor provide discriminatory evaluation signal for state-of-the-art models. Nevertheless, Yang reiterates that unit testing remains an essential, practical tool for agent evaluation when designers employ creative verification setups that test underlying functionality rather than superficial syntax.

[19:43](https://www.youtube.com/watch?v=J61-q-mk9y0&t=1183s) Abstraction Levels in Programmatic Verification: Unit Tests vs. Program-Bench

John Yang illustrates how unit tests can inadvertently over-constrain an agent's solution space. If a test asserts that an implementation must contain a specific function, class, or method header—such as writing an algorithm for the Fibonacci sequence—it imposes strict structural requirements on how the code looks.

To overcome this rigidity, newer benchmarks shift the verification boundary up an entire level of abstraction. Yang points to Program-Bench as a prime example: the model is tasked with producing code that compiles into an executable CLI tool (such as `ffmpeg`, `jq`, or `ripgrep`). Instead of examining the source code structure, the evaluation harness compiles the repository into a binary, invokes it with command-line arguments and input flags, and asserts against the resulting standard output or generated artifacts.

```mermaid flowchart TD accTitle: Codebase verification abstraction levels accDescr: Comparison between fine-grained unit tests and higher-order binary execution tests.

subgraph FineGrained["Fine-Grained Code Verification"] A["Model Codebase"] --> B["Unit Tests Inspect Function/Class Signatures"] B --> C["Strictly Constrains Code Structure"] end

subgraph HigherOrder["Higher-Order Verification (Program-Bench)"] D["Model Codebase"] --> E["Compile to Executable (e.g., ffmpeg, jq)"] E --> F["Invoke CLI with Flags and Inputs"] F --> G["Assert on stdout / Artifact Output"] end ```

By stepping one order of abstraction higher, evaluators avoid dictating internal implementation details:

> “I'm not doing verification against what your codebase looks like. I'm doing verification against what your codebase compiles into. And so a nice way if you get stuck of like, oh man, I really want to create this hard task, but the problem is that like my verification can't be too fine-grained in the sense that it constrains the solution space, then sort of a way to sort of think about it is like how do you go one order of abstraction up in terms of like where your verification sits.”

- Fine-grained unit tests dictate precise method signatures and class layouts. - Higher-order verification compiles agents' code into CLI binaries (e.g., `ffmpeg`, `ripgrep`, `jq`) and tests end-to-end execution behavior.

---

[21:35](https://www.youtube.com/watch?v=J61-q-mk9y0&t=1295s) Weaknesses of Code-Based Graders: Prescriptiveness, Stasis, and Incomplete Coverage

Even higher-level programmatic evaluations face inherent failure modes: they remain prescriptive, static, and reductive. Program-Bench attempts to test whether a model can generate an entire codebase from scratch ("vibe code something really really cool"), but verifying an executable like `ffmpeg` still forces specific interface contracts—the binary must ingest an `.mov` file and expect exact flag names. The evaluation becomes non-open-ended because the abstraction contract itself is rigid.

Furthermore, static unit tests do not evolve over time, and they remain inherently reductive. It is nearly impossible for an empirical test suite to cover an entire solution space. Yang notes that verifying an implementation of Fibonacci empirically might test the first 1,000 numbers, but it inevitably omits the 1,001st case. Outside of formal verification methods, code-based tests provide only partial coverage of the problem domain.

- **Prescriptive:** Verifying via executable flags still limits problem flexibility. - **Static:** Code tests remain fixed and do not evolve dynamically. - **Reductive:** Empirical tests cannot cover the full mathematical or practical solution space.

---

[23:39](https://www.youtube.com/watch?v=J61-q-mk9y0&t=1419s) Human Evaluation in Complex Workflows: GDP-Val and Co-Gym

Because programmatic tests struggle with open-ended tasks, evaluators frequently resort to human grading. While early human evals focused on conversational comparisons like MT-Bench and LMSYS Chatbot Arena, newer benchmarks apply human evaluation to complex white-collar tasks:

1. **GDP-Val (OpenAI):** Evaluates economically valuable, office-based work, such as processing spreadsheets or drafting PowerPoint presentations. Programmatic assertions fail on an Excel file or an S-1 regulatory filing review because the exact layout of columns A, B, and C does not matter so long as the underlying financial question is answered accurately. 2. **Co-Gym (Stanford / Diyi Yang's group, led by Mina Lee):** Measures human-agent collaboration workflows by having the human partner directly grade the quality of the collaborative interaction.

Attempting to grade these tasks via code forces prompt authors into an unwanted compromise:

> “So this sort of like tug of war between the prescriptiveness of the problem statement and then sort of the comprehensiveness of the unit test, you can kind of break out of it by having a human judge in the loop because you know, human grading is sort of like, you know, we're treating it essentially as like we're the oracles of what we want done.”

---

[26:41](https://www.youtube.com/watch?v=J61-q-mk9y0&t=1601s) Pitfalls of Human Graders: Expense and Grader Disagreement

While humans act as ground-truth oracles, human evaluation suffers from significant drawbacks. First, expert human labor is expensive ("rightfully so I think I hope it stays that way"). Second, human evaluation lacks the deterministic consistency of code.

A deterministic unit test reliably produces an identical pass or fail result on rerun. In contrast, human annotators exhibit inter-annotator and intra-annotator variance: an individual grader may interpret a rubric differently from one day to the next. Addressing this variance demands confidence intervals and rigorous statistical significance testing, which makes human-in-the-loop evals difficult, slow, and expensive to re-run across model iterations.

- Human grading introduces both intra-annotator drift and cross-annotator disagreement. - Relying on humans requires statistical validation and confidence intervals to ensure reproducibility.

---

[27:46](https://www.youtube.com/watch?v=J61-q-mk9y0&t=1666s) Introducing LLM-as-a-Judge: Pointwise vs. Pairwise Frameworks

The high costs and friction of human grading motivate using advanced language models as evaluator proxies. Yang outlines two primary architectural paradigms for LLM judges:

```mermaid flowchart LR accTitle: LLM-as-a-Judge Evaluation Modalities accDescr: Diagram illustrating pointwise evaluation with a rubric versus pairwise comparative evaluation.

subgraph Pointwise["Pointwise / Rubric-Based Evaluation"] direction TB P_Input["Solution Artifact + Rubric / Checklist"] --> P_Judge["LLM Judge"] P_Judge --> P_Score["Score / Assertion Pass-Fail"] end

subgraph Pairwise["Pairwise Comparative Evaluation"] direction TB PW_Input["Solution A vs. Solution B (+ Optional Rubric)"] --> PW_Judge["LLM Judge"] PW_Judge --> PW_Pick["Relative Preference / Ranking"] end ```

1. **Pointwise / Reference-Based / Rubric-Scoring:** The LLM is provided a single candidate solution along with a rubric, reference answer, or checklist of behavioral assertions. The model evaluates whether the artifact satisfies those specific constraints. 2. **Pairwise Evaluation:** Echoing the Chatbot Arena model, the LLM is presented with two candidate outputs (`Solution A` and `Solution B`) and prompted to select the superior response or rank them, occasionally applying an explicit rubric to guide its preference.

[29:10](https://www.youtube.com/watch?v=J61-q-mk9y0&t=1750s) The Spectrum of LLM Evaluation: Exact Checks vs. Open-Ended Preference

John Yang frames LLM-as-a-judge as occupying a unique position across the entire evaluation spectrum, capturing qualities of both automated unit tests and human evaluators. On one extreme, an LLM judge can enforce rigid, binary constraints. Yang illustrates this with hypothetical benchmarks: if an agent completes a task on a benchmark like "TaxBench" or files a complex financial form, the judge must verify absolute requirements—such as ensuring the agent entered the user's mock Social Security number without fail. On the other extreme lies open-ended human preference, where an agent might navigate gray areas, such as whether it skillfully applied tax deductions, where no single deterministic correct answer exists.

```mermaid flowchart LR accTitle: Spectrum of LLM evaluation methods accDescr: Diagram illustrating the spectrum from deterministic unit tests to open-ended human judgment, with LLM-as-a-judge spanning both. subgraph Spectrum["Evaluation Spectrum"] UT["Unit Tests<br/>(Exact checks, deterministic)"] LJ["LLM-as-a-Judge<br/>(Hybrid: exact constraints + stylistic preference)"] HJ["Human Evaluation<br/>(Open-ended preferences, gray areas)"] end UT <--> LJ LJ <--> HJ ```

Reviewing the trade-offs across graders, Yang reminds students to weigh these checks and balances when deciding how to grade their assignments for Homework 2: - Unit tests excel at rigid, verifiable requirements (e.g., verifying exact fields on structured outputs). - LLM judges can execute both programmatic validation and nuanced qualitative assessment. - Human judgment captures holistic open-ended preference, but at high cost and low speed.

---

[30:54](https://www.youtube.com/watch?v=J61-q-mk9y0&t=1854s) Evolution of LLM-as-a-Judge: Three Historical Phases

Transitioning into the historical evolution of LLM-as-a-judge, Yang notes that while using artificial intelligence for human judgment predates transformers, the lecture focuses on modern post-2018/2019 innovations that accompanied architectures like BERT and ELMo. Yang breaks modern LLM grading into three distinct phases:

1. **Phase 1: Replacing Traditional Heuristics and Exact-Match Metrics** Moving away from rigid surface-form metrics like BLEU score and exact match for tasks like textual entailment, named entity recognition (NER), and summarization. 2. **Phase 2: Capturing Human Preference** Evaluating open-ended conversational generation and subjective qualities that lack a single reference ground truth. 3. **Phase 3: Evaluating Human Actions in Agentic Environments** Grading multi-step autonomous behavior and environment interactions.

Before moving into details, Yang grounds the motivation: early natural language processing benchmarks relied on simple token overlap, which failed whenever models expressed identical semantics using alternate vocabulary.

---

[32:11](https://www.youtube.com/watch?v=J61-q-mk9y0&t=1931s) G-Eval and Replacing N-Gram Overlap Metrics

Yang highlights the G-Eval paper as an early, influential approach that directly targeted the flaws of reference-based N-gram overlap metrics (such as BLEU and ROUGE). Historically, text summarization evaluation required collecting a document and a reference summary written by human experts, generating a model summary, and computing token overlap.

Drawing a parallel to the class homework quizzes on search algorithms like BM25, Yang explains why surface-level matching breaks down: > “Even there folks have identified like, okay, well, one of the issues with BM25 is that if you have a query that has the word, um, I don't know, um, queen in it and it's looking for, um, you know, similar text, um, it's not going to match with text that has empress or, uh, princess or things that have sort of meaning-level similarity but no semantic similarity, right? And so you can apply the same sort of, uh, um, skepticism to N-gram overlap grading for summarization, right? It doesn't account for sort of those, uh, meaning, uh, level similarities.”

G-Eval tested this critique on text summarization and dialogue generation. Instead of measuring lexical overlap or relying on statistical text distributions, G-Eval prompted an LLM to rate summaries on a Likert scale (such as 1 to 5).

A key technical challenge emerged immediately: non-determinism. Because LLMs sampled at non-zero temperatures do not output the exact same score on every run for a given candidate-reference pair, G-Eval performed multiple rollouts. By sampling repeated outputs, the authors generated a score distribution and computed its weighted average or expected value, establishing an early precursor to sampling-based evaluation methods like `pass@k`. When compared against traditional metrics, G-Eval showed significantly higher correlation with human ratings across several summary dimensions:

> “Turns out the models are pretty dang good. And so, um, what they show here is they show how well each metric correlates with a human's score along the same dimension, right?”

---

[36:29](https://www.youtube.com/watch?v=J61-q-mk9y0&t=2189s) GPTScore and Unified Multidimensional Evaluation

Following G-Eval, papers like GPTScore generalized text evaluation into a unified, multi-task framework. Yang compares this shift to the transition seen in model architectures when T5 unified various NLP tasks under a shared sequence-to-sequence input-output formulation. Rather than designing isolated, specialized heuristics for each benchmark, GPTScore established a single grading framework across diverse tasks: - Text summarization - Dialogue generation - Machine translation (e.g., evaluating translation quality against Google Translate)

GPTScore also broke text quality down into granular evaluation dimensions: - Summarization and dialogue tasks were evaluated on deep, explicit criteria (such as coherence, consistency, fluency, and relevance) rather than a single monolithic score. - This phase relied on comprehensive, exhaustive taxonomies defining what made text "good" for a specific domain.

Yang points out a recurring historical cycle: research communities initially construct fragmented, task-specific benchmarks with elaborate rubrics; they aggregate them into unified suites (mirroring how individual linguistic tasks merged into SuperGLUE and MMLU); and eventually, frameworks like Chatbot Arena and MT-Bench discard hyper-granular rubrics altogether in favor of holistic human pairwise preference. In its evaluation suite, GPTScore validated this broad LLM-based metric approach across 19 language models of varying sizes.

[39:00](https://www.youtube.com/watch?v=J61-q-mk9y0&t=2340s) Expanding LLM Judges to Open-Ended Tasks and Model Self-Preference

John Yang recaps findings from recent literature showing that evaluating models across diverse tasks—specifically examining around 22 distinct evaluation aspects across multiple datasets—consistently demonstrates that using a language model as a grader correlates significantly better with human judgment than traditional metrics do. The central takeaway holds steady: broader benchmark expansions across newer, larger models continue to affirm the efficacy of LLM judges.

```mermaid flowchart TD accTitle: Open-Ended Story Evaluation Setup accDescr: Identical instructions and stories are given to expert raters and an LLM judge across four criteria to measure alignment and stability. subgraph Input["Input Context"] P["Prompt: Short Description"] S["Model-Generated Story"] end subgraph Judges["Parallel Evaluators"] H["Expert Human Raters"] M["LLM as a Judge"] end subgraph Criteria["Evaluation Rubric"] C["Grading on 4 Open-Ended Criteria"] end P & S --> H P & S --> M H --> C M --> C ```

He then points to work addressing the core research question behind LLM judges: reliability and variance. Because human evaluations are notoriously unstable, expensive, and difficult to reproduce, researchers designed experiments to test whether an LLM judge exhibits human-level variance when presented with the exact same judgments. Researchers gave the language model identical instructions, few-shot samples, and rubrics alongside expert raters on open-ended tasks such as story generation. Evaluators were presented with a short premise and the generated narrative, grading them across four distinct criteria. The results proved that LLM judges are highly aligned with human experts and remarkably stable in their scoring outputs; however, they displayed a distinct failure mode by being significantly more lenient on "unnatural text."

Yang notes that this finding connects directly to the phenomenon of model self-preference: - “Does Opus 5.5 grade its own stuff better, you know, compared to other models, right?” - Recent literature confirms that models typically show an innate bias toward their own generations over outputs produced by rival models.

---

[42:08](https://www.youtube.com/watch?v=J61-q-mk9y0&t=2528s) The Three Questions of Human Preference and Reward Hacking

Yang transitions from asking whether LLMs outperform traditional NLP metrics to investigating whether language models can represent human preference as a whole. This line of research tackles three sequential questions: 1. Can a judge model be learned directly from human preference data via post-training or data interventions? 2. Can a prompted language model stand in for human annotators and operationalize those preferences? 3. If an LLM is used as an annotator stand-in, how reliable is it in practice?

```mermaid flowchart LR accTitle: Three Questions of Modeling Human Preference accDescr: Three sequential stages from learning preferences to operationalizing them and measuring reliability. Q1["1. Learn Judge<br/>(Post-training from human preferences)"] Q2["2. Operationalize<br/>(Prompted LLM as human stand-in)"] Q3["3. Measure Reliability<br/>(Judge robustness & bias checks)"] Q1 --> Q2 --> Q3 ```

A student asks Yang to clarify what was meant by "unnatural text." Yang explains that it often takes the form of reward hacking:

> “What they found with summarization and with some language model responses is that a language model grader will be biased towards longer responses.”

If an evaluation rubric fails to constrain length, a generation model quickly learns that simply repeating a single-sentence summary three to ten times scores far higher with an LLM judge than providing a clean, concise single-sentence summary. While human notions of "unnatural" can be subjective and gray, extreme repetition is universally recognized by human raters as defective, whereas naive LLM judges frequently reward it due to length bias.

---

[45:01](https://www.youtube.com/watch?v=J61-q-mk9y0&t=2701s) Early OpenAI Preference Modeling and the Roots of RLHF

Yang observes that much of this foundational preference-modeling research dates back to early work published at NeurIPS by OpenAI when it operated primarily as a research non-profit. This body of work served as the direct precursor to Reinforcement Learning from Human Feedback (RLHF), establishing how to move beyond basic Supervised Fine-Tuning (SFT) and instruction tuning into post-training through preference-based rewards.

```mermaid flowchart TD accTitle: Preference Reward Model Training Pipeline accDescr: Pipeline collecting pairwise comparisons, building tuple datasets, training a reward model, and using it for reinforcement learning. subgraph Data["1. Pairwise Collection (Arena Style)"] A["Model Generation A"] B["Model Generation B"] H["Human Preference Label"] A & B --> H end subgraph Tuple["2. Dataset Construction"] T["Training Tuples:<br/>(Output 1, Output 2, Preferred)"] H --> T end subgraph RM["3. Reward Modeling & RL"] R["Reward Model<br/>(Trained to predict human choice)"] RL["Downstream Policy Optimization<br/>(RLHF / GRPO Rewards)"] T --> R R --> RL end ```

Traditional NLP metrics like ROUGE rely on fixed gold references and only serve as crude proxies for quality without directly reflecting what humans care about. The alternative was to train a model whose explicit mathematical objective is predicting which output a human prefers.

- Pairs of candidate responses ($A$ and $B$) are sampled for a given prompt, mimicking large-scale platforms like Chatbot Arena (LMSYS) and MT-Bench. - Human annotators review both outputs and mark their preference, yielding structured dataset tuples: `(output_1, output_2, preferred_label)`. - A reward model is trained on these tuples to take two generations and output a scalar preference score or classification predicting the preferred option. - Once trained, this reward model acts as the automated scoring function for downstream policy optimization using reinforcement learning algorithms.

[48:54](https://www.youtube.com/watch?v=J61-q-mk9y0&t=2934s) Removing Humans from the Training Loop with Reward Models

John Yang shifts the focus from using LLM evaluators purely for benchmarking to operationalizing preference data directly inside training loops. In open-ended domains like text summarization or joke comprehension, traditional unit tests do not exist. While one could theoretically employ an army of thousands of human raters to score candidate generations in real time, doing so is both prohibitively expensive and technically impractical. Instead, modern alignment pipelines train a reward model on human preference data to act as a direct stand-in for human evaluation.

```mermaid flowchart LR accTitle: RLHF Reward Modeling Loop accDescr: Pipeline showing how candidate model outputs are scored by a trained reward model to generate reward signals for post-training.

subgraph Generation["Generation Step"] Prompt["Input Prompt"] --> GenModel["Language Model"] GenModel --> OutA["Summary Option A"] GenModel --> OutB["Summary Option B"] end

subgraph Scoring["Automated Evaluation"] OutA --> RewardMod["Trained Reward Model\n(Human Stand-In)"] OutB --> RewardMod end

subgraph Feedback["Optimization"] RewardMod --> BestChoice["Select Best Generation"] BestChoice --> RewardSig["Reward Signal"] RewardSig --> GenModel end ```

The underlying concept is straightforward: the model generates multiple candidate solutions, and the reward model selects the best candidate, returning a scalar reward to guide post-training. Yang points out that while previous studies validated automated metrics primarily as standalone verification mechanisms, this line of work demonstrates that automated verifiers can scale successfully to train models that reliably follow human tastes. As Yang puts it:

> “TL;DR, I train a model on human preferences and use that to provide reward signal when I do post training on a separate language model and I show that sort of the language model gets better at generating text that you and I really like.”

- The early prototypes demonstrated on single tasks like summarization quickly proved that reward models could replace human raters in RLHF training loops. - Theoretical alternatives, such as having 10,000 human annotators on standby to score streaming generations, fail immediately due to latency and cost. - Validating automated verifiers as scalable reward signals opened up preference-driven post-training across NLP.

---

[51:14](https://www.youtube.com/watch?v=J61-q-mk9y0&t=3074s) From InstructGPT to RLHF Across Open-Ended Tasks

Yang notes that the NLP community frequently relies on a familiar playbook: refine a technique on a narrow problem like summarization, then rapidly expand it to the entire spectrum of open-ended text generation. InstructGPT served as the milestone demonstration of this expansion, moving beyond single-task reward learning to handle diverse user instructions.

Although different papers illustrate their Reinforcement Learning from Human Feedback (RLHF) architectures with distinct diagrams, Yang stresses that they are fundamentally identical under the hood: collect comparison annotations, train a reward model to capture those preferences, and update the generator. The real nuance lies in how the grading problem is framed. Depending on the task, reward signals can be derived from pairwise comparisons, absolute rubrics, or fine-grained criterion scoring. The reward model's training objective is then adapted to accommodate these varied preference formulations.

> “So before summarization on the right, as you can see, we can throw a lot of different kinds of open-ended text generation problems and it will work.”

- StructGPT and InstructGPT scaled reward-guided training from single tasks to generalized instruction following. - Automated judge grading can be formulated as preference ranking, multi-criteria rubric evaluation, or point scoring, with the reward model adapted accordingly. - The core recipe remains consistent across domains: gather comparison data, train a reward proxy, and optimize the generation model via reinforcement learning.

---

[52:54](https://www.youtube.com/watch?v=J61-q-mk9y0&t=3174s) Chatbot Arena, Judge Biases, and Position Inconsistencies

Turning to the Chatbot Arena paper (Zheng et al., *Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena*), Yang underscores that its primary research contributions lie in formalizing different evaluation paradigms—such as pairwise comparisons versus single-answer grading, and reference-guided versus reference-free grading—while providing rigorous confidence intervals for LLM judge reliability against actual human crowdsourced votes.

A critical finding highlighted in the paper is that LLM judges suffer from systematic, unwarranted biases. The most prominent is position bias: when presenting an LLM judge with two candidate outputs, Answer A and Answer B, simply swapping their presentation order (making A become B and B become A) frequently leads the model to flip its decision, revealing a heavy favoritism toward whichever candidate appears first. Yang explains that researchers later identified an entire taxonomy of spurious signals that distort automated grading:

| Judge Bias Type | Manifestation | Primary Mitigation Strategy | |:--- |:--- |:--- | | **Position Bias** | Model favors the first presented candidate (Answer A over Answer B). | Swap candidate order across repeated runs or train with symmetric, randomized prompt orderings. | | **Verbosity / Length Bias** | Model favors longer, more verbose responses over concise, correct ones. | Normalize outputs by length or include explicit brevity instructions in the grading rubric. | | **Ordering / Spurious Heuristics** | Model latches onto arbitrary formatting signals rather than underlying factual correctness. | Expand fine-tuning datasets with counter-examples to eliminate heuristic shortcuts. |

Yang emphasizes that suppressing these systematic quirks does not require complex redesigns:

> “I think with a lot of these things like the intervention to suppress these kinds of bad preferences is actually quite simple, right? Like you can then create like a whole dataset of Q and A questions like this and take the same question and like mix up the order of what you're supposed to prefer and you just kind of like use data to like, you know, whack-a-mole this kind of behavior out.”

In addition, Chatbot Arena gamified crowdsourced model evaluations across an unconstrained, organic distribution of real-world prompts. The study demonstrated that LLM-as-a-judge alignment with human consensus generalizes remarkably well across vastly different query domains, including programming, mathematical problem-solving, and information extraction. Yang observes that while broad domain transfer is taken for granted today, the community was far more skeptical of general transferability when these benchmark papers first appeared.

---

[56:56](https://www.youtube.com/watch?v=J61-q-mk9y0&t=3416s) Open-Source Rubric-Based Judges (AutoMetrics & Critique Models)

Yang concludes the segment by discussing efforts to bring robust evaluation capabilities to open-source foundation models. Early foundational work on RLHF and model-based judging was developed primarily behind closed doors at OpenAI using proprietary models such as GPT-3 and its successors. Subsequent contributions—including work from researchers at Carnegie Mellon University—democratized this process by publishing concrete recipes, datasets, and architectures designed specifically to train open-weight models as fine-grained rubric judges.

These modeling papers demonstrate how open-source models can evaluate candidate outputs against fine-grained, user-defined rubrics rather than basic scalar preferences. When evaluating these models, researchers commonly produce correlation heatmaps comparing judge predictions against ground-truth human annotations across various instruction-following benchmarks. Yang highlights that the goal of a modeling paper in this space differs from a benchmark paper: the focus is not merely reporting who wins on a static leaderboard, but proving that an open training paradigm produces a judge model whose rubric scores remain robust, transferable, and closely correlated with human evaluations across diverse domains.

> “With a modeling paper, you typically want to show that like hey, you know, like my model is like comparable to the state of art and the training paradigm that I've put forth is generalizable and it works well for all sorts of different kinds of instruction.”

- Open-source judge efforts systematize the RLHF reward training pipeline, giving developers direct control over fine-grained evaluation rubrics. - Heatmap visualizations in these studies quantify correlation matrices between human ratings and model evaluations across distinct instruction datasets. - Modeling-focused research emphasizes the generalizability and robustness of the training recipe over static leaderboard rankings.

[58:51](https://www.youtube.com/watch?v=J61-q-mk9y0&t=3531s) Rubric Formats: Pairwise Comparisons vs. Independent Pointwise Scoring

John Yang opens with a brief recap on benchmark overfitting before concluding the section on LLM-as-a-judge rubrics, noting that benchmarks must be designed broadly rather than overfit to one specific task. He points out that, as seen earlier with Prometheus and RLHF, there are fundamentally distinct paradigms for structuring grading rubrics. On the right side, there is the familiar pairwise comparison approach, where an LLM judge directly compares two outputs and declares a preference. On the left side, the judge is prompted to generate independent scores for each candidate output separately, and those numerical or categorical scores are compared post hoc.

Yang observes that the literature does not decisively favor one paradigm over the other: “I think it's there's no at least I haven't seen any paper that sort of clearly shows that like one is better than the other.” Instead, researchers develop these diverse rubrics to show that whether you require an absolute numerical rating or a relative preference, the downstream training or alignment objective can successfully ingest preference data formatted in multiple ways. With about twenty minutes left in the lecture, Yang wraps up this foundational discussion, checks for audience questions, and transitions into the final, most experimental topic.

[01:00:17](https://www.youtube.com/watch?v=J61-q-mk9y0&t=3617s) LLM-as-an-Agent Graders: Moving Beyond Static Text Outputs

Yang introduces what he considers the most cutting-edge, rapidly evolving paradigm in evaluation: using language model agents to grade other language model agents. Up to this point, traditional judge setups assumed the model produced a static text artifact—such as a summary, an essay, or a code snippet—and the evaluator merely assigned a rating or selected the better text. However, frontier models are capable of far more complex digital actions than producing isolated text strings.

To illustrate why static text grading falls short, Yang offers a tangible example: evaluating an agent tasked with building a Minecraft clone. If an agent writes an entire browser-based reproduction of Minecraft, an evaluation system cannot simply dump thousands of lines of source code and assets into an LLM's context window and ask whether it works. An agent's problem-solving capability should be mirrored on the evaluation side: “In the same way that language models are sort of agents when they come to solving the problem, why not make language models agents when they go about grading the problem, right?” A grading agent can dynamically interact with the running artifact—clicking buttons, navigating across menus, checking game mechanics, evaluating visual aesthetics, and ensuring that complex button combinations trigger the expected game logic.

```mermaid flowchart TD accTitle: Static vs Agentic LLM Evaluation accDescr: Contrast between feeding raw code into a context window and using an interactive agent to grade a running environment.

subgraph Static["Static Context Evaluation"] S1["Generated Code / Artifact"] -->|"Dump full codebase"| S2["LLM Context Window"] S2 -->|"Static Text Inspection"| S3["Pass / Fail Judgment"] end

subgraph Agentic["Agentic Interactive Evaluation"] A1["Running Game / Web App"] <-->|"Click buttons, test UI"| A2["LLM Evaluator Agent"] A2 -->|"Observe visual state"| A3["Trajectory Verification"] end ```

Beyond testing interactive products like games, this shift raises two central evaluation questions: - Can an LLM judge determine whether an agent succeeded simply by inspecting its execution trajectory (e.g., from SWE-bench or Terminal-Bench) without having access to ground-truth unit tests? - Can the LLM act as an autonomous grading agent that performs its own validation rollouts reliably? - Rather than only inspecting the static end-state of an environment, evaluators can now grade the step-by-step problem-solving sequence itself.

[01:03:11](https://www.youtube.com/watch?v=J61-q-mk9y0&t=3791s) WebVoyager: Interactive Web Evaluation and Source-Code-Free Verification

Yang discusses WebVoyager as one of the pioneering papers tackling this problem within web-agent benchmarks. He frames the core evaluation dilemma using an everyday scenario: suppose you want to grade an agent on its ability to recreate a complex service like `airbnb.com`. If you had Airbnb's proprietary source code, you could write deterministic unit tests against it and check the agent's code. But in the real world, proprietary internal source code is unavailable; only the public-facing, interactive web interface is accessible.

WebVoyager circumvents this limitation by using agentic interaction as verification. A user or agent can perform actions on the reference site—such as navigating to `airbnb.com`, logging in, setting booking dates, and toggling price filters. That resulting sequence of clicks and state changes forms an executable "grading trajectory." That exact trajectory can then be replayed against the candidate's cloned website to verify whether the simulated functionality behaves correctly, completely eliminating the need for reference source code.

Methodologically, this builds on architectures like WebArena, utilizing scraping and automation frameworks like Selenium or BeautifulSoup: - The web page is ingested and parsed to identify interactive elements, generating bounding boxes and clickable coordinates. - Each action captures screenshots alongside the structural Document Object Model (DOM) metadata as the agent navigates across pages. - A multimodal LLM judge then reviews the complete trajectory of screenshots, actions, and the final output to render a verdict.

Yang points out that WebVoyager's ablation studies reveal critical insights into multimodal grading. When researchers stripped away the screenshots and provided only textual metadata, or when they ablated specific tool inputs, evaluation accuracy dropped. Yang emphasizes that practitioners implementing agentic graders must carefully decide which artifacts—visual frames, DOM states, tool logs, or raw text—to feed into the judge model to ensure high agreement with human evaluators.

[01:06:58](https://www.youtube.com/watch?v=J61-q-mk9y0&t=4018s) Computer-Use Evaluation: Replacing Human Verification in OSWorld

Building on web-agent benchmarking, Yang moves to general computer-use evaluation and OS-level agents. In environments like OSWorld, existing benchmarks depend heavily on labor-intensive, handcrafted verification scripts and custom rule checks created by human annotators. Yang explains that researchers are now asking: “Can a model like judge a trajectory and use that to improve the agent?”

If an LLM judge can reliably review an OS-level trajectory—pinpointing exactly where an agent went off track during a multi-step task—it eliminates the bottleneck of human-written unit tests. Furthermore, that trajectory-level evaluation can instantly provide an automatic reward signal or corrective feedback, allowing practitioners to optimize and improve the underlying agent without writing manual test suites for every digital environment.

[01:08:04](https://www.youtube.com/watch?v=J61-q-mk9y0&t=4084s) Evaluating Agent Trajectories and Agent-as-a-Judge

Building on earlier discussions of reward models, John Yang revisits how to evaluate arbitrary agent trajectories across complex user instructions using domain-general neural models. He contrasts two architectures for handling multimodal environments like web navigation: 1. **Caption-then-reason**: A weaker Vision-Language Model (VLM) inspects screenshots to generate descriptive text annotations of what is happening on screen, after which a pure language model reasons over those text annotations to decide whether the agent succeeded. 2. **Direct end-to-end VLM evaluation**: Bypassing optical character recognition (OCR) and intermediate textual descriptions altogether by tasking a strong vision model with directly scoring the visual trajectory.

```mermaid flowchart TD accTitle: Two Approaches to Trajectory Evaluation accDescr: Diagram contrasting the caption-then-reason pipeline with direct vision-language model trajectory evaluation.

subgraph CTR["Caption-then-Reason"] A["Agent Screenshots"] --> B["Weaker VLM<br>(Annotates / OCR)"] B --> C["Text Reasoning Model<br>(Judges Success)"] end

subgraph Direct["Direct Trajectory Evaluation"] D["Agent Screenshots"] --> E["Strong VLM<br>(Direct Judgment)"] end ```

Yang illustrates this with an example where an agent clicks and scrolls through a web trajectory to fulfill a user request to post "LGTM" (Looks Good To Me). Even though the execution ended in an exception or an early stop, the evaluator correctly recognized that the primary intent was satisfied. However, Yang cautions that findings across web tasks and coding agent benchmarks reveal a major limitation: “models are actually not particularly good out of the box at determining, given a trajectory, did the model sort of succeed at the task, right?” Evaluating full operational traces remains substantially harder than anticipated. He briefly mentions the "Agent-as-a-Judge" benchmark, which expands beyond web environments into domains such as software engineering. While these agent-evaluators align reasonably well with human preferences when paired with comprehensive rubrics per query, they still struggle with consistency.

---

[01:11:00](https://www.youtube.com/watch?v=J61-q-mk9y0&t=4260s) Biases in LLM Judges: Position and Verbosity

When utilizing an LLM as a reward model or automated grader, evaluators must ensure that the scores reflect genuine quality rather than systemic model artifacts. Yang highlights two primary biases:

1. **Position Bias**: In pairwise comparisons, models frequently favor whichever candidate answer appears in a specific position (e.g., first or second). Simply swapping the presentation order of responses reveals that model judgments are often inconsistent across permutations. While recent literature introduces mathematical formalizations and prompting schemes to counterbalance this, baseline consistency remains fragile. 2. **Length / Verbosity Bias**: Following early efforts in AlpacaEval to replace human crowdworkers with automated judges like GPT-4 or GPT-4o mini, research led by Jan Leike identified severe verbosity bias. If length is unconstrained, reward models systematically assign higher scores to longer, more verbose completions regardless of conciseness or substance. Yang notes: “if you don't constrain the length of the summarization or the length of the model's output that uh your reward model is going to start sort of training and biasing it like be trained in a way where it's like biased towards the length of the completion and longer answers are better, right?” Applying length penalties during benchmarking and post-training instruction alignment normalizes these inflated scores.

---

[01:13:41](https://www.youtube.com/watch?v=J61-q-mk9y0&t=4421s) AutoMetrics: Bootstrapping Judges from Limited Human Data

Addressing open-ended text evaluation where simple rule-based metrics fall short, Yang introduces *AutoMetrics* (co-authored by course co-instructor Michael Ryan). Standard evaluation setups require collecting expensive pools of human preference votes for every new task family. AutoMetrics tackles the cold-start problem: bootstrapping an automated evaluator using only a tiny handful of labeled human examples.

The method maintains a broad "metric bank" encompassing diverse evaluation criteria. From this pool, the pipeline selects, filters, and customizes a specialized sub-metric combination that correlates closely with the target human population's judgments for that specific task. Yang describes it as a lightweight, few-shot alternative to training monolithic reward models from scratch, allowing teams to quickly spin up custom-tailored grading suites.

---

[01:15:47](https://www.youtube.com/watch?v=J61-q-mk9y0&t=4547s) Measuring Non-Determinism: pass@k

Shifting away from LLM-as-a-judge specifically, Yang turns to reporting aggregate benchmark metrics when agents undergo multiple rollouts. Given stochastic generation across $k$ attempts, researchers must quantify whether a system's failure reflects fundamental capability limits or sampling variance.

Yang highlights $\text{pass}@k$, popularized in the OpenAI HumanEval coding benchmark. He advises students that $\text{pass}@k$ is especially suited for Homework 2 “if you find that like uh you are challenging the language model with a task that is fundamentally quite difficult and you just care that it passed at least once, right?” To prevent the metric from depending on the specific order in which completions were sampled, $\text{pass}@k$ is computed using an unbiased combinatorial estimator based on drawing $n \ge k$ total rollouts and calculating the expected probability that at least one of a randomly drawn subset of $k$ rollouts succeeds.

[01:17:07](https://www.youtube.com/watch?v=J61-q-mk9y0&t=4627s) Measuring Reliability: pass@k vs. pass^k and the Limits of Average Scores

John Yang breaks down how to formally quantify evaluation when running multiple non-deterministic trials of an AI agent, comparing the standard `pass@k` metric against `pass^k`. Taking a concrete setup where an evaluator performs $n = 5$ total rollouts and sets $k = 3$, he explains the logic of calculating an unbiased estimator. As John Yang puts it: “And so the idea here is that like your pass at three basically means like hey, if we do three runs, like how many times does it pass at least once out of those three?” By evaluating combinations across the $n$ samples, the metric produces a stable score that remains completely agnostic to the arbitrary ordering of the trials.

In contrast, `pass^k` represents the inverse requirement and captures strict reliability, which is essential for environments like customer service benchmarks such as $\tau$-bench ($\text{tau-bench}$). Instead of seeking a single successful outcome, `pass^k` measures the probability that every single one of the $k$ sampled trials results in a pass. Yang illustrates why reporting a simple average across trials obscures critical agent behaviors: two agents, Agent A and Agent B, can yield identical average success rates across a benchmark, yet possess entirely different execution profiles. One agent might solve certain tasks consistently and fail others completely, while the other might solve every task with low but non-zero probability. Yang emphasizes: “If you simply report the average it's going to look the same, right? But if you report pass at k versus pass k you'll get very very different numbers for the performance of A and B and so again at the end of the day depends on the task in terms of which one you report um there's not necessarily like uh uh absolutely correct one to use, right?” For high-difficulty reasoning or competitive math where users can throw massive compute at repeated sampling, `pass@k` is ideal because finding the solution once suffices; for mission-critical customer-facing tasks, `pass^k` is necessary because consistency is paramount.

```mermaid flowchart TD accTitle: Evaluation Metrics for Multi-Trial Rollouts accDescr: Flowchart illustrating how n agent rollouts are evaluated under pass@k versus pass^k. subgraph Sampling["Multi-Trial Execution"] R["Run n Rollouts per Task"] end

subgraph Metrics["Evaluation Objectives"] PAK["pass@k Metric"] PPK["pass^k Metric"] end

subgraph Scenarios["Application Fit"] MATH["Hard Math / Code Search<br/>(Throw compute; need 1 success)"] PROD["Customer Service / tau-bench<br/>(Strict consistency across all runs)"] end

R -->|"Subset k: at least 1 pass"| PAK R -->|"Subset k: all k must pass"| PPK PAK --> MATH PPK --> PROD ```

- In Homework 2, students design an evaluation task and observe how running multiple rollouts using models such as Gemini can yield widely varying results. - `pass@k` rewards high variance when paired with search, whereas `pass^k` penalizes variance in favor of consistent correctness.

---

[01:19:30](https://www.youtube.com/watch?v=J61-q-mk9y0&t=4770s) Course Announcements and Upcoming Guest Lecture

Wrapping up the lecture on the final slide, Yang previews the schedule for the upcoming classes in CS329Z. He notes that he will be stepping away for the immediate next sessions: the following week delves into AI safety, while Monday's lecture features a guest presentation by Carlos E. Jimenez and Alex Wettig, co-creators from the original SWE-bench team. Yang explains that he will return to the podium one last time after Thanksgiving to deliver the dedicated lecture on coding agents, before thanking the class to conclude the session.

## Notable quotes > [10:19](https://www.youtube.com/watch?v=J61-q-mk9y0&t=619s) It's not the case that like you know, if you just turn the temperature to zero or something like that, that every time you run the model on this agent task, it's going to arrive upon the same solution every single time. — John Yang

> [01:00:17](https://www.youtube.com/watch?v=J61-q-mk9y0&t=3617s) In the same way that language models are sort of agents when they come to solving the problem, why not make language models agents when they go about grading the problem, right? — John Yang

## Mentioned Agent-as-a-Judge, Airbnb, Alex Wettig, AlpacaEval, Anthropic, AutoMetrics, BERT, BLEU, BM25, BeautifulSoup, BrowserGym, Carlos E. Jimenez, Carnegie Mellon University, Chatbot Arena, Claude 3.5 Opus, Co-Gym, CS329Z, Diyi Yang, ELMo, G-Eval, GDP-Val, GPT-4, GPT-4o mini, GPTScore, Gemini, HumanEval, InstructGPT, Jan Leike, John Yang, LMSYS, MMLU, MT-Bench, Michael Ryan, Minecraft, Mina Lee, OSWorld, OpenAI, Opus 5.5, Program-Bench, Prometheus, ROUGE, SWE-agent, SWE-bench, SWE-bench Multilingual, SWE-bench Verified, SWE-smith, Selenium, Stanford University, SuperGLUE, T5, Tau^2-Bench, Terminal-Bench, TerminalBench Science, WebArena, WebVoyager, tau-bench

## Video description Browse Stanford's online courses in Agentic AI: https://stanford.io/4AIRb2z

Can you trust an LLM to grade your AI agent? In this Stanford CS329Z: Engineering AI Agents lecture, John Yang covers the three types of graders, how to design judge prompts, known LLM-judge biases, pairwise vs. pointwise evaluation, measuring non-determinism with pass@k vs. pass^k, evaluation harness design, and Anthropic's 8-step roadmap for agent evals.

Questions this lecture covers: - What is LLM-as-a-judge? - What biases do LLM judges have? - Should you use pairwise or pointwise evaluation? - What is the difference between pass@k and pass^k?

Chapters:

About the speaker: John Yang is a Computer Science PhD student at Stanford University focused on coding agents. He is a lead creator of SWE-bench, the widely used benchmark for whether language models can resolve real GitHub issues, and of SWE-agent, an open-source agent for autonomous software engineering. He is also first author of SWE-smith, a toolkit that generated 50,000 software engineering training tasks from 128 repositories. He previously studied at Princeton University (MS) and UC Berkeley (BS).

Readings: - Grace et al., “Demystifying Evals for AI Agents,” Anthropic (2026) - Zheng et al., “Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena,” NeurIPS (2023) - Ryan et al., “AutoMetrics: Approximate Human Judgements with Automatically Generated Evaluators,” ICLR (2026)

Course website: https://cs329z.stanford.edu/ Watch the full CS329Z playlist: https://youtube.com/playlist?list=PLPRcF5HR02_U&si=3Z4OYphngcmQ0GIy

Recorded 11/11/2026 in CS329Z: Engineering AI Agents, a graduate course at Stanford University taught by Diyi Yang, Michael Ryan, and John Yang.

#AIAgents #LLMasJudge #AIEvals

[Source](https://www.youtube.com/watch?v=J61-q-mk9y0)

Reading summary

In Stanford CS329Z, John Yang examines the design of evaluation harnesses for AI agents, analyzing the progression from deterministic unit tests to LLM-as-a-judge and dynamic agentic verification. Programmatic Unit Tests and Their Failure Modes (4:06) Deterministic programmatic verification remains computationally cheap, highly expressive, and free of runtime human or API grading costs, as seen in benchmarks like HumanEval, SWE-bench, and Terminal-Bench. It can assert on database state updates, as in tau-bench, or verify complex domain-specific outputs like 32-character nucleotide sequences in science benchmarks. By elevating verification from code structure checks to executable binary evaluation against standard output—as demonstrated in Program-Bench—evaluators grant models greater architectural freedom. Test Suite Brittleness and Incomplete Verification (8:44) Despite their operational advantages, unit-test harnesses suffer from staticness, rapid saturation, and partial coverage. Yang highlights findings from 'The SWE-bench Illusion,' where candidate patches passed issue-specific test sub-selections while breaking untested portions of the broader codebase. Additionally, rigid programmatic assertions risk penalizing creative, valid outputs, a vulnerability demonstrated when frontier model evaluations on Tau^2-Bench misclassified high-quality alternate solutions as failures. LLM Judges and Systemic Evaluator Biases (27:46) To evaluate open-ended outputs where deterministic unit tests fail, evaluators employ LLM judges across pointwise rubrics and pairwise comparative frameworks. Early methods like G-Eval and GPTScore addressed the rigid semantic blind spots of n-gram overlap metrics (such as BLEU and ROUGE) across diverse evaluation dimensions, laying the groundwork for reward models in reinforcement learning from human feedback (RLHF). However, LLM evaluators introduce systematic distortions, notably verbosity bias—which favors excessively long responses—and position bias, where swapping the presentation order of candidate answers causes the judge to reverse its decision. Agent-as-a-Judge and Interactive Artifact Verification (60:17) Because feeding entire multi-file codebases into a static context window cannot reliably assess complex dynamic artifacts like a Minecraft clone or an Airbnb front-end, verification is shifting toward agentic evaluators. Frameworks like WebVoyager replay interaction trajectories—capturing screenshots, Document Object Model (DOM) metadata, and action coordinates—to grade systems without requiring proprietary underlying source code. Multimodal models then review visual traces or use caption-then-reason workflows to verify task completion across operating-system and web environments, such as OSWorld. Statistical Metrics for Multi-Run Non-Determinism (12:16) Because multi-turn agent rollouts diverge even when running at temperature zero, single average scores obscure critical reliability profiles. To measure variance across multiple runs, benchmarks apply combinatorial pass@k estimators to compute the probability of achieving at least one success across k attempts, which is well-suited for difficult research breakthroughs. Conversely, reliability-critical deployments like customer support apply pass^k, requiring an agent to succeed across all k consecutive trials to ensure deterministic consistency. While LLM-as-a-judge and interactive agent verifiers overcome the inflexibility of static code assertions in open-ended and multimodal tasks, models remain brittle out of the box when evaluating complex trajectories and require careful rubric design to counter systematic judge biases.

Source quotes

[10:19] John Yang: It's not the case that like you know, if you just turn the temperature to zero or something like that, that every time you run the model on this agent task, it's going to arrive upon the same solution every single time. [60:17] John Yang: In the same way that language models are sort of agents when they come to solving the problem, why not make language models agents when they go about grading the problem, right?

Original transcript

[0:05] We're going to talk a little bit about [0:07] uh language models being used as judges [0:10] um and also just sort of details related [0:13] to evaluation. So just as like a little [0:16] bit of a rehash um last time we talked a [0:19] lot about benchmarks and we got into the [0:21] nitty-gritty of sort of like how they [0:23] generally work uh the environment, the [0:25] problem statement, the verification, [0:27] these sort of general three building [0:29] blocks um and then how that template is [0:32] very conducive to then seeding very sort [0:34] of practical types of task and [0:36] evaluations um in coding and web use and [0:40] computer use, you know, everything like [0:42] that, right? Um so today what we're [0:44] going to do is we're going to zoom in on [0:47] verification very specifically and we're [0:50] going to just sort of really closely [0:51] inspect sort of like what makes [0:53] verification tick. Um so in the first [0:56] seven minutes we'll talk a bit about why [0:58] we even care about verification in the [1:00] first place, like why is this important. [1:02] Um I think everybody already has like a [1:04] pretty good idea of why um but [1:07] then we'll take a look at different [1:09] types of graders. Um so maybe you kind [1:11] of remember this from the prior lecture [1:13] already uh but we kind of alluded to how [1:15] with different benchmarks there's [1:17] different metrics you can use to report [1:19] model performance. Um to develop those [1:22] metrics uh there's different types of [1:24] grading that you can apply. Um so is [1:27] this unit testing? Um is this sort of [1:30] with something like LM Arena or uh with [1:32] chatbots? Like are you doing human [1:34] preference voting? Um and you know, [1:37] there's only so many people and so much [1:38] time that those people can spend on [1:40] grading. Um can we potentially use [1:43] language models um as a stand-in? Um and [1:46] I think that idea started out as like a [1:48] pretty simple concept um [1:50] in NLP literature. So even as far back [1:53] as like 2019, 2018 we were already [1:56] thinking about these things sort of in [1:58] the more modern of Transformers being [2:00] the main uh language model. [2:04] Um but we'll kind of look at very [2:06] quickly how you know LM as a judge uh [2:10] manifests in different ways from purely [2:12] just sort of like hey can we replace [2:14] things like blue score and rouge and [2:17] these like very uh traditional kind of [2:20] compare this block of text with this [2:22] block of text in terms of like semantic [2:24] similarity um to things that are a [2:26] little bit deeper and more oriented [2:27] around human preference and that sort of [2:30] prefaced a lot of the stuff that led to [2:31] RLHF and led a lot to sort of like [2:34] reward models um that resemble human [2:36] preference um and then [2:39] we'll take a look at sort of the more [2:41] recent uses of LM as a judge where [2:45] beyond preferences now the judge is [2:47] actually agentic right? So if you want [2:49] to grade a model on its ability to [2:52] create a website or something like that [2:54] um you know maybe just having a bunch of [2:56] deterministic unit tests it's very [2:59] exhaustive. There's certain aspects of [3:01] the website that are not necessarily uh [3:04] sort of constrained to like specific [3:06] right answers um and so maybe in those [3:08] settings you want an agent to actually [3:10] play with the website or play with the [3:12] artifact that was generated as a way to [3:14] do grading um and then we'll talk about [3:16] sort of the problems with respect to you [3:18] know models are not perfect like you [3:20] know there's people and then there's [3:22] models and these models try to emulate [3:24] people uh but there's some certain [3:26] issues that might come up in terms of [3:27] biases. How do we kind of establish good [3:30] ways to test that models are consistent [3:34] in their grading and that they are [3:35] aligned with human preference right? And [3:38] then last but not least we'll also kind [3:39] of talk about um non-determinism which [3:42] is more separate from language model as [3:45] a judge that is kind of like quickly [3:47] pivots back into this question of like [3:50] okay once you've run your verification [3:52] and you have scores um if you have one [3:55] task and you run the model on that task [3:58] multiple times how do you actually sort [4:00] of report performance uh when you have [4:02] sort of multiple samples on a task. [4:05] Cool. [4:06] As usual, like please feel free to stop [4:08] and ask questions whenever. Um but okay, [4:11] let's start with the motivation. So [4:12] hopefully this chart um is becoming like [4:15] uh all too familiar. Um this is in your [4:17] homework two as well in case people have [4:19] started homework two. Um and hopefully [4:22] with homework two you're also kind of [4:24] getting some experience with like [4:25] running a harbor task and like uh [4:28] getting exposed to what different coding [4:30] benchmarks actually look like. Um and so [4:33] um today [4:34] we're going to focus on the verification [4:36] section, right? So to motivate it a [4:38] little bit um in your homework you have [4:41] engaged with three benchmarks uh or you [4:45] will. Uh human eval, swe-bench, and [4:48] terminal bench. Um these are like uh [4:51] pretty representative of sort of the [4:52] broader lineage of coding benchmarks [4:55] since like 2021. Um and so [4:59] as with in the prior lecture you've also [5:01] noticed at this point with data and with [5:03] our benchmarks that uh pretty much a lot [5:06] of the verification for coding related [5:08] tasks is going to be unit test oriented, [5:11] right? Which is like pretty natural. Um [5:13] they occur in the wild um in production [5:16] and in many ways when we do coding like [5:19] we do test driven development, we you [5:21] know write all sorts of tests, unit [5:24] tests, integration tests, end to end [5:26] testing. Um and so early on for a lot of [5:29] benchmarks unit tests or sort of more [5:32] broadly speaking like programmatic [5:35] coding based tests are pretty good [5:37] because they're deterministic. Once you [5:40] generate them unlike a language model or [5:42] a human you don't need to kind of pay uh [5:44] this entity again to do regrading, [5:46] right? You just rerun the test. Um [5:48] generally coding is very very [5:50] expressive. So as with these three [5:52] columns like out of these swe-benches [5:54] technically the only one that's really a [5:56] coding task, right? We talked about [5:58] tau-bench which is the one with like a [6:00] simulated user in the loop and for there [6:03] you know you can apply unit tests to [6:05] check that [6:06] the database um [6:08] that was modified um ends up in sort of [6:12] an end state that has certain properties [6:14] like, oh, your user wanted to cancel an [6:16] order or something like that, then look [6:18] at the database and check whether that [6:19] particular record or row corresponding [6:22] to that order has like a canceled [6:23] status. You can encode that easily as a [6:26] unit test. And the same is for browser [6:28] comp, right? For anything where like [6:29] you're looking for an an exact match um [6:32] I mean stemming from like even [6:33] examination style benchmarks uh where [6:36] you're just looking for one right answer [6:39] um it's very easy to sort of codify [6:41] these checks as programmatic things. Um [6:44] but of course uh they're not entirely [6:47] comprehensive for a couple reasons, [6:49] right? So one of the first ones is that [6:51] yes, they're deterministic. You can [6:53] check exact things. A lot of tasks don't [6:56] have exact solutions as we've seen a lot [6:59] in this class. The the big um sort of um [7:03] recurring example being instruction [7:05] following, right? Like we created [7:07] Chatbot Arena um to have sort of more [7:10] open-ended questions be a form of [7:13] evaluation. And in that case um both the [7:16] creation of the question and also the [7:18] grading um is very very fickle and very [7:20] sort of like specific to the person that [7:23] created it or like the subpopulation um [7:25] that is being asked to grade these [7:27] questions. And so there's plenty of [7:29] examples of tasks that have sort of good [7:32] motivations like um but you know are are [7:35] not sort of like, hey, there's just this [7:37] one canonical reference solution. Um [7:40] beyond this um I think you can imagine [7:42] that like in the same way that we've [7:44] talked about this idea of like a model [7:47] sort of um you know the distribution of [7:50] tasks that that is difficult for a model [7:52] kind of changing over time or changing [7:55] as you do post training. Even here [7:56] there's tasks where like maybe the [7:59] answer is going to change with time or [8:01] with some sort of like evolving thing, [8:03] right? Like the the simplest example is [8:05] like if you do actually have web [8:08] browsing um as a component um in your [8:11] task, well, if I run a Google search [8:14] action like today versus like four years [8:16] ago with the same query, I'm going to [8:18] get different things, right? So you can [8:20] certainly try to sort of make [8:21] environment adjustments to make sort of [8:23] the query engine and the things that it [8:26] produces fixed. Uh but sometimes that's [8:28] quite difficult. Um so you want your [8:30] grading to kind of be more robust to [8:32] these potentially non-deterministic kind [8:35] of evolving um [8:37] noise or signal, you know, um [8:40] over time. Cool. Okay. Um and to another [8:44] thing that we'll talk about today is [8:45] that um similar So in the vein, but not [8:49] quite exactly like the reward hacking [8:51] stuff that we've talked before, uh you [8:53] know, then we kind of hammered on this [8:55] idea that you want to make sure that [8:57] hey, your verification is like very well [8:59] aligned with your problem statement, [9:01] right? And that is echoed here as well. [9:03] Uh verification is certainly very [9:05] important because beyond the alignment, [9:06] it just it does need to be good. And so [9:08] like you want your your verification to [9:11] ultimately [9:12] grade things that are actually correct [9:14] to be marked as correct and the things [9:16] that are wrong to be actually marked as [9:17] wrong. Conceptually, this sounds very [9:19] very simple. Um in practice, it is [9:22] important to pay attention to this uh [9:24] because like, you know, you have some [9:25] examples. So for Swe Bench, um there was [9:27] a paper called like the Swe Bench [9:29] Illusion um tagged here if you want to [9:31] look at it later. Uh but the idea here [9:33] is that they found that okay, according [9:35] to um if you actually run the the [9:39] proposed solution on all of the tests in [9:42] the code base, you'll find that um the [9:45] model solution actually fails. The [9:47] problem with Swe Bench's task [9:49] construction is that because sometimes [9:53] you have a repository where running the [9:55] whole test suite takes a very long time [9:58] or there are some tests native to the [10:01] repository that are just kind of flaky [10:04] or even those test might itself might [10:06] have some issues with them and they're [10:08] sort of over calibrated to, you know, [10:11] some some details in the repo. The point [10:13] being that, maybe you know, the [10:15] solution's actually incorrect, but then [10:18] if the grader if it only runs sort of a [10:19] partial set of tests, then you know, [10:21] it's going to incorrectly mark that [10:24] solution as as as passing, right? So [10:27] that that's sort of not a great [10:29] situation. On the other hand, [10:31] yeah, if you read that Anthropic blog [10:33] that they released when they put out [10:35] Opus 4.5, they found that you know, like [10:38] for Tau Squared Bench, basically like [10:40] the second version of Tau Bench where [10:42] they kind of expanded to different [10:44] domains and have different kinds of [10:45] interactions, Opus 4.5 came up with a [10:48] good solution that wasn't accounted for [10:50] by its verification, right? So I think [10:52] with evaluation you'll find that like a [10:53] lot of these concepts are quite simple. [10:56] There's nothing mind-blowing about it, [10:58] but it's just sort of having this [10:59] checklist and making sure you have all [11:01] these things in mind, [11:03] it's really important. [11:05] Cool. [11:06] And then we'll talk about this more [11:07] closely with sort of the non-determinism [11:09] section at the end, right? But if you [11:11] have [11:13] a task and you run a model a couple [11:15] times on it, as we've talked about [11:18] before, [11:19] with a lot of agentic tasks, you're [11:21] going to get variation in the outcome. [11:23] It's not the case that like you know, if [11:25] you just turn the temperature to zero or [11:27] something like that, that every time you [11:30] run the model on this agent task, it's [11:32] going to arrive upon the same solution [11:35] every single time. I think if you want [11:37] to understand why that non-determinism [11:39] occurs, it really kind of goes into the [11:41] math that like you know, 336 and some of [11:43] these more canonical language modeling [11:46] courses we'll talk about, but yeah, for [11:48] for this we'll just stop at the [11:50] abstraction that like we know language [11:52] models, even if you turn down the [11:53] temperature to zero, in a multi-turn [11:56] long horizon setting, there is going to [11:59] be some level of like non-determinism [12:01] there, right? And so [12:03] when you have this, let's just say you [12:05] do five rollouts and like two of the [12:08] five the model perfectly solves and [12:10] three out of the five there's some [12:12] issues or it just completely fails. How [12:14] do you actually report that, right? And [12:16] so, you know, there's like sort of three [12:18] um [12:19] techniques we'll take a look at. So, [12:21] yes, you could report the average. Um [12:24] and this probably works quite well if [12:26] the reward for your task is something [12:28] that is binary, like if the task outcome [12:30] is either zero or one, right? But [12:32] imagine your task reward is continuous. [12:35] It's zero to one, not zero or one. Now [12:38] it becomes a question of like, okay, [12:40] well, did you score 40% on all of the [12:42] runs or is it sort of two runs got one [12:45] and three runs got zero, right? And so [12:48] uh that's something that the average [12:49] sort of obfuscates unintentionally. Um [12:52] so you could deal with that with like, [12:54] okay, you have a really hard task and [12:56] all you care about let's say like, you [12:58] know, I I'm sure people are quite [13:00] familiar with like the Navier-Stokes [13:02] Millennium problem, like these sort of [13:04] really incredible things. Yeah, in that [13:06] case, I don't really care if I I solve [13:08] this problem sort of 40% of the time. If [13:11] I just solve the, you know, Millennium [13:13] problem once, that's already insanely [13:16] impressive, right? So maybe you have a [13:17] task where it's less about whether it [13:20] gets it every single time and more about [13:22] whether it even solves it once, right? [13:24] And so um [13:26] this is sort of another way to account [13:28] for variance, which we'll look at, which [13:29] is like pass at k. Um so if folks [13:31] remember like uh the human eval when we [13:35] talked about it last lecture or even [13:36] like in your homework two, uh there [13:38] should be a brief excerpt on why they [13:40] chose to report pass at k, which is to [13:42] account for variance and also because [13:45] they care about the model simply solving [13:47] the coding task at least once. They [13:49] don't care about sort of how reliable it [13:51] is. Now if you use this metric in like a [13:53] customer service setting, that's going [13:54] to be terrible, right? Because you don't [13:56] want your model to just succeed at least [13:58] once on a user query. You want it to [14:00] succeed reliably given the same user [14:02] query, right? Um and so this um is uh [14:06] the the pass k um if you take a look at [14:09] Tau Bench, that's what that benchmark [14:11] piloted, which is like this is a metric [14:13] where we do k rollouts and we only count [14:16] the model as succeeding if on every [14:18] single K-rollout for that task um it did [14:21] well. So if you kind of just draw the [14:24] sort of you know matplotlib curves for [14:27] pass at K and pass carry K you'll see [14:28] that you know with more rollouts like [14:31] you know assuming a model solves a task [14:33] at like 10% of the time then pass at K [14:35] slowly gets higher and higher because [14:37] you have more trials pass carry K gets [14:39] lower and lower right? And so at the end [14:41] of the day the point of this is to [14:43] communicate there's not actually one [14:44] right answer for like which metric to [14:46] report. It's very sort of catered to um [14:49] the type of task that you're evaluating [14:51] the model on and depending on its [14:53] difficulty and the nature of that task [14:54] sort of which one's most appropriate but [14:57] okay [14:58] we spent a lot of time on motivation so [15:00] I'll I'll like cut a little bit short on [15:02] the other parts. Um okay any questions [15:05] before we move into greater types? I [15:06] think it's great. Okay great. All right [15:08] so we'll go through the three of these [15:10] really quickly. So the mental model as [15:12] you kind of follow along in lecture is [15:15] we're going to talk about uh in the next [15:17] 10 minutes like all of these different [15:19] grading techniques generally you can [15:20] think of just as three you know you have [15:22] unit tests you have actually using human [15:25] annotation and you have sort of language [15:27] model as judge sort of supplanting human [15:30] effort right? And this table um you know [15:33] you can imagine like cost is like okay [15:35] how expensive is it to use this greater [15:37] of speed and you know I'll let you [15:39] figure out the other six. Um [15:41] so we'll do that first and then we'll [15:43] launch into looking at LM as judge [15:44] specifically and for those 30 minutes [15:47] we're going to kind of look at the [15:48] lineage of like LM just as like a [15:49] stand-in for Rouge and Blue Score to [15:52] replacing human preference to simulating [15:54] human actions and I'll kind of talk [15:56] about the non-determinism stuff. So [15:58] cool. All right so starting with this we [16:00] already talked about this quite a bit [16:02] but as mentioned code is actually pretty [16:04] expressive and I think especially for [16:06] your guys's homework two assignment my [16:10] guess is going to be that a lot of you [16:11] end up doing um [16:13] unit testing right? Like let's say uh [16:16] you you have a I don't know if some of [16:19] you I'm talking a little bit out of [16:21] pocket here. So please feel free to [16:22] correct me. But if you're doing like a [16:24] biology task or something like that, [16:26] like if you want inspiration, look at [16:28] terminal bench science, right? And let's [16:29] just say that, you know, oh, you are [16:31] like annotating a genome or something [16:33] like that. Again, like I'm not a bio [16:35] expert, so [16:36] I very much am making things up. But [16:39] certainly like, oh, you know, like I do [16:41] some DNA RNA transcription, blah blah [16:43] blah, input takes in this sequence, the [16:45] model has to do a bunch of things. It [16:47] ends up spitting out an artifact where, [16:49] you know, it's just a string of AC GT or [16:52] something like that, right? [16:54] You can write a unit test for that. Like [16:55] depending on the task, if it has to be [16:57] sort of this exact, I don't know, 32 [17:00] character sequence of text, then that's [17:01] great. Write a unit test that does [17:03] equals equals for it. If [17:05] you know, there's a certain sort of [17:08] amount of variance in the solution, any [17:10] solution that has, you know, AACG is [17:13] like a repeating pattern or something [17:15] like that that has to occur three times [17:17] in your sequence or whatever, great, [17:19] write it as a unit test, right? Like so [17:21] I I personally really like unit testing. [17:24] I think the benefits here as sort of [17:26] like [17:27] shown in the previous slide is that it's [17:30] really cheap and it's really fast. You I [17:31] mean these before we would crawl for [17:33] unit tests in the wild like Swebench, [17:35] like now for terminal bench, you know, [17:38] people wrote those. And now the language [17:39] models are genuinely very good enough [17:41] that like, you know, you can ask it to [17:43] generate tests [17:45] against sort of, you know, the expected [17:47] artifact that you want to check. [17:49] And you only have to generate those [17:51] tests once, [17:52] you know, 5. sorry, GPT, you know, 6.1 [17:55] Soul generates the tests and you can [17:57] sort of use those till the end of time, [17:59] right? And so there's a lot of benefits [18:01] to this. Now the main issue is is that [18:03] like flexibility and nuance, it's kind [18:06] of like a more high-level term to [18:07] explain it a little bit more. [18:09] Flexibility simply means [18:11] we've talked about this idea of like [18:13] staticness [18:14] when we went through benchmarks, right? [18:16] That you have these benchmarks where you [18:18] create the task, you create the unit [18:20] tests, and once the models are good [18:22] enough and they pass those unit tests, [18:25] that that task is not useful anymore, [18:27] right? Sweet-bench verified is fully [18:28] saturated at this point. So is [18:30] sweet-bench multilingual, so is [18:32] terminal-bench 1.0, so is WebArena. A [18:35] lot of that has to do with this um [18:38] concept that they all use coding unit [18:41] test grading, and once the model does a [18:44] really good job at that task, really [18:46] good job, meaning with respect to the [18:48] unit test suite, it passes everything, [18:50] then, you know, those tests aren't [18:52] useful anymore. So in some sense, it's [18:54] like [18:55] very very sort of readily available, [18:57] easy to generate, but it's kind of like [18:59] fossil fuel in some sense, right? Like [19:00] once those tests are used, like it's not [19:03] going to give you sort of in training, [19:05] it's not going to give you RL signal [19:07] anymore. In benchmark land, it's not [19:09] going to give you sort of the [19:10] discriminatory signal you're looking for [19:12] anymore, right? But anyway, I'm harping [19:14] on this a little bit long just to remind [19:16] folks, but I'm sure you guys get the [19:18] concept at this point, right? So again, [19:20] this is just to show unit tests are [19:22] still good. I think there's like just a [19:23] range of things that you can express in [19:25] unit tests, and often times like if [19:27] you're creative with your verification, [19:29] you can get away with like a lot of [19:31] great types of tasks, right? So one [19:35] example is for coding tasks, like if you [19:37] think about it, you could write a unit [19:39] test where [19:42] you know, the model is supposed to [19:43] implement a codebase, and the unit test [19:46] is inspecting that this specific [19:48] function or this specific class with [19:51] this specific method header [19:53] is implemented a certain way, right? [19:55] Like I don't know, if you're like [19:56] implementing Fibonacci or something like [19:58] that. And now you could write a unit [19:59] test that's like [20:01] places these sort of pretty constraining [20:02] assumptions on the form factor of the [20:05] code to have to look like this, the [20:06] method header has to look like this. On [20:08] the other hand, if you look at [20:11] sort of a more recent benchmark, so [20:13] there's one called program-bench, and [20:15] the idea there is the model is given an [20:17] executable, like FFMPEG or JQ or [20:20] Ripgrep, you know, whatever your [20:21] favorite CLI iTerm tool is, [20:25] those are also technically unit tests, [20:27] but the way that the model solution is [20:29] asserted is it takes the model's code [20:31] base, compiles it into an executable, [20:34] and then runs that and the tests are [20:36] formed as like invocation of executable [20:40] on an input with some flags [20:42] and asserting that sort of the output [20:44] artifact or standard output follows the [20:46] thing. So the reason that's interesting [20:48] is because they're both unit tests, but [20:50] in the setting with Program Bench, [20:52] you're not constraining on the [20:53] implementation anymore. You're saying [20:55] like, hey, you can I I am just at a [20:58] higher order of abstraction. That is [21:00] where I'm sort of doing my verification. [21:02] I'm not doing verification against what [21:04] your code base looks like. I'm doing [21:06] verification against what your code base [21:07] compiles into. And so a nice way if you [21:10] get stuck of like, oh man, I really want [21:12] to create this hard task, but the [21:14] problem is that like my verification [21:16] can't be too fine grained in the sense [21:18] that it constrains the solution space, [21:20] then sort of a a [21:22] a way to sort of think about it is like [21:24] how do you go one order of abstraction [21:26] up in terms of like where your [21:28] verification sits. Yeah. [21:30] Hopefully that made sense. That that's [21:31] just a very spelled out explanation of [21:34] sort of like what this diagram is [21:35] showing. Um we've talked about this, [21:37] right? So the big constraints here is [21:39] that ultimately even in Program Bench, [21:42] um you could say so so for Program Bench [21:44] like you could say, all right, the [21:45] underlying capability of the task or the [21:47] benchmark is you want to test a model's [21:50] ability to generate a repository from [21:52] scratch, right? That like that's kind of [21:54] the goal. Oh, can a can a model vibe [21:56] code something really really cool, [21:58] right? Now [22:00] with something like Program Bench, it's [22:02] still kind of problematic because the [22:04] verification is still constraining sort [22:06] of like what your program must look [22:08] like, right? Like if you're [22:09] re-implementing FFMPEG and you're doing [22:11] testing against executable invocations, [22:14] then the verification is still implying [22:16] that, okay, the model has to ingest an [22:18] MOV file and the flag has to be named [22:21] this exact thing, right? So so [22:22] prescriptive just means that by virtue [22:25] of how the verification is presented and [22:28] that it's against this level of [22:29] abstraction, whether it's a function or [22:31] an executable invocation or something [22:33] higher, that there's this the [22:35] abstraction itself becomes sort of like [22:37] something that's necessary. So it's not [22:39] purely open-ended. [22:41] Does that make sense? Hopefully. Okay. [22:43] All right. I see some nods. Great. Um [22:45] static we've talked about, right? They [22:46] don't really evolve over time and [22:48] reductive is echoing that idea earlier [22:51] on of like, okay, um you know, I want a [22:54] model to implement some solution. Um are [22:58] the tests actually representing full [23:00] coverage of that solution space? And [23:03] depending on your task, that can be very [23:04] very difficult, right? Like yeah, I want [23:07] to do I mean like if this is kind of [23:10] like a very theoretical computer science [23:11] problem, right? Like if you want to [23:13] empirically verify that a model does [23:15] Fibonacci properly, um you know, you can [23:18] write sort of the tests for like the [23:20] first 1,000 Fibonacci numbers, but then [23:23] maybe you don't have tests for the [23:24] 1,001st Fibonacci number, right? And so [23:27] certainly with with that example, you [23:29] know, you can talk about formal methods [23:31] and stuff. But anyway, the point is that [23:33] like sometimes your unit tests might not [23:34] actually cover the whole solution space [23:36] that well. Um okay. So [23:39] given um these weaknesses, which mainly [23:42] um [23:43] have revolved around sort of a lack of [23:46] like the staticness and a lack of nuance [23:48] and a lack of sort of like potentially [23:50] not full coverage, um then like the flip [23:53] side of it is like, all right, well, [23:54] like a human asks the task, just get the [23:56] human to grade it, right? So we won't [23:58] spend too much time here. This is very [23:59] much sort of like the MT bench chatbot [24:03] arena stuff that we've talked about [24:04] before. Um you just have sort of people [24:07] look at and and vote over the responses. [24:09] Um now the main interesting thing here [24:12] is that people have gotten more creative [24:13] with like how they use human annotation, [24:15] right? So with chatbot arena, you just [24:17] kind of vote uh between two open-ended [24:19] questions, uh but yeah, with like GDP [24:22] Val, uh which is an evaluation created [24:25] by some folks at OpenAI, um that takes a [24:28] look at this suite of like economically [24:30] very useful tasks. And if you look at [24:32] the task, a lot of them are kind of like [24:34] finance things or sort of whatever, and [24:36] they're kind of operating over [24:37] spreadsheets or a lot of, you know, [24:39] Microsoft Office type things that sort [24:41] of like a lot of white collar work uses, [24:43] right? So um in this case, yes, they use [24:46] human grading because like it's kind of [24:48] difficult to write unit tests for a [24:49] PowerPoint slide or for, you know, an [24:52] Excel an Excel sheet in the sense that [24:54] like yeah, the human just has to answer [24:56] a question. It doesn't actually matter [24:57] whether column A is this and column B is [25:00] this. So to accommodate for all of that [25:02] flexibility, in the original release um [25:04] GDP Val um talks about how they use [25:07] human experts to grade and they show [25:08] that wow, you know, like um I think it's [25:11] like GPT 4 or something at the time or 5 [25:13] something was very very good at this. Um [25:16] um [25:17] and then for Kojim, which is from DE's [25:20] group by by Ija, um again, this is kind [25:22] of like another setting where like you [25:24] have an agent collaborate with a human [25:27] and there you have sort of the model [25:29] that person grade like how well did that [25:31] collaboration go, right? So the the nice [25:33] thing about the commonality between [25:36] these kinds of tasks is that um unit [25:39] tests don't really work here because [25:41] your solution space is very large and [25:43] it's kind of very subject to the whims [25:45] of like how the task worker executes on [25:47] it. Um you you could sort of like try to [25:50] make unit tests work by making your [25:52] problem statement super explicit. Like [25:54] for example, [25:55] I don't know, if for GDP Val you can [25:57] imagine one of the tasks is like vetting [25:59] an S1 filing or something like that, [26:01] right? Now you could frame the task as [26:03] like okay, when you do this, make sure [26:05] your Excel sheet is named like S1 [26:08] Anthropic dot XLSX and that column A B C [26:12] D have to look like this and whatever. [26:14] But then that's where by virtue of [26:16] making the verification for unit testing [26:18] work, your problem statement suddenly [26:20] becomes super prescriptive. So this sort [26:22] of like tug of war between the [26:24] prescriptiveness of the problem [26:26] statement and then sort of the [26:28] comprehensiveness of the unit test, you [26:29] can kind of break out of it by having a [26:32] human judge um in the loop because you [26:34] know, human grading is sort of like, you [26:36] know, we're treating it essentially as [26:38] like we're the oracles of what we want [26:39] done. Yeah. Um [26:41] but then of course uh we're very [26:43] expensive and uh rightfully so I think I [26:46] hope it stays that way. Um you know uh [26:48] so yeah certainly like you need to pay [26:50] humans to annotate the test. The the [26:52] bigger um potential issue is is more so [26:55] I to me I think disagreement, right? [26:57] That like you have it's not [26:59] deterministic like code. If you have the [27:01] same solution, the same unit test and [27:02] you run it multiple times [27:04] barring the unit test being kind of [27:05] flaky, you're going to get pass or fail [27:07] every single time. You might not even [27:09] get sort of consistency from the same [27:12] human grader, right? And so that's [27:13] something to um account for um you know [27:17] one day you wake up and you kind of look [27:18] at the same rubric and you interpret it [27:20] a little bit differently, right? And so [27:22] it's not that human grading is not good [27:24] to use and disagreement is not sort of [27:26] like, you know, an Achilles heel. You [27:29] can use human graders but then sort of [27:32] the expectation is that you have done [27:33] some sort of confidence interval, you [27:36] know, statistical testing to ensure that [27:38] you know the human grading is reliable [27:40] and sort of reproducible. But even then [27:42] that that's sort of costly and difficult [27:44] and hard to rerun. Um so [27:46] that motivates very well of like okay [27:48] well language models are getting so good [27:51] uh why don't we sort of use them as a [27:53] stand in for um [27:55] humans more and more and that will [27:56] constitute sort of the next 30 minutes [27:58] uh of today's lecture. Um so uh to [28:01] preface it a little bit uh with language [28:03] model as judge there's a couple ways [28:05] that we kind of generally uh can frame [28:10] the the the way uh judgment is carried [28:12] out, right? So generally you can think [28:14] of it as like here's a solution, here's [28:16] a model, here's some either some rubric. [28:19] Okay so sorry. [28:21] Here's the model. [28:23] Here's a rubric and a solution. The [28:25] model applies the rubric to the [28:27] solution, right? The alternative is [28:29] here's the model, here's two solutions. [28:32] The model chooses between the two or [28:33] does some sort of ranking related thing, [28:35] right? So [28:36] reference based and rubric scoring and [28:38] assertions, this is kind of like, hey [28:41] model, here's a rubric or here's some [28:43] sort of like checklist of things that [28:44] needs to happen or some text, apply this [28:47] body of text to sort of this artifact, [28:50] right? And so those are sort of the [28:52] specific instantiations. The pairwise [28:55] one which we we've seen over and over [28:56] and over again is the chatbot arena one, [28:59] right? Like here's A, here's B, pick the [29:01] one that you like more, right? [29:03] And sometimes in there, when it's [29:04] supposed to pick the one that it likes [29:05] more, you can put a rubric in there, [29:07] right? So conceptually pretty [29:08] straightforward. I think it just looks [29:10] like what's on the right. But yeah. [29:14] And so we'll we'll kind of dive deeply [29:16] into this in the next set of slides, but [29:19] again, like the nice thing is that the [29:21] nice thing with LLM as judge is that you [29:23] can imagine it kind of doing the full [29:25] spectrum of both unit tests and humans [29:29] in that like, yes, you can write some [29:31] things where it's like you do want the [29:33] language model to check that for this [29:35] GDP val question that, you know, I don't [29:37] know, when it filed this financial form [29:39] or when it does I don't know, tax bench [29:41] or something like that, it has to has to [29:44] has to put down your social security [29:45] number or your mock number, right? [29:47] There's no way around it. And so the [29:49] language model as judge it should be [29:50] able to do that, right? On the other [29:52] hand, it's like, okay, you know, I [29:56] yeah, I mean, I don't know about for [29:57] text tax bench what a open ended [29:58] preference is. Maybe sort of like the [30:00] shadier gray area things where, you [30:02] know, like the model kind of like [30:04] applies your deductions very well or [30:05] whatever and so there's no exact answer [30:07] there. Point of sorry, that that was [30:09] kind of a weird analogy, but point is to [30:11] say that like if you kind of look at the [30:13] spectrum of benchmarks that use LLM as a [30:15] judge, you see this kind of range of [30:18] like both exact checks and also sort of [30:20] kind of more open ended like tell me [30:22] what you think, but this is generally [30:24] what I'm looking for. [30:25] And so [30:27] again like post lecture, if you want, [30:29] you can just kind of look at that table [30:30] from the original [30:32] first slide in this section, uh but you [30:35] know, there there's sort of pros and [30:36] cons to all of them. So before we dive [30:38] deeply into LLM as a judge uh when you [30:41] think about your homework too and how [30:42] you're going to do grading there um you [30:44] can just kind of like do these checks [30:45] and balances and weighing of like which [30:47] one's better and which one's not. Um any [30:49] questions before we move on to [30:52] LLM as a judge [30:54] Okay, cool. All right, so LLM as a judge [30:57] um has shown up like uh [31:00] in a lot of different ways over time. Um [31:02] I think even before language models as [31:05] we know them today in terms of [31:06] transformers and and attention and blah [31:08] blah blah um you know we we we have um [31:12] you know tried to use uh artificial [31:15] intelligence um sort of in the most [31:17] general term uh to sort of like do human [31:19] judgment. Um so we're we're not going to [31:21] focus on those things. We're just going [31:23] to talk about like post 2018 2019 kind [31:26] of innovations um that came with sort of [31:28] like Burton Elmore and kind of like the [31:30] early on um link sort of modern LMs uh [31:34] that came about in 2017 and stuff. So [31:36] well I'm going to break it down into [31:37] three phases. So the first one is like [31:40] um if you guys kind of remember from the [31:42] benchmark uh lecture [31:45] last week uh where we talked about um [31:48] all these examination style benchmarks [31:50] and whatever and even before that sorry [31:52] when we talked about kind of like the [31:53] canonical things like uh entailment or [31:56] like uh NER stuff like that. We'll talk [31:58] about how we use language models to [32:00] replace things like blue score and exact [32:02] match and stuff like that. And we'll [32:03] talk about human preference and then [32:05] human action and you you know you've [32:06] read the slide at this point. Um so cool [32:09] let's dive in. So um [32:11] one of the first papers to take a look [32:13] at this uh or I guess it's a little bit [32:15] more modern but sort of like uh address [32:17] this question quite specifically um is [32:19] this paper called G E Val. So um the [32:21] idea here is that before we would grade [32:24] text summarization by taking a document [32:28] having you know gotten a reference [32:30] summary from somewhere and then the [32:32] model generates the summary and then we [32:34] compare the summary against like the [32:36] reference by doing N gram overlap right? [32:39] And so the idea there is that like, [32:41] okay, in theory, we want a model to [32:43] generate a summary that sort of shares a [32:46] similar set of tokens and says a similar [32:49] set of things um as some reference [32:52] written by some human experts. So [32:54] remember this is before the language [32:56] models that we have today were like [32:57] generating text as cheap. We're talking [32:59] about like seven years ago when [33:01] generating text was less cheap, you [33:03] know. Um so as you can imagine um uh [33:06] also within your homework, right? Like [33:08] remember with like BM25, I think you [33:10] guys have all been doing sort of the [33:12] quizzes, right? Like even there folks [33:14] have identified like, okay, well, one of [33:16] the issues with BM25 is that if you have [33:18] a query that has the word um I don't [33:20] know um queen in it and it's looking for [33:24] um [33:25] you know, similar text um it's not going [33:27] to match with text that has empress or [33:31] uh princess or things that have sort of [33:33] meaning-level similarity but no semantic [33:35] similarity, right? And so you can apply [33:36] the same sort of uh um skepticism to [33:40] N-gram overlap grading for [33:43] summarization, right? It doesn't account [33:44] for sort of those uh meaning uh level [33:47] similarities. So um they do this on two [33:50] tasks. They're also the dialogue [33:51] generation one. So this is like a pretty [33:55] um [33:56] straightforward uh instead of using [33:58] N-gram overlap, grade it with a person. [34:00] The main thing Oh, sorry. Instead of [34:03] N-gram overlap, grade it with a language [34:04] model, not a person. Um the main thing [34:07] to pay attention to is that very quickly [34:10] in this uh [34:11] um [34:12] paper, they notice that like, you know, [34:14] setting the model at a certain [34:15] temperature or whatever, it's not going [34:18] to generate the same It give it the same [34:20] score every single time. So the task [34:22] setup is here's the summary, um here's [34:25] maybe like the reference summary or [34:27] something like that, score it on like a [34:29] scale of like one to five, right? Um if [34:32] you run the language model on the same [34:34] sort of like reference uh model's [34:37] proposed solution pair, you don't [34:39] actually get the same number every time. [34:40] So this is sort of like I think very [34:42] early on in a very distinct flavor [34:45] echoes this kind of like pass case stuff [34:48] that we'll talk about before. So to [34:49] account for that variance, they do [34:51] multiple rollouts and that's where you [34:53] get this distribution on the bottom here [34:55] and then you simply take like the weight [34:56] of the distribution or like the average, [34:58] you know. Um so [35:00] um [35:01] that's sort of like a very simple way to [35:03] express that like oh you know like hey [35:06] in our table we show that compared to [35:08] these uh sort of traditional like [35:11] compare the semantic form of the text [35:13] and you have these sort of like big [35:15] compositions of heuristics that do this [35:17] or they do some sort of clever [35:19] statistical uh modeling of the text as a [35:22] distribution and then compare those [35:23] distributions. [35:25] Uh let's let's kind of throw away all [35:27] that complexity. Turns out the models [35:29] are pretty dang good. And so um what [35:31] they show here is they show how well [35:35] each metric correlates with a human's [35:38] score along the same dimension, right? [35:41] So both the language like the model is [35:44] going to sort of like uh like the human [35:46] given a like a human annotation pool, [35:49] given sort of all of these um sort of [35:51] qualities that you're looking for in [35:53] your summary is rating all of them and [35:55] then they see how well this metric sort [35:57] of correlates with [35:59] the human uh [36:01] score or preference there. So um I think [36:04] a lot of the ideas in this paper get [36:06] developed sort of like and become their [36:08] own things later on, but even here you [36:10] can see some sentiment of like okay we [36:12] need to show that the language model is [36:15] capable of supplanting um whatever the [36:19] traditional metric was and a good way to [36:21] show this is that it aligns with human [36:23] preference, right? And you're going to [36:24] you're going to see this echoed again [36:25] and again throughout this entire [36:27] section. Um [36:29] cool. And so like GPT score uh does [36:32] something quite similar as well, uh but [36:35] like um [36:36] it it sort of starts to generalize [36:38] things, right? So uh beyond just sort of [36:40] like here's a reference and then here's [36:42] sort of what the model generated, [36:44] Compare the two. This is a little bit [36:46] sort of like what happened with T5 uh [36:49] from a modeling perspective when we took [36:50] all those tasks and kind of united them [36:53] under the same general sort of like [36:56] given an input generated an output [36:57] formulation. For GPT score, they expand [37:00] this to a whole suite of like different [37:03] types of tasks and also different types [37:05] of dimensions. So I I think that this [37:08] table is probably like the main takeaway [37:10] from it. Um so summarization, dialogue, [37:14] machine translation slash you know [37:16] Google Translate um and um [37:19] I think a couple okay I guess not not [37:21] too many um in this, but then you also [37:24] have all these dimensions, right? So if [37:25] like from the previous paper we saw in [37:28] that table there were four dimensions, [37:30] you can get really really sort of like [37:32] thorough and granular with like how do [37:34] you rate a body of text, right? Um I [37:37] think the funny thing about this is if [37:39] you look at sort of papers in this era, [37:41] you'll typically see that like a lot of [37:43] them um tackle sort of grading of text [37:47] uh by sort of like being very very um uh [37:51] comprehensive and exhaustive in their [37:53] listing of sort of like what makes uh [37:56] body of text good. And they'll sort of [37:58] typically cater it for sort of a uh one [38:01] type of uh task um uh text generation [38:04] task. And then what typically happens is [38:06] that you know when language comes around [38:08] language models come around, people [38:10] decide like oh actually you can sort of [38:11] unify these tasks both in terms of how [38:14] they're presented to the model and how [38:15] they're expected to output their [38:17] solution and then in terms of their [38:18] grading as well. And so you you kind of [38:20] see the repetition of this aggregation [38:22] that we saw with like you know separate [38:24] linguistics benchmarks becoming like [38:26] superglue and MMLU and stuff like that. [38:28] And you're you're seeing that happen [38:30] like also at the verification level [38:32] itself, right? So the funny thing is we [38:34] do this and then at some point um [38:36] especially when chatbot arena and MT [38:38] arena come around, they kind of just [38:40] decide like all right the human is just [38:42] going to like the human just represents [38:43] all of this. So we're not going to sort [38:45] of like get like super granular and [38:46] specific with how we break down the [38:48] quality of tasks [38:50] of of of text [38:52] anymore. But yeah, again, they do this [38:55] sort of big sweeping run, 19 language [38:57] models of varying sizes on four [39:00] different tasks, those like 22 aspects [39:02] that we talked about. They run a bunch [39:04] of data sets through this [39:06] and then they show that you know like oh [39:08] you know like using a language model as [39:10] grading is just kind of like more [39:12] correlated with human preference. So [39:13] it's kind of the same story as before. [39:15] Point of this paper is just to show that [39:17] sort of it gets expanded to to more more [39:21] tasks and and and the conclusions hold [39:22] across more models. Cool. Okay. And then [39:26] this this paper just kind of outright [39:29] asks the question that you know [39:31] is sort of the fundamental research [39:34] question behind language models a judge. [39:36] And this one sort of starts to inspect [39:39] more of like the reliability, right? So [39:42] again, human evaluation is like hard to [39:45] reproduce and unstable as we've talked [39:46] about. It's like difficult to do those [39:48] reruns. So if we have a language model, [39:52] can we sort of check that A it's aligned [39:54] with the humans and when it comes to you [39:56] know comparisons with humans is it sort [39:57] of like is the variance and sort of like [40:00] how it answers or judges these things? [40:02] Like how does it compare to human [40:04] variance [40:05] when presented with the same set of [40:07] judgments, right? And so [40:09] you know [40:11] the the setup is quite straightforward. [40:12] So you give the language model identical [40:14] instructions, samples, questions used [40:17] with expert raters on these sort of like [40:19] two general tasks here. So [40:21] as you might noticed here with the [40:24] tasks, they're kind of much more [40:26] open-ended than the ones that we were [40:28] looking at before. And so like [40:31] open-ended story generation and then [40:33] yeah, we present the language models and [40:35] the human evaluators with a short [40:36] description and a story to be evaluated. [40:39] And then there's this these kind of like [40:41] four grading criteria, right? So unlike [40:44] before where the solutions are a bit [40:45] more exact, we're kind of asking this [40:48] question of like can it deal with [40:49] open-ended tasks better. [40:52] Um and so okay, I guess the conclusion [40:53] kind of gets repeated here, but um [40:57] it's the same as before, which is like [40:59] yeah, the language models are super [41:00] aligned with the experts, which is [41:01] great, and they're actually sort of [41:03] quite stable in the sense that they give [41:05] you the same answers, but they are more [41:07] lenient than experts on unnatural text. [41:09] So this line prefaces I don't think [41:12] we'll get to this explicitly [41:15] as a paper in the lecture today, but if [41:17] you're interested, this starts to lean [41:19] into the separate research question of [41:21] if I have [41:24] Opus 5.5, [41:26] GPT-6.1 Soul, [41:28] I don't know, Gemini 4 and Muse 1 and [41:30] they all generate summaries or something [41:31] like that, but my grading model is just [41:34] Opus 5.5. Does Opus 5.5 grade its own [41:37] stuff better, you know, compared to [41:39] other models, right? And so [41:41] that's a separate lineage of papers that [41:43] this sort of starts to hint at. We're [41:45] not going to dive into that, but I think [41:47] that is sort of a very interesting set [41:49] of like [41:50] like a more specific category of like [41:53] LLM as judge robustness that we're [41:55] checking. And so what they do show is [41:57] that yeah, the models like at least [42:00] at least a year or two ago tend to have [42:02] preferences for like their own [42:05] for their own generations. Yeah. [42:08] Cool. Okay. [42:09] Now we're going to move on to human [42:11] preference. So before we were kind of [42:13] talking about like all right, are [42:14] language models better than like [42:16] traditional NLP metrics? And we came [42:17] back and said yes for a lot of these. So [42:21] you know, as we saw like the [42:22] verification continues to rely on like [42:25] oh, you know, or [42:28] validating the verification relies on [42:30] showing that it's very aligned with [42:31] human preference. So then the natural [42:33] question is then can language models [42:35] just like resemble human preference [42:37] altogether, right? And so there's kind [42:39] of three questions that we'll answer [42:40] across the next three papers. Can we [42:42] learn a judge from human preferences, [42:44] right? So if we have a language model, [42:47] how do you post train it or just kind of [42:49] do some uh data intervention on top of [42:52] it to make it mimic the things that you [42:54] and I prefer. Uh maybe it's an [42:56] individual human. Usually it's kind of [42:57] across like a large population of [42:59] humans, right? Um can a prompted [43:01] language model then kind of stand in for [43:03] human writers? So this is like can it [43:05] resemble our preferences? This is sort [43:07] of like can it operationalize our [43:08] preferences, right? Um and then the [43:11] third is sort of always the question is [43:13] like all right like if we use a language [43:15] model as a stand in like sort of how [43:17] reliable is it? Um so um [43:20] I I would say this is this area of [43:22] research is quite interesting because it [43:24] does constitute like a good amount of [43:27] what Oh, yes, a question. [43:31] Yes. Uh-huh. [43:32] >> This is referred to unnatural text. [43:35] >> Oh, unnatural text. Uh yeah, the [43:36] question is like what the heck does [43:38] unnatural text refer to? Um [43:41] this is you can think of this as [43:42] actually like a very strange form of [43:44] like reward hacking, right? So okay, [43:46] maybe not strange. Maybe a simple thing [43:48] is like we'll see this um in a couple [43:51] slides later. Uh what they found with [43:54] summarization and with some language [43:56] model responses is that a language model [43:58] grader will be biased towards longer [44:00] responses. If you don't constrain sort [44:02] of like uh how long your summarization [44:05] can be and your grading rubric is sort [44:07] of not accounting for that, then the [44:09] model could just say like okay, I'm [44:11] learning to generate a summarization [44:13] where I just repeat the same sentence [44:14] over and over again. Like it's a simple [44:16] reward hack where like the summary is [44:18] like one sentence, but if I just say the [44:21] same sentence three times, for some [44:23] reason the LM judge is going to grade [44:25] something repeated three times better [44:27] than that single sentence. [44:29] Does that make sense? Did I lose [44:31] Yeah, exactly. [44:33] Exactly. Exactly. Yeah, so I think um [44:36] it's a great question that you point out [44:37] because like especially in this regime [44:40] of like human preference and stuff like [44:42] that, it is it is definitely gray in [44:44] that like we are kind of projecting our [44:46] own preferences onto it and so unnatural [44:48] in a very fine grain sense could mean [44:50] very different things to you and me, but [44:52] I I in in their case they're just [44:53] referring to like everybody agrees that [44:55] like it's really weird if you have a [44:56] summary that repeats the same sentence [44:58] 10 times. Yeah. Great question. Um cool. [45:01] So yeah [45:02] continuing here I think something that's [45:04] quite [45:06] that I like about this research that [45:07] maybe it will be cool to you as well is [45:10] that a good amount of this actually [45:11] constituted what like OpenAI was doing [45:14] like early on where they were just kind [45:15] of like a a non-profit publishing nerves [45:19] papers and so um [45:21] you know [45:22] we'll dive into some of these right? So [45:24] one of the first ones that is quite [45:27] popular and I think we highlight this [45:29] lineage of work specifically is because [45:31] this actually [45:33] very much prefaced everything that led [45:36] to RLHF which I think like hopefully [45:38] people have talked about if not in this [45:40] course then in like separate language [45:43] model courses [45:45] where RLHF generally refers to this [45:47] paradigm of like reinforcement learning [45:50] from human feedback where we took the [45:52] base model we applied SFT instruction [45:55] tuning to it to kind of be able to do [45:57] dialogue but this was kind of one of the [45:58] first instances of applying some kind of [46:02] post training slash RL slash preference [46:05] based rewards two language models as a [46:08] training technique right? So I won't go [46:10] into full detail about how it works but [46:13] it's kind of very similar to kind of the [46:15] GRPO stuff that we talked about when we [46:17] went over data and Evals right? So in [46:20] this section [46:21] again they start with like a similar [46:22] preface of like okay Rouge and reference [46:25] summaries like this is still sort of [46:27] traditional NLP metrics. [46:29] They only proxy quality but they don't [46:31] directly address it right? So can we [46:34] train a model to predict exactly what [46:35] humans prefer and so in this case it's [46:38] the the modeling objective is less sort [46:41] of [46:43] in the way that like oh you just kind of [46:45] see if the model produces scores that [46:46] are similar and it's like more of like [46:48] we are showing that it's able to predict [46:51] what a human predicts. So it's kind of [46:53] subtle but the but you know [46:56] um, it's again I I guess I know how to [46:58] state it better. It's more about sort of [47:00] predicting what what humans prefer. Um, [47:02] so modeling humans, right? And so, um, [47:05] the the [sighs] I guess like the [47:07] motivation is quite similar to before. [47:09] So so don't worry if I lost you a little [47:10] bit there. Ultimately, it's just sort of [47:12] like seeing if models can gauge what we [47:15] prefer. [47:16] The more interesting thing about this [47:18] paper is sort of like the training [47:19] paradigm that they come up with. So this [47:21] first an evaluation paradigm, but then [47:23] it lends itself very very well into then [47:26] sort of training a language model, like [47:28] turning the benchmark into data as we've [47:30] seen [47:31] uh, repeated a lot in this course so [47:33] far, right? So uh, what they do is they [47:35] basically just do LM Arena at scale and [47:38] if people are kind of tapped into it, [47:39] this is very much the kind of data that [47:41] like LM Arena has sold to companies. [47:44] It's all this kind of human preference [47:45] data, right? Like I have uh, model [47:47] generation A, model generation B, human [47:50] establishes the preference and then what [47:52] I do is I train a reward model that [47:56] takes those two um, [47:58] two uh, model generations and predicts [48:01] which one the human prefers, right? So [48:03] it's like a very simple uh, [48:05] preference-wise uh, reward model. Given [48:08] A or B, I ask the model to to to [48:11] predict. So this is basically just [48:12] chatbot arena and MT-bench, but you [48:14] train a model on that kind of data, [48:16] right? So [48:17] data collection to generate tuples of [48:20] uh, sort of uh, output one, output two, [48:23] which one was preferred between the two. [48:26] Once you have that uh, huge list of [48:28] tuples uh, of training records, then you [48:31] can train a reward model on top of it. [48:33] And the reward model simply just says, [48:35] okay, I'm trained to mimic human [48:38] preferences by being trained on this [48:39] objective of given these two samples, [48:41] I'm going to predict the one that the [48:42] human likes more. [48:44] Once you have that reward model, you can [48:46] then apply it as sort of what generates [48:50] rewards for a model uh, for a model um, [48:54] for a language model, sorry. So to kind [48:56] of explain this more explicitly, now, [48:59] you know, we can incorporate tasks like [49:01] summarization, like uh you know, like uh [49:05] I don't know, like joke understanding or [49:07] like these things that are a little bit [49:09] more open-ended, and we have the model [49:11] sort of generate the solution, and then [49:13] instead of having to pay human [49:15] annotators to rate these things and be [49:17] part of the training loop, we remove the [49:19] human completely from the training loop, [49:21] right? So and sort of the reward model [49:23] is what's giving back reward to this. Um [49:25] so the model um generates like given [49:28] this, it generates multiple summaries, [49:30] and then the reward model picks which [49:32] summary is the best, and that's how we [49:34] train the model. Does this make sense? [49:36] Hopefully I didn't lose people in the [49:37] middle. Um this is sort of we're not [49:39] using unit tests. This is just to [49:41] explain yes, in theory this reward model [49:44] here, it totally could be a human. Like [49:46] you could imagine training a model by [49:48] having an army of like 10,000 human [49:52] annotators that are just sitting and [49:53] ready and like receiving model [49:56] generations as they come in, rating then [49:58] and and like sort of sending the reward [50:00] back, right? Clearly that doesn't work [50:02] for like a number of reasons uh both in [50:04] terms of costs, in terms of sort of [50:06] technical feasibility. So we're training [50:08] a reward model as a stand-in for the [50:09] human. So the point here is to show that [50:12] like um beyond the benchmarking, which [50:14] we've talked a lot, this is a way that [50:16] sort of preference data was [50:17] operationalized in a way to sort of like [50:20] train models to follow mimic and then [50:22] follow human preferences more. [50:25] Cool. Okay. All right. Um and then [50:29] with this paper they kind of like do an [50:30] early prototype of this, and then they [50:32] just show like kind of echoing um the [50:34] prior papers that we saw that like hey [50:37] uh this training paradigm works very [50:39] well. Uh in the prior papers we were [50:41] showing that the metrics uh we we [50:44] validated the metrics uh with respect to [50:46] sort of we validated the verification. [50:49] Here we're validating that sort of this [50:51] training paradigm that incorporates this [50:54] uh verification at scale works very [50:56] well. So TL;DR, I train a model on human [50:59] preferences and use that to provide [51:02] reward signal when I do post training on [51:04] a separate language model and I show [51:06] that sort of the language model gets [51:07] better at generating text that you and I [51:10] really like. [51:11] Cool. Okay. All right. [51:13] And then [51:14] you'll see a couple more follow-up [51:16] papers [51:17] that do this. So in the previous one, we [51:19] took a look at just summarization and [51:21] StructGPT is very very sort of [51:26] milestone like a big paper where they [51:29] kind of like did this, but they of [51:31] course applied like a bunch of other [51:32] tasks to this, right? So again, another [51:34] repetition of the paradigm of you kind [51:36] of make it work for one NLP task and [51:39] then you can kind of apply the same [51:40] procedure to like a whole suite of [51:42] things, right? So before summarization [51:45] on the right, as you can see, we can [51:47] throw a lot of different kinds of [51:48] open-ended text generation problems and [51:51] it will work. [51:52] Cool. And then that's where you get kind [51:54] of like the RLHF stuff. So it's funny in [51:56] that like these two are like kind of two [51:58] separate diagrams from these two papers, [52:01] but you know, it really is sort of like [52:04] spiritually it's kind of like [52:05] communicating the same stuff at the end [52:06] of the day, right? Collect annotations. [52:09] I think the main thing that's like kind [52:11] of interesting here is as we kind of [52:13] talked about before [52:16] with LLM as a judge, you can instantiate [52:18] the grading in like a lot of different [52:19] ways. Is it sort of like a rubric? Is it [52:21] preference? Is it yada yada yada? [52:24] Depending on the task, you can collect a [52:26] lot of different kinds of sort of human [52:28] preferences with respect to text [52:29] generation. [52:31] And then you just sort of like update [52:33] the way you train the reward model to be [52:35] more accommodating of all of those [52:37] different kinds of formulations [52:40] of that data. So that's all that's [52:41] happening here. It's pretty much the [52:43] exact same recipe as before though. And [52:45] then again, they show you know, [52:48] improvement on open-ended things. So [52:50] cool. Okay. And I'll speed up a little [52:53] bit. I'm a little behind. So Chat Bot [52:55] Arena, [52:56] I think we can probably just go through [52:58] this really quickly cuz this might be [53:00] the second or third time that we've seen [53:01] this, right? And so [53:03] similar to before, I think the main [53:05] contribution of this paper, if you read [53:07] deeply into this, is to show to explore [53:11] different kinds of elements judge [53:13] variation. So they kind of make what we [53:14] talked about earlier explicit like [53:17] you know, pairwise voting, single answer [53:19] grading. [53:20] And if you give the reference to a [53:23] language model, does it grade it a bit [53:24] better? They kind of do a lot of [53:27] create a lot of examples of what what [53:29] these kind of different setups look [53:30] like. [53:31] I think the main contribution behind [53:33] Chatbot Arena is that they do a lot of [53:36] confidence bounds [53:38] with respect to sort of like the [53:40] reliability [53:42] of the language model. Like how well it [53:44] represents actual human judgment and [53:47] then sort of its reliability. So you [53:49] know, if you want to investigate that [53:51] paper more, [53:52] that that has plenty of math there that [53:54] demonstrates sort of how to how to show [53:57] that sort of language models as judge [53:59] works very well. So [54:01] the one thing that's kind of worth [54:02] pointing out here that will then dive [54:04] into into a later slide is that they [54:07] show [54:09] there are biases, right? So one of the [54:10] simple things that showed up is you have [54:13] two answers based on whether it's answer [54:16] A or answer B, this the A or B itself [54:20] leads to sort of like inconsistencies in [54:23] the judgment, right? So position bias of [54:26] different language model judges that [54:28] they've applied [54:29] consistency is the percentage of cases [54:31] where like when you swap the results, [54:33] like A becomes B, B becomes A, the model [54:36] still answers with sort of like the like [54:38] it's consistent in this preference. And [54:40] as you can see like yeah, it's like [54:42] biased towards the first one [54:44] a huge percentage of the time. [54:47] So [54:48] these kinds of biases you then kind of [54:50] see a lineage of papers that sort of [54:52] emerge and they identify different [54:54] biases such as biases towards like the [54:58] ordering of the answers or biases [55:01] towards like the length of the answers [55:03] or these kind of like different spurious [55:05] signals that you don't actually care [55:06] about, right? And so this is kind of [55:08] like [55:09] um it's not really sort of unnatural [55:11] text, but this is just sort of like [55:13] unnatural sort of or like unwarranted [55:15] biases popping up at scale. And so, you [55:18] know, that's something that they [55:19] identify. Um I think with a lot of these [55:21] things like the intervention to suppress [55:24] uh these kinds of uh bad preferences is [55:27] actually quite uh simple, right? Like [55:29] you can then create like a whole data [55:31] set um of uh Q and A questions like this [55:36] and take the same question and like mix [55:37] up the order uh of what you're supposed [55:40] to prefer um and you just kind of like [55:42] use data to like, you know, uh whack a [55:44] mole uh this kind of behavior out. Makes [55:47] sense, right? Yeah, cool. Okay, and then [55:49] again um [55:50] I think the fun thing here is that like [55:52] kind of because um they created a whole [55:55] platform to collect human um [55:58] human questions and it's not kind of [56:01] constrained to the traditional NLP tasks [56:03] that we've seen before is that they kind [56:04] of show like, oh well with Chatbot Arena [56:07] uh if you create a good platform and you [56:08] kind of gamify it a little bit and you [56:10] make it sort of presentable to the [56:12] world, uh people ask all sorts of [56:14] different questions. Um and so like for [56:17] all sorts of different questions uh [56:19] across very sort of broad sweeping uh [56:22] categories um we can just show that [56:24] like, oh the judge sort of agrees with [56:26] the human a lot. So one of the sort of [56:29] this this uh table is answering the [56:31] question of like, okay, how much does LM [56:33] as a judge vary with respect to [56:35] alignment with humans and consistency [56:38] when it's judging coding-related [56:40] questions or math-related questions or [56:42] extraction-related questions? Um today [56:45] it probably seems quite obvious that [56:46] like, you know, it would generalize [56:48] well, but you know, we [56:50] people weren't as bought into the idea [56:52] of transfer back then. Yeah. [56:54] Cool. Okay, and then last but not least [56:56] before we kind of move on to the uh [56:59] language model as agent section um sort [57:02] of the question here which we've already [57:03] kind of seen is like, can you train an [57:06] open-source model uh to judge with [57:09] rubrics, right? So [57:10] um this is from uh [57:13] um uh group at like a CMU or like a PhD [57:16] student who's now at CMU. Um and [57:19] what they did was like with a lot of [57:21] these prior works that OpenAI had done, [57:22] this was like four their GPT-3 models [57:24] and one isn't quite wasn't quite open [57:26] source. Um this paper put uh put out [57:29] sort of a nice recipe uh that just sort [57:32] of makes very explicit and provides [57:34] concrete assets for kind of that reward [57:37] model training uh loop that we saw from [57:39] before, right? So, as you can see here, [57:41] um [57:42] you know, we have uh fine-grained [57:45] evaluation with user-defined score [57:46] rubrics. So, they just kind of take this [57:48] stuff that was already in the literature [57:50] uh of RLHF and they sort of [57:52] operationalize it. Um and so, yeah, they [57:55] they take a bunch of open source models, [57:57] a lot of different rubrics, a lot of [57:58] different instructions. This recipe just [58:01] sort of like um imbues the model with [58:04] behaviors that we've been talking about [58:06] this whole time. So, [58:08] cool. And then um the main reporting [58:11] that's uh yeah, you'll kind of see this [58:13] heat map in like other papers as well, [58:15] uh which is just to show that like okay, [58:17] um each pun uh sorry, each square [58:20] represents how correlated this judge is [58:23] with humans and sort of the rubrics on [58:26] sort of like some particular data set [58:28] here. So, usually when you want to show [58:31] that um with this paper, it's less a [58:33] benchmark paper and more like a modeling [58:35] paper. With a modeling paper, you [58:37] typically want to show that like hey, [58:39] you know, like my model is like [58:41] comparable to the state of art and the [58:44] training paradigm that I've put forth is [58:46] generalizable and it works well for all [58:48] sorts of different kinds of instruction [58:51] following benchmarks and it's like not [58:52] overfit to one particular thing. [58:55] Cool. Okay. Um [59:00] yeah, I guess like a brief excerpt [59:01] before we uh end this section is sort of [59:04] like what the rubrics look like. Uh [59:05] we've kind of talked about this uh [59:07] hinted at this a little earlier, uh but [59:09] kind of with like Prometheus and uh [59:12] RLHF, right? Like there's kind of [59:13] different ways that you can do grading, [59:15] right? So, uh [59:16] on the right, the pairwise stuff that [59:18] we're super familiar with. On the left, [59:20] you can make the model generate sort of [59:22] like separate scores for each of them [59:23] and then compare those scores. Um I [59:26] think it's there's no [59:28] at least I haven't seen any paper that [59:30] sort of clearly shows that like one is [59:32] better than the other. I think people [59:34] come up with a lot of these sort of [59:36] different grading paradigms simply to [59:38] sort of demonstrate that like hey, for [59:41] different types of rubrics where you [59:43] want the model to generate a score [59:44] versus a preference or whatever, um sort [59:47] of the downstream um training objective [59:50] is amenable to ingesting preferences [59:53] presented in a variety of ways. [59:56] Cool. [59:58] Okay. All right. Um so [60:00] yeah, for for sort of the original [60:02] questions that we pose, like each of [60:04] these papers uh goes uh about answering [60:06] it. [60:07] Okay. I have like 20 minutes left, so [60:09] I'm going to sort of like be a little [60:10] quicker with the last couple sections, [60:12] but are there any questions before I [60:14] move forward? [60:17] Cool. Okay. All right. So last but not [60:19] least, I think this is the most out of [60:21] the three, sort of the most sort of like [60:22] evolving like um [60:25] cutting edge sort of like what people [60:27] are investigating today, right? So it's [60:29] just that like hey, you know, from [60:31] before what we had is the language model [60:33] produces some artifact, typically just [60:35] some sort of text output. Um can the [60:37] model sort of choose between them or [60:39] apply the right scoring to them [60:40] correctly? Um this makes an observation [60:43] that like okay, language models are [60:44] becoming very capable. Uh they can do [60:47] much cooler things beyond sort of like [60:50] uh grading beyond generating a piece of [60:52] text, right? And so some a nice [60:55] motivation you can imagine here is like [60:57] uh you know, you have a language model [60:59] generate like a Minecraft reproduction [61:01] or something like that and you want to [61:03] grade like how well it's reproduced [61:05] Minecraft, right? Well, if you want to [61:07] take Minecraft [61:09] as its code form as sort of like [61:11] something that's runnable in the browser [61:13] or whatever, it's very difficult to kind [61:15] of just like [61:16] dump the whole thing into sort of the [61:18] language model's context window and just [61:20] ask for an answer, right? And so in the [61:22] same way that language models are sort [61:24] of agents when they come to solving the [61:26] problem, why not make language models [61:28] agents when they go about grading the [61:30] problem, right? And so for something [61:32] like game development, you can imagine [61:34] that's like super well motivated. The [61:35] language model is actually able to like [61:37] click different buttons and go to [61:39] different screens, make sure that the [61:41] button works, make sure that the screen [61:43] and sort of the aesthetics of it look [61:45] good, and that like, you know, if you do [61:47] different button combinations or [61:48] something that things are working, [61:49] right? And that's just for games. You [61:51] can imagine sort of a lot of digital [61:53] artifacts where language model as uh an [61:56] agent um is like a very very effective [61:59] grading paradigm. So [62:00] uh [62:01] a couple things that we'll kind of look [62:03] at which are a little bit different from [62:06] the prior questions [62:08] that were addressed is a so can a [62:10] language model tell whether an agent's [62:13] trajectory succeeded? So the first thing [62:15] is like, okay, uh [62:17] switch out sort of like a summary or [62:20] something like that, give the model the [62:22] trajectory that it it performed when it [62:25] like tried to do a swee bench task or a [62:28] terminal bench task or something like [62:29] that. Without showing the model the unit [62:32] test, can the model simply look at the [62:33] problem, look at the trajectory, and [62:35] tell you whether sort of [62:38] the the trajectory succeeded at the task [62:40] or not, right? And so that sort of like [62:42] is a good preface for like, okay, well, [62:44] if a model's able to understand an agent [62:46] trajectory pretty well, can it then just [62:49] sort of like carry out grading as an [62:50] agent itself, right? And sort of again [62:53] sort of the reliability question. So [62:56] another sort of small difference here [62:58] that's worth noting is that beyond the [63:01] grading of sort of the end state of the [63:03] environment um that we're now thinking [63:06] about grading against the trajectory as [63:08] well or like sort of the problem solving [63:09] sequence. [63:11] Cool. So uh Web Voyager is [63:15] one of the first papers that takes a [63:16] look at this uh for web benchmarks and [63:19] for sort of like these web-style tasks [63:21] that we've uh talked a lot about at this [63:24] point. And so what you can imagine is [63:26] that, you know, if you let's say that um [63:29] you wanted to grade a model on its [63:32] ability to like recreate airbnb.com or [63:35] something like that, right? So one way [63:37] you could go about it would be like, [63:39] okay, well I have, you know, the airbnb [63:41] source code, um the model generates the [63:44] source code. I can write a bunch of unit [63:46] tests generated against sort of the [63:48] reference airbnb source code and then I [63:50] can sort of run the model solution [63:52] against that that set of tests created [63:56] based on the reference, right? And that [63:57] would work. Problem is that like we [64:00] don't have airbnb source code. Uh we can [64:02] just sort of see like uh only sort of [64:05] the the website and sort of, you know, [64:07] the public-facing artifact, right? And [64:09] so with Web Voyager, what they say is [64:11] like, all right, [64:12] maybe instead of uh requiring the source [64:15] code, the way to sort of overcome this [64:16] is you have a language model or in this [64:19] case you have a user sort of send query, [64:21] return query, whatever the case may be, [64:24] the model can do sort of like a random [64:26] walk on the website and that random walk [64:29] effectively just becomes sort of like uh [64:32] a grading trajectory, if that makes [64:33] sense, right? So you have a language [64:35] model go, it goes to airbnb.com, it [64:38] clicks on like login and then booking [64:41] and then, you know, like toggling the [64:43] price and everything. That trajectory in [64:45] and of itself should be replayable on a [64:49] model solution that attempts to recreate [64:51] airbnb.com, right? And so you are sort [64:53] of um [64:55] using language models as agents to [64:57] generate sort of a trajectory that [64:59] serves as verification um and sort of [65:02] that replaces the need to sort of like [65:03] actually have the original source code, [65:05] right? So uh methodologically what they [65:08] do is similar to kind of like the Web [65:10] Arena papers before where we kind of [65:11] talked about how uh you take these [65:14] different surfaces that are not [65:16] necessarily super amenable to what a [65:18] language model is able to do natively, [65:20] and you kind of like take the surface, [65:22] create bounding boxes and clickable [65:24] things. Like if people have played with [65:25] like Selenium or like web scraping stuff [65:27] like this, Beautiful Soup or whatever, [65:30] you create take the website, you ingest [65:33] it, sort of expose the things that are [65:35] clickable [65:36] along with sort of the screenshot [65:38] itself, and you make it possible for the [65:40] agent to kind of navigate around, right? [65:42] So save screenshots of the agent's [65:44] navigation where it clicked and it went [65:46] from this website to this one to this [65:47] one, and then have a judge model take a [65:50] look at the trajectory and the final [65:51] answer. [65:53] And so this is basically trying to [65:54] create like a language model judge for [65:58] web-based tasks, right? [66:01] And then they of course show that it [66:03] works quite well. So I think something [66:06] that's kind of worth [66:08] poking into this paper if this kind of [66:10] stuff interests you [66:12] is that they do some ablations of like, [66:14] okay, when we only give the text to the [66:17] model, or [66:19] in this case like they give all the [66:20] tools, they give all the screenshots, [66:21] they give the whole trajectory, like [66:23] everything it needs for grading. And [66:25] then for sort of a lot of these things [66:27] they like swap out the model or they [66:29] only present like a subset of this [66:30] information that doesn't include sort of [66:32] any visual components, like how does [66:34] that affect the grading, right? And so [66:37] generally I think what this speaks to is [66:40] that when you apply [66:42] language model as agent for grading, it [66:44] could be, you know, it's worth thinking [66:46] about like from the rollout of this [66:49] task, which artifacts do you actually [66:51] want to give the model to ask it to come [66:53] up with a score for? [66:55] Cool. Okay. [66:56] And then there's high agreement there. [66:58] And then so similar to how like web and [67:02] Kua have interacted in the benchmarking [67:04] regime, [67:06] you then sort of have this expansion of [67:07] like, all right, like let's step back [67:09] from web stuff and let's take a look at [67:11] computer use, right? So [67:13] the motivation here is for things like, [67:16] you know, OS world, like these kind of [67:18] like web and device agents only get [67:20] graded by handwritten benchmark checks, [67:23] right? Like if you look at OS World, all [67:25] of that verification was human [67:27] generated. Um, in this case, this is [67:29] kind of more inspecting [67:31] or more asking the question, can a model [67:33] like judge a trajectory and use that to [67:36] improve the agent? So, it's kind of [67:37] like, okay, assume the setting where [67:39] like you don't have human-written [67:42] verification anymore. Can we just sort [67:44] of look at the trajectory itself [67:46] directly and skip all of the need to [67:48] sort of like have human annotators like [67:51] create unit tests and stuff for the [67:53] trajectory and just have the model come [67:55] up with like, okay, it looks like the [67:56] trajectory failed here. We can [67:59] immediately sort of like propagate this [68:01] as a reward signal to like make the the [68:03] the [68:04] the upstream model like perform better, [68:06] right? So, we propose to automatically [68:08] evaluate user instructions and arbitrary [68:10] agent trajectories [68:12] with sort of like [68:14] again, domain general neural models. [68:16] This is kind of revisiting that reward [68:18] model paradigm that we saw from before, [68:20] right? And so [68:22] the rest of it just kind of talks about [68:23] like there's kind of two ways they they [68:26] surfaced the reward, right? So, [68:29] caption then reason approach where the [68:30] VLM takes a look at screenshots and then [68:33] the language model. So like, you know, [68:36] because the language model doesn't have [68:39] visual understanding capabilities, you [68:41] take a weaker VLM [68:44] that is capable of just sort of given [68:45] the screenshot, annotate, like describe [68:48] what's happening, and then the language [68:50] model reasons across those text [68:52] annotations whether the agent succeeded, [68:54] right? The second approach is like, all [68:56] right, there's no need to do this kind [68:58] of like OCR and then reason across the [69:00] OCR. Can we just take like a very strong [69:03] vision model and have it sort of [69:04] evaluate the trajectory directly, right? [69:08] And so, yeah, there's some examples [69:10] here, right? Like, here's the original [69:11] problem statement. The model does click [69:13] and scroll and sort of this web [69:15] trajectory that we've seen before, and [69:17] then you have like a model kind of [69:18] reason over like, okay, well, it looks [69:20] like the user's intent was to post LGT [69:23] M, [69:24] and the task is successful despite the [69:26] early stop. This is like the verdict, [69:29] um, and then, you know, the evaluator [69:30] correctly judges the task execution as [69:32] successful despite the task ending with [69:35] an exception, right? So what this paper [69:37] showed, and this is, um, also kind of [69:40] revealed in some of the coding agent [69:42] trajectories as well, um, is that models [69:44] are actually not particularly good out [69:47] of the box at determining, given a [69:49] trajectory, did the model sort of [69:51] succeed at the task, right? So this kind [69:53] of judgment against trajectory stuff did [69:55] not work as well, uh, as we thought [69:58] immediately, right? Um, so [70:00] yeah, we're running a little low on [70:02] time. So I'll skip over the graphics a [70:04] bit. Um, agent as a judge sort of uh, [70:06] explores this for, um, you know, all [70:09] sorts of different domains, right? So [70:10] again, like before, not just web, not [70:12] just Kua, we're taking a look at coding, [70:14] we're taking a look at sort of like [70:16] anything that might be worth throwing an [70:18] agent at. Um, and so they show they they [70:21] come up with like a separate benchmark [70:23] to demonstrate this use case. Um, and as [70:25] you can see, there's like a whole list [70:26] of like rubrics that come with every [70:28] query. Um, and so so they show here [70:30] again like with all of these papers, [70:32] they always show like a, you know, the [70:34] language model as a judge, um, [70:36] or in this case the agent as a judge is [70:38] better than whatever the prior method [70:40] is. It's aligned with sort of human [70:42] preference, uh, but that there's some [70:43] issues and sort of consistency and stuff [70:46] like that. Um, so cool. Anyway, I'm I [70:48] kind of zoomed through this section a [70:50] little bit because uh, we're not going [70:52] to make it all the way through today, [70:53] but hopefully that makes sense. Are [70:55] there any quick questions about this [70:57] section? No? Okay. All right. Um, [71:00] so biases in validating judgment. We've [71:02] hinted at this before. This is just [71:05] pointing at, um, this idea that like [71:08] with your language models, when they [71:10] when you create a reward model, you need [71:12] to properly sort of make sure that [71:15] they're giving rewards for like the [71:16] right reason, right? And so the two case [71:18] studies we'll look at is from before we [71:20] already saw a reward model might be [71:22] biased by like the order of your answers [71:24] and you don't want that, and then also [71:26] by the length. So the order I'll go [71:27] through very very quickly. So this is a [71:29] paper that kind of examines this very [71:31] directly, which we saw in the previous [71:33] paper, right? Um and so oops, that's [71:36] repeating the text from before. [71:38] Uh but yeah, it's a very simple thing [71:40] where it's like, yeah, we swap the order [71:41] of the responses and we just check if [71:43] the models are consistent. The paper [71:45] shows that the models are not consistent [71:47] and then they devise sort of a way to [71:49] sort of make them more consistent, [71:51] right? Um and so [71:52] yeah, there's some stuff there there's [71:54] some math in the paper. I think there's [71:55] like sort of a [71:57] they they develop a lot of sort of [71:58] formalizations that properly address [72:00] this. Um you can sort of read the paper [72:02] more thoroughly if you want to [72:04] understand how. But anyway, that's one [72:06] thing. Um the other thing is like um [72:08] sort of concurrent to the chatbot arena [72:10] stuff, we kind of have probably talked [72:12] about the Alpaca paper before. Um and [72:14] with Alpaca, what they did was like, [72:16] okay, let's take a look at using GPT-4o [72:20] or GPT-4 mini as the judge instead of [72:22] humans to allow for automated [72:25] benchmarking of instruction following. [72:27] Uh [72:28] a follow-up paper from Jan Leike, [72:30] one of the original members of the [72:32] Alpaca group, is they found out that [72:34] like if you don't constrain the length [72:37] of the summarization or the length of [72:39] the model's output that uh your reward [72:42] model is going to start sort of training [72:45] and biasing it like be trained in a way [72:48] where it 's like biased towards the [72:49] length of the completion and longer [72:50] answers are better, right? And so this [72:52] is clearly not something that's good, [72:54] especially when it uh comes to something [72:56] like summarization. So here they apply [72:59] sort of like the general sort of [73:01] high-level ideas that like, all right, [73:03] we're going to investigate the setting [73:04] where like let's apply like a length [73:06] penalty uh both to the benchmark, but [73:09] then also to the to the post-training [73:12] objective for instruction following. [73:14] Let's see what happens. Um and so what [73:16] they show here is that like, yeah, like [73:18] with these original models, if you just [73:20] sort of like grade um in sort of the [73:23] vanilla Alpaca eval setting, uh you'll [73:25] see that like, you know, the verbose uh [73:28] completions always score better than [73:30] like the more concise ones, and that's [73:32] evidence of the models being biased [73:34] towards longer things. Once we control [73:36] for length, sort of the scores get sort [73:38] of more normalized. [73:41] Cool. Okay. And then [73:44] AutoMetrics, which is Michael's paper, [73:47] is [73:48] with some tasks, some open-ended [73:52] text completion tasks, it's pretty easy [73:55] to grade. You know, the the the [73:56] questions are not particularly [73:58] challenging, [73:59] and so you don't really need an expert [74:01] to grade that instruction, right? [74:05] And here what AutoMetrics takes a look [74:07] at is it's motivated by like, all right, [74:09] there's some sort of new tasks where [74:12] like this paradigm of like having these [74:15] new tasks and then doing generating a [74:18] bunch of like human preferences that [74:20] vote between different completions, it's [74:22] pretty expensive. And so like can we [74:24] very quickly use sort of like bootstrap [74:27] just like a handful of human labels that [74:29] produces a judge that like mimics this [74:31] judgment, right? So this is [74:33] I guess like before you [74:35] people called it kind of few-shot [74:36] learning, but it's like when you have a [74:37] much more limited data sample, can you [74:40] properly mimic human judges? And like [74:42] the idea here is that like Michael kind [74:44] of devised this like big you know set of [74:48] metrics [74:49] along with sort of like and then kind of [74:51] like filtering down these metrics. So [74:52] there's this kind of whole pipeline, but [74:54] the idea is that like we identify sort [74:57] of a set of metrics that are sort of [74:59] most in line for this particular task to [75:02] this human judgment. So I think like a [75:06] simplified way to understand this is [75:08] that like, hey, you have a lot of sort [75:10] of like a a metric bank [75:13] and you have sort of varied [75:15] a very different set of tasks that you [75:17] might grade on then sort of a human [75:19] population. How do you kind of like [75:21] create sort of more customized metrics [75:23] for these type of tasks and these type [75:25] of language model grading oh sorry and [75:28] these types of human graders very [75:30] quickly? So it's like [75:31] um customized to like more specific [75:33] populations of human grading um and sort [75:37] of types of tasks um [75:39] and generating judges for those very [75:41] quickly. So anyway, sorry. This is very [75:43] quick. I know I have like three minutes [75:45] left. So just to get through the rest of [75:46] this um [75:47] for the non-determinism uh we kind of [75:50] covered sort so uh we kind of covered [75:53] this question like early on of like when [75:55] you have multiple rollouts. This is kind [75:57] of taking a step back from language [75:58] model as judges. Like how do you kind of [76:01] like report this course properly, right? [76:03] And so you've already seen this slide [76:04] before. So um to kind of go through each [76:07] of these concretely, right? Pass at K [76:09] was um it was introduced before the [76:11] human eval paper. There were already [76:13] some coding problems that looked at it [76:15] um but this is the one where they kind [76:16] of made it explicit. And in this case um [76:19] especially for um your uh your homework [76:23] two, uh I think pass at K is worth using [76:26] as your key metric if you find that like [76:30] uh you [76:32] are challenging the language model with [76:35] a task that is fundamentally quite [76:37] difficult and you just care that it [76:39] passed at least once, right? So the math [76:41] on the [76:43] right um so so the high-level goal here [76:45] is like you you want a metric that just [76:47] reports like how often does the model at [76:51] solve the task at least once? Um the [76:53] reason we we have these kind of like [76:55] combinatorics and sort of this expected [76:57] value and all the sort of math around it [76:59] is to sort of make the calculation of [77:01] this metric agnostic to order. Um and so [77:04] like you can read the paper a little bit [77:06] more specifically, but it's basically [77:07] saying like okay, if we do five rollouts [77:10] um and you have a couple numbers, right? [77:13] So five in this case is going to be n [77:15] and your k is going to be three. Like [77:17] okay, let's do like five rollouts. Um [77:19] what is our pass at three given we're [77:21] doing five rollouts, right? And so the [77:23] idea here is that like your pass at [77:25] three basically means like hey, if we do [77:28] three runs, like how many times does it [77:31] pass at least once out of those three? [77:33] And you can do this kind of calculation [77:35] to make sure that the score that you [77:36] report is agnostic to sort of like the [77:38] ordering um of these trials if that [77:41] makes sense. [77:42] Cool. Okay. Uh pass k is basic like the [77:46] inverse of this, right? So this is kind [77:48] of like the tau bench scenario where [77:50] like you know with customer service or [77:51] something you care more that the [77:53] language model gets the problem correct [77:55] every single time and so like this score [77:58] is simply measuring like hey if you do [78:00] like n rollouts and you're calculating [78:03] calculating like a pass k or something [78:05] like that then like how many time like [78:08] if you do these three trials what's the [78:10] likelihood that like every single trial [78:12] is going to result in a pass and so [78:14] that's like a different way to to report [78:16] this metric and then um [78:18] this is sort of just making it very [78:20] explicit about why average is [78:22] potentially sort of like not a good [78:24] idea, right? So just to sort of make it [78:26] very concrete right like um you guys [78:28] will create your your one task for [78:31] homework two um and you can imagine when [78:33] you do roll outs and when you run Gemini [78:35] 3.8 on all of those tasks it can look [78:37] very different, right? So I guess in the [78:40] homework case you're only you're only [78:42] going to sort of create one task uh but [78:44] if you created a benchmark where you [78:46] have multiple tasks, right? [78:48] Agent A and agent B they solve it [78:50] clearly in very very different ways. If [78:52] you simply report the average it's going [78:54] to look the same, right? But if you [78:56] report pass at k versus pass k you'll [78:59] get very very different numbers for the [79:01] performance of A and B and so [79:03] again at the end of the day depends on [79:05] the task in terms of which one you [79:06] report um there's not necessarily like [79:09] uh uh absolutely correct one to use, [79:11] right? [79:12] Cool. Okay. So I guess to summarize a [79:15] little bit like uh with pass k you know [79:17] like [79:18] yeah this is sort of like you know maybe [79:20] you have like a super hard math problem [79:22] you're not afraid of throwing a lot of [79:24] compute at it you just care that it gets [79:25] solved once. [79:26] Pass k you care more about reliability. [79:29] Okay. Cool. All right. This is the last [79:31] slide. I guess I won't see you guys for [79:34] uh [79:35] the next lecture where the next week [79:37] we'll kind of talk about safety. Uh the [79:40] next lecture we'll have uh Carlos and [79:42] Alex who are part of the original [79:44] Sweebench team come. So they'll uh we'll [79:46] do sort of a guest lecture with them on [79:48] Monday and then I'll see you guys one [79:50] last time for the coding agents lecture [79:53] uh after Thanksgiving. Cool. Thanks [79:55] everybody. Thanks.