esc
  • WorkflowsPages
  • Case studiesPages
  • Machine Learning FoundationsLearn
  • AI EngineeringLearn
  • AI Guardrails & Red TeamingLearn
  • UI/UXLearn
  • Design SystemsLearn
  • Production System DesignLearn
  • AI papersPages
  • Interview KitPages
  • Book a callContact
Letโ€™s talk

Iโ€™ll build the agent for it.

How Do You Sample Production Traffic for Evals?

How to choose live chats to score for AI evals: random, stratified and flagged samples, privacy and weighting, for your AI interview.

In short

Take a sample of whole conversations from live traffic, not every chat. Use a random slice for the honest failure rate, and a fixed floor for rare, risky requests so their failures are not missed.

12 min readIntermediateOccasional ยท estimateFacts checked 27 November 2026

Say it out loud

Read it once, then say it without looking. Start with the short one; use the long one when they ask you to go deeper.

Production traffic is the real chats my AI gets after launch. I don't score every one, because a judge or a person has to read each chat. I take a random slice for the honest overall failure rate. I also keep a fixed floor of rare, risky chats, like fraud reports, so their failures are not missed. Before I quote a rate from the floor, I weight it back to real traffic. And I mask personal data before anyone reads a chat.

What does sampling production traffic mean, in plain words?

Production traffic is the real stream of chats and requests that users send after the app goes live. Sampling means taking a small set of those chats to score, instead of scoring all of them. Every score needs a judge, which is another AI model that grades the bot's answers, or a person to read the chat. Both take time and money.

Think of a bank's call-quality team. They do not play back every call. Each week they listen to a random set of recorded calls, which tells them how the phone line is doing overall. They also listen to every call about a serious issue, such as a report of fraud, because one missed fraud call matters more than its small share of all calls.

An AI case works the same way. A made-up card-help bot gets about 10,000 chats a day. About 1 in 100 is a possible fraud report, and a bot that misses those is the failure that hurts customers most.

Key words

Production traffic
The real chats and requests from users, after the app is live.
Trace
The saved record of one chat: each step the bot took, the tools it used and its answer.
Stratified sample
A sample that picks a set number from each group, so rare groups are not missed.
Sampling rate
The share of chats kept. A rate of 0.1 means one chat in ten.
Test set
The saved set of test chats that the team reruns before each release.

Which chats should you sample?

There are three common ways to pick chats. Each one answers a different question, so a good team uses more than one.

  • Random

    Every chat has the same chance

    A plain random slice of live chats. It gives the honest overall failure rate, but a rare, risky case may never be picked.

  • Stratified

    A fixed floor for each group

    A set number is picked from each group, such as fraud reports. It finds rare failures, but its numbers tilt, so weight them before you quote a rate.

  • Signal-triggered

    Chats that users flagged

    Thumbs-down clicks, chats passed to a human agent, and chats where a safety filter stepped in. Good for finding bugs to fix, but biased, so never quote a rate from it.

Anthropic's guide calls user feedback "sparse and self-selected", which is why thumbs-downs can point at bugs but cannot give a rate. OpenAI's guide makes a related warning: eval data can fail to "faithfully reproduce production traffic patterns".

  • โ€œBiased design: Creating eval datasets that don't faithfully reproduce production traffic patterns.โ€

    OpenAI, evaluation best practices

  • โ€œProduction monitoring kicks in post-launch to detect distribution drift and unanticipated real-world failures.โ€

    Anthropic, on agent evals

Where the sampled chats go

Live chats

Real customers, after launch

Trace saved

Personal data masked first

Pick the sample

Random slice

Honest overall rate

Floor for risky chats

Rare failures are not missed

Flagged by users

Finds bugs, never a rate

Score and check

Score it

Code checks, then a judge

Weekly human read

A few chats, read by a person

Test set grows

Each real failure is added

  1. 1Each chat is saved as a trace, with personal data masked.
  2. 2Some saved chats are picked at random.
  3. 3Rare, risky chats are picked on purpose.
  4. 4Chats that users flagged are picked too.
  5. 5Random picks are scored with code checks and a judge.
  6. 6Floor chats go through the same scoring.
  7. 7Flagged chats go through the same scoring.
  8. 8A person reads a few scored chats each week.
  9. 9Each real failure joins the test set.
Each saved chat is sorted into one of three groups, and every group is scored. A person reads a few scored chats each week, and each real failure joins the test set. Only the random slice gives an honest rate, and the floor group must be weighted before you quote it.

Two settings are easy to mix up. The logging rate decides how many chats are saved as traces at all. The scoring rate decides how many saved traces get graded. A chat that was never logged cannot be scored later. LangSmith's docs describe the same idea: at high volume, you may not want to log every trace.

How do you keep a sampled score honest?

The trap is quoting a rate from a sample that was tilted on purpose. Here is the made-up card-help bot again, with the numbers printed. The code uses a fixed seed, so every run prints the same result.

Python
# A made-up bank's card-help bot: 10,000 chats, about 1 in 100 is a possible fraud report.
# Made-up failure rates: the bot misses 1 in 10 fraud reports and 1 in 100 other chats.
import random

rng = random.Random(7)  # a fixed seed, so every run prints the same numbers
chats = [{"fraud": rng.random() < 0.01} for _ in range(10_000)]
for c in chats:
    c["failed"] = rng.random() < (0.10 if c["fraud"] else 0.01)

