Track 05 · EvalsLesson 06 of 10

Online evals, A/B tests and flags

Measure what real users do, safely, once offline evals say yes.

What you'll be able to do

What you'll be able to do

01
  • Explain why a candidate that wins offline can lose in production, and name the online signals that reveal it.
  • Choose between shadow mode, a limited pilot and a randomised A/B test for a given change and risk level.
  • Design an A/B test for an LLM feature: hypothesis, randomisation unit, sticky assignment, primary and guardrail metrics, sample size, minimum detectable effect and duration.
  • Implement deterministic hash-based assignment, a two-proportion z-test and a sample-size calculator with no dependencies.
  • Diagnose invalid experiments: sample ratio mismatch, peeking, novelty effects and interference between units.
  • Defend an experiment plan, including how sampled production data is handled, to a model-risk reviewer and a privacy officer.
Before you start

Before you start

The short version

The short version

Offline evals tell you whether a change is safe to try. Only real users tell you whether it is better. Golden sets are frozen samples of yesterday's traffic, judges are proxies, and users change their behaviour when the assistant changes. So after a change passes its CI gate, you measure it on live traffic. Start with shadow mode when the risk is high (the candidate runs on real inputs but nobody sees its output), then run a randomised controlled experiment when you need a causal answer. A good experiment is designed before it starts: one primary metric tied to the business outcome, guardrail metrics for safety, latency and cost that can veto a launch, a randomisation unit that matches how users interact, sticky assignment, a sample size computed from a minimum detectable effect, and a fixed duration or a sequential method that tolerates peeking. Feature flags carry the variant assignment in code, and every trace records which variant served it. Online judges score a sample of live traffic, and that sample is personal data, so redact and govern it.

  • Offline gates decide what is safe to test. Online experiments decide what ships.
  • Pick the metric, the unit, the sample size and the stop rule before day one. Changing them after you see data invalidates the test.
  • Guardrails can veto a winning primary metric. A faster resolution that raises policy violations is not a win.
  • Check the split before you read the result. A sample ratio mismatch means the data is broken, not that the treatment worked.
  • Sampled production traffic is regulated data. Redaction, retention and residency apply to judges and reviewers too.

Pro lesson

The rest of this lesson is in Pro.

The mental model, worked example, field note, failure table, exercise and self-check, with the voice tutor.

  • Every stage and specialisation, in full
  • Every lab and every role project
  • Halden weeks 2–10, on your record
  • Every drill, live in the playground
  • All solutions, plus the server judge
  • Lab Assistant and every Teach with AI