Michalina Graczyk

Golden set + evals: The foundation of reliable LLM tests

8 min read
🇬🇧
LLMQAEvalsGolden Set

This post is translated from Polish. Read the original

In the first part we talked about LLMs being non-deterministic. In the second - that classic “pass/fail” does not work and we have to evaluate different aspects of the answer (evals).

In the third part, it is time to combine this into a process that answers the most important question in QA: “How do I know that after a prompt or model change the system really works better?”.

The answer is a duo: golden set + evals. And relax - if so far you have worked mostly with API or mobile tests, moving into the world of AI is not that hard at all.

What is a golden set?

A golden set is a set of prompts and reference answers, approved by humans, that serve as a point of reference (ground truth) when you test the model. Something like the “golden rules” of test cases.

Except that in the LLM world the expected result is not a rigid frame, but a set of information:

  • A reference answer that shows the ideal tone and structure.
  • An expert comment that explains why this answer is good.
  • Quality criteria (evals) that let you measure how well the task was done.

You can think of it as “scaling expert knowledge”. You decide once what success sounds like, and automation guards it for you with every next change.

Why do we need a golden set if answers can differ?

Because different answers can also be good. A golden set does not pretend to be deterministic. It does something much more important: it sets the limits of acceptability.

  1. It defines success: It is your “Expected Result”, but in a flexible version. It sets the standard you expect from the system.
  2. It enables evaluation by comparison (Reference-based): This is the key concept. Whoever evaluates (a human, or later another AI model) does not check the text 1:1. They use your reference as a semantic signpost. They know the answer should contain the same facts and tone as the reference, even if it uses different words.
  3. It protects against regression: This is your main safety switch. When you update the model or change the prompt, the Golden Set tells you right away: “careful, the content quality dropped”. Without it, you are working blind.

It is a bit like the photo in your ID: each of us looks a little different every day, but is still the same person. The golden set tells us: “this is still an acceptable answer”.

What makes a good golden set?

Ideally, every example in the golden set contains four key elements:

1. Prompt

That is, what the user will type. Not “nice prompt engineering”, but real input: short, crooked, ambiguous, badly worded, and sometimes absurd.

A golden set should mirror real user behavior - and users do not write perfect prompts. (I don’t either.)

2. Expected good answer (golden answer)

It does not have to be the one and only correct text. It can be:

  • a reference answer defined by a human,
  • a few examples of equivalent answers,
  • a draft + a comment (“the answer should contain A, B, avoid C”).

3. Evaluation by evals categories

This is where the magic happens. A golden set is not only a set of answers, but also their evaluation by the evals categories:

  • Fidelity (does it do the task),
  • Relevance (does it stay on topic),
  • Safety (is it safe),
  • Tone (does it sound right),
  • Context (does it use the context).

The golden answer always has a high score - it is our reference.

4. QA comments

The most important element, and many people forget it. A good golden set contains notes:

  • why this answer is correct,
  • what would be a mistake,
  • where the tolerance limits are (for example “it can be worded differently, but it must contain X”).

This describes the “QA intent”, which then helps with automation.

How does a golden set work with evals?

Put simply: the golden set is your “exam sheet” (questions and correct answers). Evals are the “grading key” (the rules you use to check the exam).

In modern QA we forget about simple text comparison. Instead, we put a process in place:

  1. You give the model a prompt from the golden set.
  2. The model generates an answer.
  3. The person or system that evaluates gets your “golden answer” as a reference.
  4. Whoever checks the result does not count commas. They check whether the intent and the facts match your reference.

That is why reference-based evaluations are so effective - they let you keep the flexibility of AI without losing control over quality.

How to build a golden set step by step?

Step 1: Collect real cases

Do not make things up - observe: user reports, chat logs, wrong model answers, edge cases. This is the most valuable source of knowledge.

Step 2: Rewrite them as “prompt -> answer”

Make sure the answer is high quality, complete, does not hallucinate and complies with the safety policies. Remember: the golden answer should be better than a typical model answer.

Step 3: Evaluate it by evals

Give it a score (for example Fidelity: 5, Relevance: 5, Safety: 5, Tone: 4) and save it in the golden set.

Step 4: Add an explanatory comment

For example: “The answer is correct because it contains X, Y and Z. Acceptable versions: shortened or extended, as long as the content stays correct”.

Step 5: Run the model tests on the golden set

This is now your pipeline:

  1. The model generates an answer.
  2. The evaluating element (you or an automated one) checks the answer by your evals.
  3. We compare the results with the goals defined in the golden set.
  4. We report the quality.

In the next parts of this series I will show you how to harness another model for this task (LLM-as-a-judge) to fully automate this process. But the foundation is always your Golden Set.

What does such a process look like in practice?

  • PROMPT -> MODEL -> ANSWER
  • EVALS (your evaluation criteria)
  • COMPARISON with the GOLDEN SET (reference + tolerance)
  • TEST RESULT

The end result? You do not get an “expected output mismatch” message, but a specific conclusion: “Model 1.4 dropped from Fidelity 4.8 to 3.1”. These are tests that make sense.

An example of a simple golden case

Prompt: “Give 3 advantages of automated tests.”

Golden answer (reference):

  1. Fast feedback in the CI/CD process (shorter regression).
  2. Higher repeatability and elimination of human errors in boring tasks.
  3. Lower cost of finding a bug thanks to moving tests “to the left” (Shift Left).

Evaluation criteria (Evals):

  • Fidelity: Are exactly 3 advantages given?
  • Relevance: Do the advantages really concern automated tests?
  • Tone: Is the answer professional and to the point?

QA comment (Expertise Capture): “We want to stress the business impact (Shift Left, regression). If the model gives ‘saves the tester’s time’, it is acceptable, but scored lower than ‘shorter time-to-market’. Forbidden: claims that automated tests replace exploratory testing or make the development process longer .”

Golden sets are not for the model to learn by heart

A common mistake is treating the golden set as a training dataset. A golden set is a QA tool, not an ML (Machine Learning) one.

It should be:

  • small (50-300 cases),
  • well described,
  • stable,
  • crafted by hand.

It is for testing, not for training.

When does a golden set fail?

  1. When it is too small - you test only the “happy path”.
  2. When it is artificial - you make up things that real users do not ask.
  3. When it has no evals - then it is only a collection of “nice answers” that you cannot measure.
  4. When you do not update it - the model evolves, and your references stay in the past.

A golden set is a living organism.

QA checklist for this post

  • Does your Golden Set detect content regression, not only formatting errors?
  • Do you give the judge a reference answer so it can do reference-based evaluation?
  • Did you write down the business intent in the QA comments, not only the “correct text”?
  • Does your set contain edge cases (short, wrong, malicious prompts)?
  • Is the Golden Set separate from the data used to fine-tune the model?

Summary

A golden set is QA’s way to bring order to a world where the answer is never identical and there are more risks than in classic APIs. Together with evals, it gives stable tests, repeatable evaluations and a real impact of QA on the quality of LLM-based systems.

It is the foundation of practical AI testing. Time to get to work and start building your own “golden library”.

Talk to you in the next episode of the series! 👋

Stay up to date with LLM and QA! 🚀

Practical notes on testing, QA processes and modern quality strategy. No fluff - for testers and leaders who want to get quality right. The newsletter is in Polish.

When you join, you agree to receive news from me. You can unsubscribe at any time.