Artificial Intelligence • 3 min read

Evaluating Generative AI Systems

A language model can produce fluent text that sounds convincing even when its claims are unsupported. Judging it by whether the answer sounds good misses the main problem. Generative AI evaluation tests whether outputs fulfill a specific task under realistic conditions.

Begin with a task, not a leaderboard

A coding assistant, policy question-answering system, and creative-writing tool need different success criteria. Start by collecting representative inputs and defining acceptable behavior for each. An educational assistant might need accurate explanations, correct mathematics, useful examples, and appropriate uncertainty; a document assistant may need citation support as well.

Dimensions of quality

DimensionQuestion to ask
CorrectnessAre factual or computational claims true?
RelevanceDoes the output answer the request?
GroundednessAre claims supported by the supplied source material?
CompletenessDoes it address every necessary part?
Instruction followingDoes it respect format and task constraints?
Safety and privacyDoes it avoid harmful or unauthorized disclosures?
RobustnessDoes performance hold under paraphrases and difficult cases?
Latency and costIs this quality affordable and timely in production?

Not all dimensions can be reduced to a single number. A useful quality report describes trade-offs rather than hiding them behind one overall score.

Construct a representative evaluation set

Include ordinary requests, difficult edge cases, ambiguous wording, and requests outside the system’s authorized knowledge. Keep a holdout set separate from examples used to adjust prompts or model selection. Record the data source, version, consent, and any limitations in coverage.

For factual questions, store reference answers or verifiable source evidence. For open-ended tasks, use a written scoring rubric with anchored examples and multiple reviewers when practical.

Automatic and human evaluation

Exact-match metrics suit some constrained tasks, but can reject equivalent valid answers. String overlap metrics do not reliably measure whether an explanation is correct. Human review is often necessary for nuanced tasks.

An LLM-as-judge can score outputs against a rubric, but its judgments may reflect position bias, stylistic preferences, or shared model errors. Validate judges against human-reviewed examples, randomize order in pairwise comparisons, and inspect disagreement.

A simple rubric and score calculation

Suppose reviewers assign integer scores from 0 to 2 for each dimension: 0 = fails, 1 = partly succeeds, 2 = succeeds. This example only averages recorded scores; it does not claim those scores are objectively correct.

ratings = [
    {'correctness': 2, 'relevance': 2, 'groundedness': 1},
    {'correctness': 0, 'relevance': 2, 'groundedness': 0},
    {'correctness': 2, 'relevance': 1, 'groundedness': 2},
]
for dimension in ratings[0]:
    average = sum(r[dimension] for r in ratings) / len(ratings)
    print(dimension, round(average, 2))

Report each dimension separately. A system with excellent relevance but poor correctness remains unsafe for factual guidance.

Regression, adversarial tests, and production measurement

Re-run a fixed suite after changing a prompt, retrieval setup, model version, or tool integration. Add cases inspired by confirmed failures, without turning every production example into unrestricted training data. Include refusal, prompt-injection, missing-context, and malformed-output cases when relevant.

Online A/B tests can measure user outcomes, but clicks and satisfaction scores are imperfect proxies for truth. Use privacy-aware analytics and human review of serious incidents.

References

Related articles in

Image preview

Fit