Understanding Generative AI Evaluation
This lesson explains why generative AI needs evaluators, which kinds of evaluators exist, where evaluations run, and where evaluation fits in the life cycle.
Learning outcomes
After completing this lesson, you will be able to:
- Explain why accuracy alone cannot evaluate generative output.
- Distinguish AI-assisted, NLP and safety evaluators.
- Compare local and cloud evaluation.
- Identify the life cycle stages that need evaluation.
Why generative AI needs evaluation
A predictive model has one correct label per input, so accuracy against a test set measures it. A generative application produces free text, and many different answers can be correct, partly correct, unsupported or harmful. Its quality depends on the model, the prompt, the retrieved data and the tools, any of which can change. Without systematic evaluation, teams fall back on reading a few outputs, which misses most failures.
Evaluation answers concrete questions: are answers supported by the sources, do they address the question, are they well written, do they avoid harmful content, does the agent choose the right tools, and did the last change improve or degrade any of these. It is used before release, in every change through CI, and continuously in production.
Kinds of evaluators
Foundry and the Azure AI Evaluation SDK provide built-in evaluators in several groups, plus support for custom ones. The groups differ in how they compute a score and what they need.
| Group | Examples | How it scores |
|---|---|---|
| General purpose | Coherence, fluency | A judge model rates the response |
| RAG | Groundedness, groundedness pro (preview), relevance, retrieval, document retrieval, response completeness (preview) | Mostly a judge model; document retrieval uses labelled relevance |
| Textual similarity | Similarity, F1 score, BLEU, GLEU, ROUGE, METEOR | Similarity uses a judge; the others are mathematical overlap with ground truth |
| Risk and safety | Hate and unfairness, sexual, violence, self-harm, protected material, indirect attack, code vulnerability, ungrounded attributes | The Foundry evaluation service |
| Agent | Intent resolution, task adherence, tool call accuracy, task completion | A judge model over the conversation and tool calls |
| Custom | Code-based and prompt-based evaluators | Your function or your judge prompt |
AI-assisted evaluators, also called LLM-as-a-judge, need a judge model deployment that you provide, such as a GPT deployment in the project. NLP evaluators are deterministic and need only ground truth. Risk and safety evaluators run in the Foundry service and need a project, not a judge deployment.
Where evaluations run
Evaluations can run locally or in the cloud, and both record results that can be compared over time.
The Foundry portal can also run evaluations from the agent playground and compare runs side by side, which helps when exploring, while code-based evaluation is what automation uses.
Evaluation in the life cycle
Evaluation appears at every stage of the GenAIOps life cycle, with different datasets and goals.
-
Model selection
Compare candidate models on the same dataset and prompts.
-
Development
Evaluate prompt variants and retrieval settings while building.
-
Pull requests
Run a regression dataset on every change to prompts, code or configuration and block regressions.
-
Pre-release
Run the full quality and safety suite, including red teaming, before production.
-
Production
Continuous evaluation samples live responses; scheduled evaluations rerun fixed datasets.
Choosing evaluator types
A team needs three checks for a RAG assistant: whether answers are supported by the retrieved passages, how closely answers to 200 reference questions match the approved wording, and whether the assistant can be tricked by instructions hidden in documents. The CI budget for judge model calls is small.
Use groundedness, an AI-assisted evaluator with the context, for support by the passages. Use an NLP evaluator such as F1 score or ROUGE for closeness to approved wording, which needs only ground truth and no judge calls. Use the indirect attack risk and safety evaluator, which runs in the Foundry service, for hidden instructions.
Similarity would also compare with references but spends judge calls. Relevance measures whether an answer addresses the question, not whether it is supported. Content filters protect production but do not measure susceptibility to injected instructions.
What does an AI-assisted quality evaluator such as relevance need that an NLP evaluator such as F1 score does not?
Show answer
A judge model deployment, passed as model_config. NLP evaluators compute scores directly from the response and the ground truth.
Exam Tips
Remember for the exam
- Generative output has many acceptable answers, so it needs evaluators rather than accuracy alone.
- AI-assisted evaluators need a judge deployment; NLP evaluators need ground truth; safety evaluators use the Foundry service.
- Run locally with the SDK for fast loops; in the cloud for large, scheduled and continuous evaluation.
- Evaluate at model selection, development, pull requests, pre-release and in production.