fraud = [c for c in chats if c["fraud"]]
other = [c for c in chats if not c["fraud"]]
rate = lambda group: sum(c["failed"] for c in group) / len(group)
print(f"Fraud chats: {len(fraud)} of {len(chats)}, true failure rate: {rate(chats):.1%}")

random_2pct = rng.sample(chats, 200)  # a plain random 2% slice
print(f"Random 2% sample: {sum(c['fraud'] for c in random_2pct)} fraud chats")

stratified = rng.sample(fraud, 100) + rng.sample(other, 200)  # a floor of 100 fraud chats
share_fraud = len(fraud) / len(chats)
print(f"Stratified sample, unweighted: {rate(stratified):.1%}")
weighted = share_fraud * rate(stratified[:100]) + (1 - share_fraud) * rate(stratified[100:])
print(f"Stratified sample, weighted to real traffic: {weighted:.1%}")

Output

Fraud chats: 106 of 10000, true failure rate: 1.1%
Random 2% sample: 2 fraud chats
Stratified sample, unweighted: 4.0%
Stratified sample, weighted to real traffic: 2.1%

A plain random 2% slice, 200 chats, caught only 2 fraud reports. That is too few to judge how the bot handles fraud. So the team takes a floor of 100 fraud reports and 200 other chats. Scored as they are, those 300 chats say 4.0%, which is too high, because fraud is over-represented. Weighted back to real traffic, the same chats say 2.1%. The true rate in this made-up data is 1.1%, so the weighted figure still wobbles with only 300 chats. The lesson is the direction of the tilt, not the exact figure.

Weighting a stratified sample

Fraud reports

Rare: about 1 chat in 100

Everything else

The other 99 in 100

Fraud failure rate

Measured on its own sample

Other failure rate

Measured on its own sample

Weigh by real share

Fraud is a small share

Overall rate

The number you can quote

  1. 1The fraud group is scored on its own sample.
  2. 2The other chats are scored on their own sample.
  3. 3Fraud's rate gets its small real share.
  4. 4The other chats' rate gets their large share.
  5. 5The weighted total is the rate you quote.
Each group is measured on its own sample. The fraud group gets its small real share and the other chats get their large one, so the total matches real traffic.

How would you set up sampling for a bank's card-help bot?

Start with the risk, not the traffic. The bot can freeze cards and open fraud cases, so a missed fraud chat hurts a real customer. A customer types "Someone used my card in another city, what do I do?" and the bot answers with a refund policy instead of opening a fraud case. That is the failure I must catch, even when it is rare.

  1. 1

    Mask, then store

    Save each chat as a trace, but mask card numbers, names and addresses before anything is stored or read. LangSmith's docs also suggest a dedicated tool for finding personal data (PII, personally identifiable information) in harder cases.

  2. 2

    Set the two rates

    Log every chat that mentions a card, using conditional tracing (a rule that always logs chosen requests), and sample the rest at a rate the team can afford to read. Then set a separate scoring rate on the saved traces.

  3. 3

    Keep a floor for fraud

    Each week, take a fixed set of fraud and freeze chats, so a rare failure always gets read. Weight the numbers before you quote them.

  4. 4

    Check with code first

    Code checks cheap facts first, such as whether a fraud case was opened. A judge model then grades the rest against a written scoring guide.

  5. 5

    Put a person on it

    A reviewer reads a few scored chats each week and checks that the judge agrees with them. Anthropic's guide says to sample transcripts to read weekly.

  6. 6

    Feed failures back

    Each real failure joins the test set, so the next release is checked for it.

What does the interviewer want to hear?

A strong answer covers

  • Sample whole conversations, not single messages.
  • A random slice for the honest overall rate.
  • A fixed floor for rare, high-stakes groups, weighted before you quote a rate.
  • Two settings: how many chats are logged, and how many are scored.
  • Personal data masked before anything is stored or reviewed.
  • Every real failure goes back into the test set.

Common traps

  • Trap"Score 20 chats a week and we have it covered."

    BetterTwenty chats cannot show a 1 in 100 risk. Size the sample to the risk you must catch.

  • Trap"Thumbs-down chats show our failure rate."

    BetterThumbs-downs are a self-selected group. Use them to find bugs, and a random slice for the rate.

  • Trap"We log everything, so there is nothing to sample."

    BetterLogging everything costs storage and review time, and stores more personal data. Sample what you read, and mask what you keep.

Can you spot the bias?

Spot the bias

A team reads only the chats users thumbs-down, then reports a 38% failure rate. Which statement is safe to make?

Quick check

Which sample gives an honest overall failure rate for the whole bot?

Can you answer these from memory?

Flash cards ยท tap a card to flip it

1 / 6

What will they ask next?

  1. Q247Offline vs online evaluation?11 min
  2. Q259Which production metrics matter for a chatbot?10 min
  3. Q260What is tracing for LLM apps?10 min
  4. Q261How do you detect drift?12 min
  5. Q268How many eval examples are enough?11 min
  6. Q248What is a golden dataset, and how do you build one?11 min

Last updated on 27 November 2026

Running a live AI feature and not sure what it gets wrong?

I design and build AI products and agents, including the checks that run after launch. Book a short call and tell me what your live traffic looks like.