QA AND TEST AUTOMATION · PART 10 · TESTING AI FEATURES · EVALS · 89 OF 112

LLM Evals for Testers: Golden Sets and Metrics

How testers measure answer quality: a golden set of questions with required facts, forbidden content and expected sources, run several times against ShopRung's chat on a real local model. The real result: 32 of 36 answers passed, one question failed every time because retrieval missed, and two misleading answers passed keyword checks, which is why evals need more than keywords.

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 31
  32. 32
  33. 33
  34. 34
  35. 35
  36. 36
  37. 37
  38. 38
  39. 39
  40. 40
  41. 41
  42. 42
  43. 43
  44. 44
  45. 45
  46. 46
  47. 47
  48. 48
  49. 49
  50. 50
  51. 51
  52. 52
  53. 53
  54. 54
  55. 55
  56. 56
  57. 57
  58. 58
  59. 59
  60. 60
  61. 61
  62. 67
  63. 68
  64. 69
  65. 70
  66. 71
  67. 72
  68. 73
  69. 74
  70. 75
  71. 76
  72. 77
  73. 78
  74. 79
  75. 80
  76. 81
  77. 82
  78. 83
  79. 84
  80. 85
  81. 86
  82. 87
  83. 88
  84. 89
  85. 90
  86. 91
  87. 92
  88. 93
  89. 94
  90. 95
  91. 96
  92. 97
  93. 98
  94. 99
  95. 100
  96. 101
  97. 102
  98. 103
  99. 104
  100. 105
  101. 106
  102. 107
  103. 108
  104. 109
  105. 110
  106. 111
  107. 112
1 / 11

Press play to hear the narration, or step through at your own pace.

Key takeaways

  • Questions + must, must not, source
  • N runs
  • 32/36
  • 12 mugs: retrieval miss
  • keywords miss meaning
  • baselines

Notes

The golden set

Each golden entry is a question plus expectations. Which help section should be retrieved. Facts the answer must contain: for shipping, four ninety nine and seventy five dollars. Things it must never say: for returns, ninety days, a common policy elsewhere but wrong here. Keep the set in Git as JSON or CSV, so changes are reviewed like code.

golden.json, one entry
{"q": "How much is shipping?",
 "category": "happy path",
 "source": "Shipping costs",
 "must": ["$4.99", "$75.00"],
 "must_not": []}

{"q": "Can I return an item I
   bought last week?",
 "must": ["30 days"],
 "must_not": ["90 days"]}

What goes in

Fill the set from the requirements and from risk. Happy paths: shipping, refunds, passwords. Rules and edges: can a shipped order be cancelled, two coupons on one order, twelve mugs when the limit is ten, the expired WELCOME fifteen. Out of scope: the capital of France, which must be refused. Adversarial questions come in later episodes. Over time, add real customer questions, especially the ones that went wrong.

ShopRung golden set: 12
  • happy path: shipping, refund, password, when it ships
  • rules and edges: shipped order cancel, two coupons, 12 mugs (limit is 10), WELCOME15
  • out of scope: capital of France
  • adversarial (next episodes): injections, prompt leaks
  • later: real customer questions

Run it

The runner is simple: for each question, call the chat several times and save everything, the answer, the sources, the model, the prompt version and the tokens. We ran ShopRung's twelve questions three times each on llama three point two, thirty six answers, and kept the raw results in a file, so the checks can be changed and rerun without asking the model again.

The runner
for item in golden:
  for run in 1..3:
    r = POST /api/support/chat
          {"message": item.q}
    save q, run, answer, sources,
      model, promptVersion, usage

real run: 12 x 3 = 36 answers
llama3.2:3b, temperature 0.7

Scores

Here are the real scores. Ten questions passed three times out of three. Cancelling a shipped order passed twice: once the model invented a phone team. Can I buy twelve mugs failed all three times. Overall, thirty two of thirty six, eighty nine percent. The per question view matters more than the total: it tells you where to look.

Pass rate per question
3/3 shipping, discount code,
    return, SAVE10 case, password,
    when it ships, WELCOME15,
    refund, France, two coupons
