FDE Times dataFDE jobs open 913▼15 Change in open roles over 7 days, like-for-like: roles from companies we started tracking this week are left outNew in 7 days 63Companies hiring 200Remote-friendly 24%Median US pay $200kTop hirer Databricks 106
中文VI

The newspaper of the Forward Deployed Engineer

Guides

Your first eval suite needs 50 questions and one afternoon

A step-by-step Python guide: samples drawn from real failures, pass/fail grading in pytest, and an LLM judge checked against hand-graded labels.

ShareLinkedInFacebookX

In brief

  • Anthropic Engineering says 20-50 simple tasks drawn from real failures are a good starting point, so 50 samples is a sensible size for a first eval suite.
  • Prefer automated grading and binary pass/fail verdicts; use a different model from the one that generates the answers as the judge.
  • Before trusting an LLM judge, treat hand-graded labels as ground truth and compare the judge's scores against them.
Horizontal bar chart with three bars on a 0–50 scale, for a hypothetical run. The original prompt scores 31/50. After the prompt is fixed, the judge scores it 38/50. After manual re-marking, the result is 37/50 (red bar), and a dashed box shows the point lost because the judge let one wrong answer through.
Manually re-marking 10 of the judge's verdicts uncovered one false_pass, so the honest score is 37/50, not 38/50. Source: hypothetical run in the article; figures are illustrative only.

According to Anthropic Engineering, 20-50 simple tasks drawn from real failures are already a very good start for an eval suite. No thousands of samples, no expensive eval platform. The number shows that the barrier to a first eval suite is far lower than many assume: the main cost is an afternoon of writing.

For an FDE, that afternoon is worth more than any demo. When a client asks “is the new prompt better?”, the answer “it seems better” convinces nobody. A table of 50 questions with pass rates before and after does.

This guide walks step by step through building a 50-sample eval suite in Python for an assistant that answers questions over internal documents. You need Python 3, pytest, and an answer(question) function that calls your assistant. The code below is a stripped-down version for teaching, not a complete framework.

Step 1: What does “a good answer” mean?

Anthropic’s documentation advises making success criteria specific. Its example is replacing “good performance” with “accurate sentiment classification”. Criteria must also be measurable, through quantitative metrics or a clearly defined qualitative scale.

For a Q&A assistant, don’t write “answers well”. Write down three criteria, for instance: the answer contains the correct facts from the documents, it does not make things up when the documents lack the information, and it does not answer outside its scope. Each criterion must be answerable with yes or no.

Check after this step: give the three criteria to a colleague. If they ask “what counts as correct?”, your criteria are still vague.

Step 2: Where do the 50 samples come from?

The best source is real failures: logs, support tickets, users’ complaint messages. Anthropic stresses that an eval suite should reflect the real distribution of tasks without forgetting edge cases. If 70% of real questions concern leave policy, a suite made entirely of salary questions will not measure what users actually need.

Balance matters too. Anthropic Engineering warns that one-sided evals lead to one-sided optimization. If all 50 questions have answers, you will inadvertently reward an assistant that always answers, whether it knows or not.

One suggested split, to adjust against your own real data: about 30 questions with a clear answer in the documents, 10 edge cases such as ambiguous questions, typos or questions that switch languages mid-sentence, and 10 questions where the assistant must say it has no information.

Every sample must pass Anthropic Engineering’s test: two domain experts, grading independently, must reach the same pass or fail verdict. Any question the two still argue over should be rewritten or dropped.

Step 3: Write the samples to a JSONL file

Each line is one sample. The grader field says whether that sample is graded by code or by a model.

{"id": "q01", "question": "How many days of annual leave do permanent employees get?", "must_contain": ["12 days"], "grader": "code"}
{"id": "q41", "question": "Does the company support MBA tuition?", "expect_refusal": true, "grader": "code"}
{"id": "q47", "question": "Summarize the process for requesting unpaid leave", "reference": "Submit a request to your direct manager...", "grader": "model"}

The questions above are invented examples. Check after this step: the line count is exactly 50, and no id is repeated.

Step 4: Use pytest for whatever code can grade

Anthropic favors questions that can be graded automatically, through string matching or code. Its reasoning: better to have many automatically graded questions, even if each is slightly less precise, than a few carefully graded by hand.

Hamel Husain likewise describes the first layer of LLM evals as simple assertions, much like writing pytest.

# test_eval.py — stripped-down version
import json
import pytest
from assistant import answer  # the function that calls your assistant

with open("eval_50.jsonl", encoding="utf-8") as f:
    CASES = [json.loads(line) for line in f if line.strip()]

CODE_CASES = [c for c in CASES if c["grader"] == "code"]
REFUSAL_MARKERS = ["no information", "not found"]

