liveBook · Manning

Experimentation

As explained in Introduction to Generative AI, Second Edition

A/B testing is an experimental method that compares alternative versions by measuring their performance under controlled conditions.

A/B testing measures user preferences by comparing two versions under real production conditions. A system offers different models or prompts to groups of users, then compares outcomes such as engagement, satisfaction, or other chosen metrics. section 7.10

This approach answers questions that response scoring alone cannot, especially whether users prefer one version. It should complement human judgment, deterministic checks, or an LLM judge rather than replace them. Automated judges can reward superficial cues instead of intended quality, so evaluators require regular checking. section 7.10 section 7.10

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 A/B testing with human preference judgments, heuristic evaluation, and LLM-based judging to see how each method balances scalability, cost, and reliability. section 7.10

How Introduction to Generative AI, Second Edition covers it

How deep it goes
Explains the comparison setting and outcome metrics but stops short of experimental design or statistical procedures.
Examples
Compares two models or prompts using engagement, satisfaction, or other selected production metrics.
What it assumes
Assumes a production system, alternative models or prompts, and meaningful metrics for comparison.
What you can do after
Evaluate user preferences empirically instead of relying only on a small sample of inspected responses.
How it connects
Connects A/B testing with prompt engineering, LLM evaluation, human judgment, heuristics, and LLM judges.

Also explained in

Compare how 16 books explain experimentation →

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.