Evaluate model performance
Unit 5 of 7 · Module 2: Select, deploy, and evaluate Microsoft Foundry models
Before you start
Short explainers for ideas this lesson builds on. Watch these first if they're new to you.
Go deeper
Unlocks when you've watched the lesson.
Read this lesson
Why evaluate
Once a model is deployed, you evaluate it: to make sure it meets your quality bar, gives accurate answers, and keeps improving over time. Foundry supports manual testing, automated metrics, and full evaluation runs. Why bother? Quality assurance: you find problems during evaluation, not in production, which protects your users and your reputation. User satisfaction: you learn how people experience your app, and where improvements matter most. Continuous improvement: evaluating regularly, as you update prompts, add features, or retrain, keeps quality up. And compliance and safety: you confirm the model follows your policies, avoids harmful content, and respects privacy and data protection.
People in the loop
Manual evaluation means people reviewing responses. It takes time, but it catches things metrics can't. In the playground, you test interactively: try varied prompts, and note wrong information, the wrong tone, or instructions not followed. You can also compare models side by side, with the same system instructions and prompts synced across both. For a structured review, you build test cases that represent your app's use cases, and reviewers rate each response for relevance, informativeness, engagement, accuracy, and safety, usually on a one-to-five scale. Averaged across many cases, those ratings give you a quantitative measure of quality. And user studies collect feedback from real or representative users, surfacing things like confusing phrasing, missing context, or unmet expectations. Manual review captures what metrics can't: satisfaction, contextual fit, and brand alignment.
Automated quality metrics
Automated evaluation scores outputs with standard metrics. It scales, and it's consistent and objective. Generation quality metrics look at the response itself. Groundedness checks whether a response is based on the context it was given, rather than speculation. Groundedness Pro gives a simple yes or no: grounded, or not grounded, which is useful when factual accuracy is a must. Relevance checks that the response actually addresses the question. Coherence checks that it flows logically and stays consistent. And fluency checks language quality: is it correct and natural? With AI-assisted evaluation, you choose a GPT model to act as the evaluator. It reads your deployed model's responses, and scores them against the criteria you picked.
Risk and safety metrics
Risk and safety metrics look for harmful content. They cover self-harm content, hateful and unfair content, violent content, sexual content, protected material, like copyrighted text, and indirect attacks, where jailbreak instructions hide inside a document or email the model reads, to test whether it can be hijacked. For the content harm metrics, results roll up into a defect rate: the percentage of responses above a severity threshold, typically medium. For protected material and indirect attacks, the defect rate is the share of responses where the evaluator found the problem, as a percentage of all responses.
Measuring against the answer key
Natural language processing metrics are mathematical, and don't need an evaluator model, but they usually need ground truth: the expected, correct answers. F1 score measures the shared words between the generated answer and the ground truth, balancing precision, avoiding wrong words, with recall, including the important ones. It suits classification and information retrieval. BLEU compares sequences of words, or n-grams, with reference text, and is common for machine translation. METEOR extends BLEU to allow for synonyms, word stems, and paraphrasing. ROUGE emphasizes recall, so it suits summarization, where covering the key points matters most. And GLEU is a BLEU variant built for single sentences. These metrics work well when there's a definite correct answer, and less well for open-ended generation, where many answers are valid.
Running an evaluation
The Evaluation feature runs systematic evaluations, with a test dataset and several metrics at once. You can evaluate a model, generating outputs from prompts you specify; an agent, with user-defined prompts; or a dataset of outputs that were already generated. For a model or an agent, you need input data. Upload a new CSV or JSONL file, reuse a dataset already in your project, or generate a synthetic one: pick the resource that generates it, the number of rows, and a prompt describing the data, and optionally upload files to make it more relevant. Then choose your metrics, map the fields in your data, set the system prompt, and start the job. It runs asynchronously, scoring every row, and the results show aggregate scores plus the detail for each prompt. The evaluator library, on the Evaluation page, lists Microsoft's curated evaluators for quality, safety, and performance. You can see each one's parameters and files, read the annotation prompts behind the quality metrics, check the definitions and severity levels for safety, and manage your own custom evaluators, with versions you can compare, restore, and share.
Improve, then measure again
Then you act on the results. If quality scores are too low, try prompt engineering, to refine instructions and system messages. Try a different model, one suited to your use case. Add RAG, to ground responses in your own data. Or fine-tune, training on your domain, where the model supports it. Each step can add complexity, and cost, so plan for that. If safety metrics raise concerns, add content filters with Azure AI Content Safety, harden your prompts with safety instructions, and validate outputs before users see them. Set evaluation benchmarks early, then re-run your evaluations after every change, to measure the impact and catch regressions. Manual testing, automated metrics, and evaluation runs together give you confidence that your model performs well, serves users safely, and meets your quality bar.
Facts from Microsoft's documentation: Run evaluations from the Microsoft Foundry portal; General purpose evaluators for generative AI; Observability in generative AI (CC BY 4.0), rewritten in Loop's own words and examples. Narration, animation, and quiz by Loop. Microsoft, Azure, and Microsoft Foundry are trademarks of Microsoft. Loop is independent and not affiliated with or endorsed by Microsoft.