@pytest.mark.parametrize("case", CODE_CASES, ids=lambda c: c["id"])
def test_code_graded(case):
    out = answer(case["question"]).lower()
    if case.get("expect_refusal"):
        assert any(m in out for m in REFUSAL_MARKERS)
    else:
        for s in case["must_contain"]:
            assert s.lower() in out

Run pytest test_eval.py -q. Each sample shows up as its own test by id, so when one fails you know immediately which. Every result is simply pass or fail. Husain has found that scoring on a detailed scale is much harder to manage than binary grading.

Step 5: Free-form answers need a judge

A question like “summarize the process” cannot be string-matched. Evidently AI’s LLM-as-a-judge guide uses a binary judge, grading each answer as right or wrong, and asks the judge to include an explanation. Anthropic’s documentation also recommends grading with a different model from the one that produced the answer.

JUDGE_PROMPT = """Question: {q}
Reference answer: {ref}
Answer to grade: {out}
Does the answer match the reference answer in substance?
Return JSON: {{"verdict": "PASS" or "FAIL", "reason": "one sentence"}}"""

def judge(case, out):
    prompt = JUDGE_PROMPT.format(q=case["question"], ref=case["reference"], out=out)
    raw = call_judge_model(prompt)  # placeholder: call a DIFFERENT model from the assistant's
    return json.loads(raw)

call_judge_model is a function you write yourself with your provider’s SDK. Check after this step: read the reason field for any five questions. Nonsensical explanations usually signal that the judge prompt is not right yet.

Step 6: The judge needs grading too

This is the step most often skipped. Evidently AI’s method is clear: treat your hand-graded labels as ground truth, treat the LLM’s labels as predictions, then compare the two as you would when evaluating a classifier.

human = ["PASS", "FAIL", "PASS", ...]   # graded by you
judged = ["PASS", "PASS", "PASS", ...]  # graded by the judge on the same questions
agree = sum(h == j for h, j in zip(human, judged)) / len(human)
false_pass = sum(h == "FAIL" and j == "PASS" for h, j in zip(human, judged))
print(agree, false_pass)

Watch false_pass: wrong answers the judge lets through are the most dangerous kind of error. To grade by hand quickly, Husain stresses removing all friction from looking at the data. Exporting the question, answer, verdict and reason to a CSV file and opening it in a spreadsheet is enough to start.

What does a prompt fix look like on the scoreboard?

Take a hypothetical run. The original prompt scores 31/50. You add one instruction: if the documents lack the information, say so plainly instead of inferring an answer. Rerun both parts, and the scoreboard looks like this:

# Hypothetical figures, for illustration only
                   before   after
code  (40 qs)      26/40    31/40
model (10 qs)       5/10     7/10
total              31/50    38/50

Don’t rush to put 38/50 in the report. You re-grade by hand the 10 questions the judge scored and find one false_pass:

q47  judge: PASS   you: FAIL
judge's reason: "Correctly states the step of submitting a request to the direct manager."
actual error: the answer invented an extra approval step not in the documents

The model-graded group is therefore really 6/10, and the honest figure is 37/50. The prompt fix is still clear progress, but now you know something more: the judge prompt needs telling to check for extra details, not only missing ones.

Three mistakes that make an eval suite useless

The first is inventing questions instead of taking them from logs. Questions written by engineers tend to be cleaner and easier than what real users type, so the pass rate looks good and says nothing.

The second is leaving out questions the assistant should decline to answer. Without that group, every prompt change that makes the assistant “bolder” looks like progress. The third is using the assistant’s own model as the judge, then never comparing the judge with hand labels.

At the client site, the eval suite is the contract

In a real deployment, these 50 questions should be written with the client’s people, because they are the “domain experts” qualified to decide which answers pass. Once both sides have agreed on the question set, every “the bot has got worse lately” argument turns into looking together at which question just went from pass to fail.

The three components in this guide are also the three types of grader that Anthropic Engineering says are commonly combined: code, model and human. If you are aiming for an FDE role, put a small repo like this on GitHub, with a README showing the scoreboard before and after a prompt fix, and the false_pass case you caught.

When reading job descriptions, search for phrases such as “evaluation” or “LLM-as-a-judge” to see whether the role needs this skill, then put the repo at the top of the projects section of your CV.

The next time someone asks whether the new version is better, you won’t have to guess. Run the eval suite and you have the answer.

Was this article useful?

Use with your AI assistantAsk Claude ↗Ask ChatGPT ↗
4 sources
Read next on the roadmap · Stage 6: MeasurementWhy did the LLM bill jump? Only traces can tell the customerWhen spans record tokens, feature and customer, a day of guessing becomes a single query, and costs logged in two places can be reconciled.