EvaluationEvaluation Methodology
Error Analysis
Error analysis is the first step of the evaluation cycle. A person reads real traces, notes what went wrong, and groups the notes into failure modes. The failure modes are not chosen in advance: they come from the notes.
How to do it (general guidance)
- Read the traces.
- A human reads the traces: the input and the output of the component.
- A custom viewer helps. When labeling is easy, people actually do it instead of avoiding it.
- Open coding: write a note for every problem.
- The note is short, specific and describes what went wrong. It names the cause when the expert knows it.
- Notes also record surprises, not only errors.
- Axial coding: group the notes into failure modes.
- Notes that describe the same problem go into one group, and the group gets a name.
- An LLM can propose the groups, but a person checks them.
- Re-code the traces.
- Go back and tag every trace with its failure mode.
- With more traces, merge groups that turned out to be the same and split groups that mix different problems.
- Keep the expert's labels and notes as ground truth.
- They are the reference the system is measured against, and they are carried into the next iterations.
- In the next round the expert does not label the same examples again, only the new ones.
- Stop when nothing new appears.
- If about 20 traces in a row show no new failure mode, the recurring ones are probably all found. This is called saturation.
- The signal to stop is "nothing new", not a fixed count. About 100 traces is a sanity floor.
- If new modes keep appearing, the inputs may need more variety.
How ClayDiary did it
The viewer
- Each evaluation has a small annotation app built for the expert.
- For each trace the expert sets the label and writes a note. Everything saves automatically.
- For generation and structured questions, the expert marks pass or fail.
- For classification, the expert picks the correct answer instead. A trace counts as failed when the classifier disagrees.
- In classification, the app shows the classifier's answer as text but never preselects it, so it cannot influence the expert.
- A review queue shows only the traces that disagree or are not labeled yet. This makes later rounds quick. At milestones the expert still reads everything, because a correct-looking agreement can hide a wrong label.
Ground truth carried forward
- The expert's labels and notes are saved with the traces and kept in the repository, because a person's judgment cannot be regenerated.
- When a new prompt version is run, the earlier labels and notes of the same inputs are copied onto the new traces. The expert only labels what is new.
- In classification, a copied label is marked as inherited until the expert sets it again, so an old label is never taken as confirmed by accident.
- A label records what the system should do. If the expert changes that policy, the affected labels are re-annotated, so the system is never measured against a rule that no longer holds.
The notes
- Examples of the expert's notes:
- On a counting question: "Only counted among retrieved pieces." The note names the cause: the answer was computed from the few notes retrieved, not from all the pieces.
- On the vague follow-up "How do I prevent that next time?": "Based on the history of chat we should try to recommend something." The note says what the right behaviour is.
- On "Can you delete my last logged entry?": "In our app chat is used only to ask questions, not to enter pieces or log events." The note states a product decision.
The grouping
- The expert's labeled traces and notes were given to Claude Code, which grouped them into failure modes.
- The expert then decided what to do with each mode.
- Example, from the first classification round: two follow-ups were refused because the classifier did not see the conversation, so they became one failure mode. The delete request was accepted when it should have been refused, so it became another. The two modes go in opposite directions.
- Each mode is written down in a findings file for that evaluation, with its example cases, the versions where it appeared and its status.
The findings file
- Each evaluation keeps one findings file. It holds the failure modes, what each prompt version changed and which mode motivated it, the before and after results, and the open questions.
- Versions are compared case by case: for each version, which cases were fixed, which got worse and which are new. The link from a mode to its versions is written in the findings file, not counted automatically.
- For classification and retrieval, a Claude Code skill keeps the findings file
up to date:
- It recalculates the numbers from the saved results, so none is typed by hand.
- It reads the expert's notes and looks for a failure mode that is not in the file yet.
- It proposes small edits to the existing file, not a new file, and writes them only after the expert approves.
What each failure mode led to
- A prompt fix. The classifier refused vague follow-ups. A more generous prompt patched it, and giving the classifier the conversation fixed it at the root.
- A different design. Counting questions failed in the answer generation because retrieval returns only a few notes. No prompt can fix this, so counting questions now go to the database.
- A change of policy. Questions that read the user's own logged data were first refused. The expert decided they are in scope, and the affected labels were re-annotated to match.
- An exclusion. Some test cases need a situation that cannot happen in the real app, such as a conversation that starts off-topic. They are kept as documented probes and not counted as failures.
- A rejected idea. An "ambiguous" answer for the classifier was considered and not built. Only one case needed it, and the answer step is better placed to ask the user for details.
- Every new prompt version records which failure mode motivated it. A prompt does not change without a reason found in the traces.
When the policy changes
The policy starts vague
- When the expert starts labeling, the rules for the correct answer are rarely complete. Reading real traces sharpens them, so the criteria drift.
- This is normal. The labels are only as consistent as the rules behind them, so the rules have to be written down.
What to do when it changes (general guidance)
- Write the rules as a rubric and give each version of the rules a number.
- Each prompt version records which rubric its labels follow.
- Relabel the cases whose correct answer changed in the versions you want to compare. The old versions do not need to run again, because their answers did not change. Only new inputs need to run on them.
- Compare versions only when their labels follow the same rubric. Versions labeled under an older rubric stay as history.
How ClayDiary did it
- The gate's policy changed twice while the expert was labeling:
- Version 2 made the gate generous: a vague message such as "How hot should it get?" went from not pottery to pottery.
- Version 3 put reading the user's own data in scope: "What's my most-used glaze?" went from not pottery to pottery.
- One rubric file keeps the rules of each policy, numbered from 1 to 3, with the cases that flipped. Each version's note names its rubric, for example "Rubric 3".
- Each version is scored against its own labels, so numbers across a rubric change are not directly comparable. The comparison warns when the label of a case differs between versions.
Limits
- The datasets are small. The saturation rule is a general guide. With sets this size, the expert reads every trace anyway.
- One expert labels everything. This keeps the labels consistent, but they are only as good as that person's judgment.
- Each run is a single shot of a system that can answer differently on the same input, so one result is not a final verdict.