QA Interview Hub · Knowledge base · Quizzes · Українська

QA Fundamentals › AI in testing

Quality criteria for an LLM answer

LLM answer quality is broken into independent criteria: factual correctness, relevance, completeness, format, safety, tone, latency and cost. Each is measured in the cheapest reliable way: format and length by code, meaning by a human or a judge model with a rubric of described levels. The judge is calibrated on human labels, and the golden set holds typical, edge, hard and adversarial queries and does not change with the prompt.

QA Fundamentals · AI in testing

Two people rated the same bot answer 2 and 5. What went wrong with the criteria?

The new prompt is "better", says a developer, and shows three good answers. QA asks: better by what measure? Without criteria, quality stays an impression, and impressions are especially deceptive in LLM features because answers are well phrased. This lesson is about breaking "quality" into checkable criteria, assembling a reference set and making a score that is reproducible.

How it works and why. The quality of an answer is not one number but several independent properties. An answer may be factually right and entirely off topic, or complete but in a broken format. So the criteria are separated, and each is measured in the cheapest reliable way: whatever can be counted by code (format, length, language) is checked by code; whatever needs understanding of meaning (correctness, relevance, tone) is scored by a person or a judge model with a rubric.

CriterionWhat it isHow to measure
Factual correctnesschecked against a source, a referencea person, a judge with a rubric
Relevance to the questionanswers exactly the requesta judge with a rubric
Completenessall required points are nameda point checklist, a judge
Format and instructionsJSON schema, length, languagecode, no model
Safetynothing harmful or privaterules, a classifier, a person
Tone and stylematches the branda judge, sampled human review
Latency and costresponse time, tokensmeasurement

A golden set is a set of requests with expected answers or criteria prepared and checked by people. It is run on every new prompt or model version and the metrics are compared with previous ones: it is the regression set for an LLM. The make-up of the set matters: typical requests, boundary ones, hard ones, off-topic ones and attempts to bypass the rules. A set of only "easy" questions gives nice numbers and shows nothing.

A rubric for a judge: vague and anchored

Vague

"rate quality from 1 to 5"

Every judge (a person or a model) puts in their own meaning, so scores diverge and cannot be reproduced.

Anchored

every level is described

Levels are tied to observable features and two judges more often give the same score.

Figure 1. The same scale, different reproducibility.

Example: from "rate quality" to a rubric. The instruction to a judge that people most often start with:

Rate the bot's answer from 1 to 5 for quality.

A model will give 4 to almost everything, because there is nothing to lean on, and a rerun easily gives 3. A rubric with anchors for one criterion:

Criterion: correctness against the provided context
  3: every claim is supported by the context
  2: one inaccurate claim that does not change the conclusion
  1: a claim that contradicts the context or is invented
  0: the answer is off topic
Output JSON: {"score": number, "evidence": a quote from the answer}

What changed. There is one named criterion. Each level describes an observable feature and not "better or worse". The judge must give a quote that can be checked. Next the judge is calibrated: take a sample of answers scored by people and see how often the judge agrees with them. If the disagreement is large, the rubric is rewritten instead of continuing to trust the numbers.

Limits and alternatives. Judge models have known biases: a tendency toward longer answers, toward answers in their own style, toward presentation order. They are reduced by a clear rubric, order shuffling and sampled human checks but not removed entirely. A comparison with a reference answer suits cases where there is one right answer; for open answers criteria are better. The number of criteria has a limit too: five meaningful ones beat twenty that nobody maintains. The weights depend on the product: for a medical bot safety outweighs tone, for a marketing one the other way round.

Common mistakes.

  • Measuring "quality" with one number: a bad result does not say what exactly broke.
  • A set of only easy requests: metrics rise while the risks stay outside the checked area.
  • A rubric without level descriptions: scores are not reproducible.
  • Not calibrating the judge: you can track for years a number that means nothing.
  • Changing the golden set together with the prompt: comparison with past versions loses its meaning.

Check yourself

A new prompt version raises the judge’s average score from 3.8 to 4.2, but two people who looked at 20 answers say it got worse. What do you check?

Answer

The judge’s calibration: does it agree with the human labels. It likely prefers longer answers or a different style. Also check whether the make-up of the set changed. Without calibration the number cannot be trusted.

Why is it better to check JSON format and answer length with code and not with a judge model?

Answer

Code gives an exact, cheap and reproducible result, while a judge model can err and costs money. Keep models for what code cannot count: correctness, relevance, tone.

In an interview. Junior: I break the quality of an LLM answer into criteria: correctness, relevance, completeness, format, safety, tone, plus time and cost. To compare versions I have a golden set of requests. Middle/Senior: I measure each criterion in the cheapest reliable way: format by code, meaning by a rubric with described levels. I calibrate the judge model on human labels and remember its biases. The set has typical, boundary, hard and hostile requests and does not change together with the prompt, otherwise there is nothing to compare with past versions.

More articles in this chapter