Gapless

Evaluation and Quality

Why AI systems need systematic evaluation, the layers of an evaluation program, and how offline tests, production signals, and human review fit together.

In normal software, a test passes or fails, and the same input gives the same output. AI systems are different: outputs vary between runs, "correct" is often a judgment call, and a change that fixes one case can quietly break twenty others. Without systematic evaluation, every prompt edit, model upgrade, or retrieval tweak is a guess.

Evaluation is how you replace "it looks better on the three examples I tried" with "it scores 4 points higher on 300 representative cases, with no regressions in the safety set".

The evaluation loop

The loop is what matters. Production reveals failures. Failures become test cases. Test cases block regressions. Changes go to production gradually, and production reveals the next failures.

Layers of evaluation

LayerWhat it checksWhenPage
Component evalsRetrieval recall, query rewrite quality, guardrail accuracy, tool selectionOn changes to that componentMetrics
End-to-end evalsFinal answer correctness, grounding, citations, formatOn every prompt, model, or retrieval changeMetrics
Safety evalsRefusals of harmful requests, resistance to injection, no data leaksOn every change, as a hard gateRed teaming
Online signalsFeedback, regenerations, escalations, A/B resultsContinuouslyOnline evaluation
Human reviewExpert grading of samplesWeekly or per releaseLLM-as-judge

Component evals are what make debugging possible. If an end-to-end score drops, the component scores tell you whether retrieval, the prompt, or the model is responsible.

What "good" means for this assistant

Write down quality criteria before building evals. For the reference assistant:

CriterionDefinition
CorrectThe answer's claims match the source documents
GroundedEvery company-specific claim is supported by a cited source
CompleteThe answer covers what the question asked, including important conditions and exceptions
Honest about gapsWhen sources lack the answer, it says so instead of guessing
Well citedCitations point to the passage that supports the sentence they follow
Concise and clearDirect answer first, no filler, appropriate formatting
SafeNo leaked data, no harmful content, no actions without confirmation
Permission-correctNever uses content the user cannot access

Each criterion maps to one or more metrics. Criteria that do not map to a metric are not being evaluated.

Who owns evaluation

Evaluation fails when it is everyone's job. Assign:

  • An owner for each dataset, who keeps it current and representative.
  • Domain experts (HR, legal, IT) who define correct answers in their area and review samples. Engineers cannot judge whether an answer about parental leave in Germany is right.
  • An AI engineer who maintains the eval harness, judges, and CI gates.

Pages in this section

PageCovers
DatasetsBuilding golden, regression, and safety datasets that represent real use
MetricsRetrieval, answer, citation, safety, and operational metrics, and how to compute them
LLM-as-judgeUsing models to grade answers, calibrating them against humans, and their limits
CI gatesRunning evals on every change and blocking regressions
Online evaluationFeedback, implicit signals, A/B tests, and canaries in production
Red teamingAttacking the system on purpose to find safety and security failures

On this page