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
| Dimension | Question to ask |
|---|---|
| Correctness | Are factual or computational claims true? |
| Relevance | Does the output answer the request? |
| Groundedness | Are claims supported by the supplied source material? |
| Completeness | Does it address every necessary part? |
| Instruction following | Does it respect format and task constraints? |
| Safety and privacy | Does it avoid harmful or unauthorized disclosures? |
| Robustness | Does performance hold under paraphrases and difficult cases? |
| Latency and cost | Is 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.
Related concepts
- Large Language Models: Foundations and Capabilities
- Evaluating RAG and AI Agents
- AI Limitations, Robustness, and Trustworthiness
References
Related articles in
- AI Agents and Tool-Using Workflows — Learn agent goals, tool invocation, planning, state, permissions, and how to evaluate multi-step AI workflows.
- AI Development Tools: Git, Jupyter, and APIs — Learn how Git, Jupyter notebooks, Python environments, and APIs fit together in reproducible, secure artificial intelligence workflows.
- How AI Is Changing Theoretical Computer Science — AI is beginning to help researchers explore algorithms, mathematical structures, and formal proofs. Here is what it can do, what still needs human judgment, and why verification matters.