liveBook · Manning

Evaluation dataset

As explained in Introduction to Generative AI, Second Edition

An evaluation dataset is a collection of task inputs paired with expected or verifiable outputs for measuring a model's performance.

An evaluation dataset collects task inputs with expected, verifiable, or human-assessed outputs so a model's performance can be measured. It turns vague impressions into repeatable checks for accuracy, quality, or tone. section 7.10 section 7.9

A small set of examples can function as unit tests: each test checks whether a condition that should always hold is satisfied. Larger datasets support aggregate measures such as pass rate and reveal subtler changes across prompts. section 7.9

Choose the evaluation method according to what can be verified:

  • Use deterministic checks for narrow, objective conditions such as multiple-choice answers, extracted information, or response length. section 7.10
  • Use expert labels when qualities such as friendliness, enthusiasm, or tone require judgment, while recognizing that manual review is costly and difficult to scale. section 7.10
  • Use an LLM judge for scalable subjective evaluation, but validate it against expert-reviewed examples because automated annotators can be biased. section 7.10
  • Create prompts manually, synthetically, or from production logs; synthetic prompts scale cheaply but may not represent real user language. section 7.9

Real-estate listing test

Given “2 bed 1 bath condo, Brooklyn, NY,” test whether the generated description identifies two bedrooms. Repeating such checks across examples produces a dataset whose pass rate can track prompt changes. section 7.9

Table 7.6 Methods of generative AI evaluations

Type of evaluation

When to use

Advantages

Disadvantages

Human preference or judgment

Before an LLM judge is validated, or to confirm hypotheses about human preferences

  • Typically close to ground truth for preferences and judgment (if raters are trained in the task)
  • Expensive
  • Not scalable

Heuristic evaluation or verifier

When “checking” the response or computing a metric can be done deterministically (such as with multiple-choice questions or measures like response length)

  • Cheapest
  • Easiest to scale
  • Always accurate, since metric is objective
  • Only applicable to a narrow subset of evaluations

LLM as judge

When the judgment of the response is for any nonverifiable or subjective quality

  • More expensive than heuristics due to inference costs, but cheaper than humans
  • Scalable
  • Annotators may have biases or be fooled by reward hacking

A/B test

When interested in user preferences and behavior in a live production setting

  • Number of data points is orders of magnitude higher
  • Ground truth for product impact
  • Requires users and a production environment
  • It can be difficult to attribute changes due to other factors in usage, like seasonality

Compare human judgment, deterministic verification, and LLM judges by cost, scalability, applicability, and limitations. section 7.10

How Introduction to Generative AI, Second Edition covers it

How deep it goes
Explains dataset assembly, unit tests, scoring choices, and collection methods, but stops short of implementation details.
Examples
Uses real-estate listing prompts, bedroom-count checks, expert-reviewed descriptions, and production logs as evaluation artifacts.
What it assumes
Assumes a defined task and desired response qualities while teaching evaluation checks, labels, metrics, and scorer tradeoffs.
What you can do after
Build it from scratch by assembling prompts, defining checks, selecting scorers, and tracking pass rates across iterations.
How it connects
Connects evaluation datasets with unit testing, evaluation benchmarks, human evaluation, synthetic data generation, and LLM judges.

Also explained in

Compare how 27 books explain evaluation dataset →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Introduction to Generative AI, Second Edition. The section links point to the parts of the book it draws on.