My App
EvaluationEvaluation Methodology

Evaluation Methodology

Evals measure whether the specific AI product does what you want it to do. They turn the judgment about what a good product experience looks like into metrics you can track.

Generic evaluation metrics measure abstract qualities that may not matter for your use case. Good scores on them don’t mean your system works. That is why ClayDiary follows a systematic approach to evaluation.

The work happens in two environments. In development, a dataset and a loop improve the system. In production, monitors watch the live system for failures, and failures confirmed by a person are added to the dataset, so that development can start again with them.

The evaluation loop as two thick rings joined by two S-shaped curves. The development ring has three arrow pieces: analyze, measure and improve, repeated until the system is good enough. The production ring has three: monitor, flag and review. The Ship curve leaves the tip of Improve and arrives at Monitor. The Data curve leaves the tip of Review and arrives at Analyze, carrying confirmed failures into the dataset. The two curves cross once between the rings.

Starting point: data

  • The cycle needs inputs. They come from production, or from a synthetic dataset when there is no production data yet.
  • ClayDiary's evaluation inputs are synthetic. See Synthetic Dataset.

Development loop

The cycle: analyze, measure, improve

  1. Analyze: run the component and find where it fails.
  2. Measure: count how often each failure happens.
  3. Improve: fix the most important failure, then run the cycle again.

1. Analyze

  • Run the component over all the inputs. The saved results are the traces, and the rest of the cycle works on traces.
  • The domain expert:
    • Reads the traces and marks each result pass or fail. There is no score scale. A binary label forces a clear decision and keeps the labeling consistent.
    • For each result the expert writes a detailed critique: what went wrong and why. The critique makes the expert state what they know, can later serve as an example for an LLM judge, and is material for new synthetic inputs.
  • The expert's labels are the ground truth, and they are carried on through the loop. In the next iteration the expert does not label the examples that are already labeled, only the new ones.
  • The critiques are grouped into failure modes. The modes come from the critiques, not from a list chosen in advance. See Error Analysis.
    • Example: in the middle of a pottery conversation, the classifier refused a vague follow-up such as "How do I fix it?", because it judged the question without the conversation. Follow-ups like this are in scope, so "refuses a follow-up question" becomes one failure mode. Counting its cases gives its metric.

2. Measure

  • The metrics are:
    • the number of cases for each failure mode
    • the overall pass rate, which is the share of all inputs that passed. For example, 27 passes out of 30 inputs is a pass rate of 90%.
  • The metrics come from the failure modes, not from generic scores such as toxicity or hallucination.
  • A failure mode that keeps coming back gets an automatic evaluator, so it can be counted without a person. A code check is the first choice and an LLM judge the last. An evaluator is checked against the expert's labels before it is trusted. See Automatic Evaluators.
  • The most common or most important one is fixed first.

3. Improve

  • Fix one failure mode, for example with a better prompt.
  • Go back to error analysis:
    • analyze all examples in dataset and not only the failed ones, to see what the change did to the rest.
    • When the dataset has grown, run the earlier version on it too, or compare only on the inputs both runs share.
  • The change is an improvement only if the target failure went down, the overall score went up and no other failure got worse.
  • When the system is good enough on the dataset, the change moves to production.

Production monitoring

In production there are no expert labels, so the monitors estimate how often failures happen instead of giving exact pass rates. Production monitoring has three steps: monitor, flag and review.

Monitor

  • There are three ways to monitor:
    • reading traces by hand
    • automatic detectors
    • an LLM judge
  • The monitors come from development: the detectors are built from the failure modes found in error analysis, and the judge is checked against the expert's labels before it is switched on.

Flag

  • The monitors run periodically, according to their settings: for example daily, on all traces or on a sample.
  • They flag suspicious traces.
  • A flag is a suspicion, not a verdict.

Review

  • A person reviews the flagged traces periodically:
    • after a major change in the system, such as a new feature or a new prompt
    • every 2 to 4 weeks, if nothing has changed
  • Each review session aims to cover at least about 100 fresh traces.
  • The review confirms which flags are real failures.
  • The confirmed failures are added to the dataset, and development starts again with them: the next cycle analyzes the larger set.
  • See more in Production Monitoring.

In ClayDiary

On this page