2/3 cancel a shipped order
0/3 can I buy 12 mugs?

overall: 32/36 = 89%

Find the cause

When a question fails every time, find the layer. For the twelve mugs, retrieval returned gift ideas and the search help, never the section saying each line allows one to ten. The question never says quantity, so keyword retrieval matched mugs instead. The model could not answer what it was not given. Measuring retrieval separately: the expected section was in the top three for ten of eleven questions.

"Can I buy 12 mugs?"
retrieved: Gift ideas, Searching
expected:  Quantities and stock
            (1 to 10 per line)

the question never says
  "quantity": keyword retrieval
  found mugs, not the rule

section recall@3: 10/11
MRR: 0.91

Blind spots

Now the honest part. Two answers passed the checks yet were poor. One said ShopRung currently offers three codes, including WELCOME fifteen, then that it had expired: contradictory. Another got thirty days right but wrapped it in reasoning that makes no sense. Keyword checks see words, not meaning. That is why evals add an LLM judge or a human review, the next episode.

Passed the keyword checks
"We currently offer three coupon
 codes: SAVE10, FLAT5, and
 WELCOME15. ... WELCOME15, which
 expired on 31 December 2025."

"You can still return the item
 within 30 days of delivery, which
 is likely less than a week from
 now."

Use it

Use the eval on every change. Today's scores are the baseline. When someone edits the prompt, swaps the model or changes retrieval, rerun the same golden set and compare question by question, because a better total can hide a new failure. Set thresholds, a high overall rate and one hundred percent for safety checks, and keep the raw answers so you can improve checks without paying for new model calls.

Evals in the workflow
  • baseline: the scores today
  • change prompt, model, retrieval → rerun the same golden set
  • compare per question, not only the total
  • thresholds: overall ≥ 85%, safety checks 100%
  • store raw answers: rescore without new model calls

Common mistakes

Mistakes. A golden set of only easy questions. One run per question. Reporting only the overall score. Trusting keyword checks as the whole truth. Tuning the prompt to this exact set until it passes, which overfits; keep some questions aside. And never adding the real failures customers report, which are the most valuable questions of all.

Avoid these
  • only easy happy-path questions
  • one run per question
  • only an overall score
  • keyword checks as the whole truth
  • tuning the prompt to the golden set until it passes (overfitting)
  • never adding real failures

Say it like this

In the interview: a golden set in Git, questions by category, each with required facts, forbidden content and the expected source. A runner calls the feature several times per question and stores the raw results; checks score them, including retrieval separately. Every prompt, model or retrieval change is compared question by question against the baseline, and an LLM judge or a human covers meaning, which keywords miss.

In the interview
  • "A golden set in Git: questions
  • by category with required facts, forbidden content and expected
  • sources. A runner calls the feature several times per question and stores raw results;
  • checks score them; we compare
  • per question against a baseline
  • on every change, with a judge or human for meaning."

Interview questions

Q1What is a golden set?

A fixed, versioned set of questions with expectations (required facts, forbidden content, expected sources) used to evaluate an AI feature repeatably.

Q2What is an eval?

A repeatable run of the golden set through the feature, with checks that score each answer and produce metrics to compare between versions.

Q3What should a golden set cover?

Happy paths, rules and edge cases, out-of-scope questions, adversarial inputs, and real failures from production.

Q4Why evaluate retrieval separately in RAG?

If the right passage is not retrieved, the model cannot answer correctly; recall@k and MRR show whether a failure is retrieval or generation.

Q5What did keyword checks miss on ShopRung's chat?

A contradictory answer listing the expired WELCOME15 as currently offered, and a correct fact wrapped in nonsensical reasoning; both passed.

Q6Why store raw answers?

So checks can be improved and rerun without new model calls, and results can be compared and reviewed later.

Q7What is overfitting to a golden set?

Tuning prompts until that exact set passes, so scores rise without real improvement; keep held-out questions.

Q8How do evals fit into CI?

Run on prompt, model or retrieval changes, compare per question with the baseline, and fail on thresholds such as overall pass rate and 100% safety checks.