download

Your bot passes 20 test prompts. Why does it fail users?

AI engineering~10 minReviewed 3 Dec 2026Free · No sign-in

Question

Before launch, a support assistant passes 19 of 20 hand-written prompts (95%). In week one, 28% of real user tickets fail.

Look at the two test sets:

SliceHand-written dev (20)Stratified held-out (100)Held-out pass
Core FAQ184038/40 (95%)
Edge policy rules22515/25 (60%)
Unanswerable queries02010/20 (50%)
Logged bug regressions0159/15 (60%)
  1. Why did the 20-prompt score mislead the team?
  2. How do you structure and split an evaluation dataset before the next release?
Show hints (3)
  1. "CHECK MISSING SLICES"

    Count how many unanswerable queries and logged bugs sit in the 20-prompt list. Can a score of 95% detect failures you never test?

  2. "PROMPT OVERFITTING"

    If you edit the system prompt until those same 20 prompts pass, the prompt fits those examples. What happens on new phrasing?

  3. "SPLIT DEV AND TEST"

    Stratify real tickets across all four slices, then freeze a separate held-out test set that you never read while tuning prompts.

Show checked explanation

Those 20 prompts are 90% easy FAQ and contain zero unanswerable queries or past bugs. Worse, tuning the prompt on those same 20 examples causes prompt overfitting. Build a stratified dataset from real logs covering core intents, edge rules, unanswerable queries, and regressions. Keep a frozen held-out test slice separate from your dev tuning set.

"SOLUTION · PYTHON"
dev_ids = {f"d{i}" for i in range(1, 101)}
test_ids = {f"t{i}" for i in range(1, 101)}
held_out = [  # (slice_name, passed, total)
    ("core_faq", 38, 40),
    ("edge_policy", 15, 25),
    ("unanswerable", 10, 20),
    ("regression_bug", 9, 15),
]
overlap = dev_ids & test_ids
assert not overlap, f"dev/test leak: {overlap}"
total_ok = sum(ok for _, ok, _ in held_out)
total_n = sum(n for _, _, n in held_out)
for name, ok, n in held_out:
    print(f"{name:14} {ok:2}/{n:2} ({ok / n:.0%})")
print(f"held-out pass: {total_ok}/{total_n} ({total_ok / total_n:.0%})")
"OUTPUT"
core_faq       38/40 (95%)
edge_policy    15/25 (60%)
unanswerable   10/20 (50%)
regression_bug  9/15 (60%)
held-out pass: 72/100 (72%)

Code and calculations run on CPython 3.12.10 against the local fixture above; official scikit-learn and NIST documentation links checked. Checked by an editor other than the author.

Walkthrough

A tiny happy-path list fails for two separate reasons: missing failure modes and prompt overfitting.

1. Blind spots in the 20 prompts. Eighteen of the 20 prompts (90%) are simple FAQ lookups, and only 2 (10%) test edge rules. None test unanswerable questions or past production bugs. Passing 18/18 FAQ and 1/2 edge cases produces 19/20 (95%), yet says nothing about the hard tickets real users send.

2. Stratify across real risk buckets. Pull real user queries from logs and group them into clear buckets before sampling:

BucketDev (100)Frozen test (100)Purpose
Core FAQ4040Catch breaks on main traffic
Edge policy rules2525Test exceptions and multi-step rules
Unanswerable queries2020Catch guessing when facts are missing
Logged bug regressions1515Ensure fixed bugs stay fixed

On the 100-case frozen held-out set, the same assistant scores 38 + 15 + 10 + 9 = 72/100 (72% pass, 28% fail). Every weak slice jumps off the page: 60% on edge rules, 50% on unanswerable queries, and 60% on regressions.

3. Separate dev from frozen held-out test. Just like train and test splits in machine learning, you tune prompts and inspect errors on the dev slice (d1 to d100). You keep the held-out slice (t1 to t100) locked and run it only for release decisions. Check that dev_ids & test_ids is empty, and group near-duplicate tickets into the same split so phrasing does not leak across them.

4. Grow the set continuously. Every time a user hits a new bug in production, add a sanitized case to the regression bucket. Periodically refresh part of the held-out slice from recent traffic so the eval tracks how user behavior changes.

Common mistakes

  • Writing all test prompts by hand. Engineers write tidy grammar, while real users send typos, slang, and half-finished questions.
  • Tuning prompts on the only eval set you own. The prompt memorizes those 20 cases, while real traffic still fails.
  • Putting near-duplicate tickets in both dev and held-out sets. Slight wording edits leak answers across the split and inflate test scores.
  • Keeping the eval frozen forever. As policies and user intents shift, stale prompts stop matching production traffic.

Follow-up questions

  • "You have not launched yet, so you have no user logs. How do you build the first eval set?" Seed it from support tickets, sales call notes, help-center docs, and red-team prompts for missing facts. Tag every seed case as synthetic. Once live traffic arrives, replace most synthetic cases with sanitized real queries while keeping your frozen held-out boundary.
  • "When should you rotate or expand the frozen held-out set?" Add new regression cases after every major incident, and refresh a slice from fresh traffic every quarter. Keep version tags on each dataset release so you can compare a new model against last month's baseline on the exact same frozen cases.

What a strong answer covers

Spots that the 20-prompt list is 90% easy FAQ with zero unanswerable or regression cases, and is overfit during prompt tuning. Proposes a stratified dataset from real logs split cleanly into a mutable dev set and a frozen held-out test set with zero overlap.

Open in interactive practice deck →

Original OfferVibe question. scikit-learn Cross-validation Guide · NIST AI 600-1 Generative AI Profile.
© 2026 OfferVibe · Text CC BY-NC-SA 4.0 · code MITFree to share and adapt with credit, not for commercial use. Code samples are free for any use.