How to Build a Golden Dataset for AI Evals (and Edit goldens.csv in the Free Lab)

Short answer: a golden dataset is a list of questions with the answer you expect, and it is the most important part of an eval. Start with 50 to 100 questions for one feature, include questions your documents cannot answer, and write short expected answers. In the free Evals Lab it is a plain file, `goldens.csv`, that you can edit in the Python IDE.

Open the Evals Lab

Why people struggle with this

On Reddit, the same questions keep coming up in r/Rag: [How do you build a solid gold dataset for evaluating a RAG system?](https://www.reddit.com/r/Rag/comments/1sfqscb/how_do_you_build_a_solid_gold_dataset_for/), [How do you create reliable evaluation datasets for LLM applications?](https://www.reddit.com/r/Rag/comments/1wdlgu1/how_do_you_create_reliable_evaluation_datasets/) and [A golden dataset is necessary for production RAG, correct?](https://www.reddit.com/r/Rag/comments/1vn4sp0/a_golden_dataset_is_necessary_for_production_rag/). The honest answer is that no research gives one magic number. Practitioner guides ([Barking Iguana](https://barkingiguana.com/writing/building-a-golden-dataset-for-llm-evaluation/), [QASkills](https://qaskills.sh/blog/golden-dataset-llm-evaluation-guide)) agree on one thing: coverage matters more than size.

How many questions

Start small. A common starting point is 50 to 100 well-chosen questions for one feature. These are practitioner heuristics, not a standard. Twenty questions are enough to learn the method in the lab; you will need more to see small differences between two versions of your app. Add a new question every time a real user finds a failure.

Which questions to include

| Type | Example | What it catches | |---|---|---| | Direct fact | "What is the refund window?" | Basic retrieval and answering | | Several facts | "When is support open, and how fast is a priority 1 reply?" | Answers that miss part of the question | | Spans two chunks | A question whose answer sits in two neighbouring paragraphs | Chunks that are too small | | **Not in the document** | "Does the company offer a free trial?" | Made-up answers (hallucination) | | Misleading wording | A question using different words than the document | Weak retrieval |

The question that is not in the document is the one people forget. If you leave it out, an app that invents an answer scores the same as an app that says "I do not know". The starter `goldens.csv` in the lab has one on purpose.

How to write the expected answer

  • Write the **facts**, not a perfect sentence: "30 days to request a full refund".
  • For an unanswerable question, write what the app **should do**: "The handbook does not say. The app should say it does not know."
  • Keep it short. A judge compares facts, and long expected answers make grading noisy.
  • Do not copy the app's own answer. Write it from the document, before you look at what the app says.

In the Evals Lab

1. Open the Python IDE and open `goldens.csv`. It has two columns: `input` (the question) and `expected_output` (the answer you expect).

2. Replace the sample rows with questions about your own document, or add rows below them.

3. Run `python run_eval.py`. Each row is graded by the judge, and the question appears in the Test cases and Results tabs.

4. To use test cases you wrote or generated in the Test cases tab instead, set `USE_LAB_CASES = True` in `run_eval.py`.

The lab can also draft one question per chunk with your model. Treat these as drafts: read each one, delete the weak ones and add a few of your own. A question written by a model from a chunk is easier than a real user question.

Keep the set honest

  • Never use the golden questions to tune the app's prompt and then report the score as if it were new. Keep a few questions aside that you never look at.
  • Have a second person check a sample of expected answers.
  • Refresh the set when the documents change. A stale expected answer makes a correct app fail.

Open the Evals Lab

Related tool pages

Also try

How to use the Evals Lab: step by step

  1. Open goldens.csv in the Python IDE
  2. Write 20 or more questions about your document
  3. Include one or two the document cannot answer
  4. Run python run_eval.py and read the reasons

When to use the Evals Lab

  • Starting an eval with the right questions
  • Checking that an app does not invent answers
  • Preparing a test set before comparing two versions
  • Teaching a team what a good eval question looks like

Example

Input: northwind_support_handbook.txt, chunked and stored in ChromaDB

Output: A score and a reason for every answer, and each run logged in MLflow

Frequently asked questions

What is a golden dataset?

A set of questions, each with the answer you expect. An eval asks your app every question and compares its answer with the expected one.

How many test cases do I need?

A common start is 50 to 100 for one feature, with some edge cases. There is no standard number. Coverage matters more than size, and you should add a case for every real failure.

Why include questions the document cannot answer?

Without them, an app that invents an answer scores the same as one that says it does not know. These questions catch hallucinations.

Where is the golden dataset in the Evals Lab?

In the Python IDE, as goldens.csv with the columns input and expected_output. You can also write test cases in the Test cases tab.

Tip: Add one question per real failure you see. A golden set that grows from real failures is worth more than a large one written in an afternoon.