AI-300 · LESSON 4
Implement generative AI quality assurance and observability10–15% · 2 topics
Learn evaluation (quality and safety) of generative AI apps and agents, and observability through tracing.
4.1Configure evaluation and validation for generative AI applications and agents
Concept
Evaluation measures output quality and safety with metrics. Foundry has built-in evaluators: AI-assisted quality metrics (groundedness, relevance, coherence, fluency), metrics compared with ground truth (F1, BLEU, ROUGE, similarity), safety metrics (violence, self-harm, hate, sexual, protected material, indirect attacks) and agent metrics (intent resolution, tool call accuracy, task adherence).
How it works / steps
- Build an evaluation dataset with representative questions and expected answers
- Choose evaluators suited to the use (groundedness and relevance for RAG, tool call accuracy for agents and so on)
- Run evaluation in the cloud or with the SDK and compare results with the previous version
- Run adversarial tests with tools such as the AI Red Teaming Agent to confirm safety
- Build evaluation into CI/CD as a pre-release gate
Workplace example
For an internal policy Q&A bot, answers with groundedness below 4.0 are identified, the retrieval settings and system message are fixed, and the bot is re-evaluated.
Common confusions and exam tips
- Groundedness is “whether it is based on the grounding (context)”; relevance is “whether it answers the question”
- Metrics compared with ground truth (such as F1) require ground truth
- Combine human evaluation too to confirm the validity of AI-assisted evaluation
Mini quiz
Q1. What should you prepare first when starting to evaluate a generative AI app?
- A GPU compute cluster for evaluation and a request for its quota
- A screen design and color scheme for a dashboard showing evaluation results
- A JSONL dataset of all exported production conversation logs, personal information included
- A test dataset including questions, context and expected answers, and column mapping to evaluators
Show answer and explanation
Answer: D A test dataset including questions, context and expected answers, and column mapping to evaluators
Evaluation starts with test data and a mapping of each column to evaluator inputs. [Other options] Production logs with personal information left in are inappropriate. Evaluators run without a cluster. Screen design is not a prerequisite for evaluation.
Q2. Which metric measures whether an answer is “supported by the provided context”?
- A similarity metric
- Relevance
- Groundedness
- Fluency
Show answer and explanation
Answer: C Groundedness
Groundedness measures whether the answer is based on the given context. [Other options] Relevance is fit to the question, fluency is naturalness of text and similarity is closeness to the expected answer; none measures support by context.
Reference links
4.2Implement observability for generative AI applications and agents
Concept
Observability makes it possible to trace what happened inside apps and agents in production. Traces based on OpenTelemetry record prompts, responses, tool calls, token counts and latency and send them to Application Insights. Continuous evaluation periodically evaluates samples of production traffic.
How it works / steps
- Connect Application Insights to the project
- Enable tracing in the SDK and record each span (model calls, retrieval, tools)
- Monitor token usage, latency and error rate in dashboards
- Set up continuous evaluation and alerts to detect quality drops
- Adjust what is recorded so logs do not retain too much personal information
Workplace example
In response to complaints that an agent is slow, traces reveal one tool call taking 8 seconds, and a cache is added for that API.
Common confusions and exam tips
- Traces are per-request detail; metrics are aggregates. Their purposes differ
- Control recording of prompt and response content according to privacy policy
- Both evaluation (before release) and monitoring (after release) are needed
Mini quiz
Q1. In a production generative AI app, you want to identify why responses are slow. What is most useful?
- The endpoint’s average response time metric and an alert every 5 minutes
- Daily token consumption and deployment quota utilization
- App error logs and the number of user inquiries
- Per-step traces (time breakdown for search, model calls, tool execution and so on)
Show answer and explanation
Answer: D Per-step traces (time breakdown for search, model calls, tool execution and so on)
Breaking down latency per step with traces identifies the bottleneck. [Other options] Average response time does not tell which step is slow. Token volume or quota are possible causes but give no breakdown. Error logs are not a latency breakdown.
Q2. You want to manage generative AI usage costs per department. Which metrics should you monitor?
- Evaluation scores and number of safety detections
- Request count and average response time
- Token consumption and resource usage
- Number of deployments and types of models used
Show answer and explanation
Answer: C Token consumption and resource usage
Cost is closely tied to token consumption and resource usage. [Other options] Request counts and response times are not proportional to cost. Evaluation scores measure quality. The number of deployments does not show the cost breakdown.
Reference links
Lessons are written by this site based on public information and do not guarantee exam content. Product specifications change, so check the latest information at the reference links.
Notes (unofficial, original questions, no pass guarantee)
- The questions on this site are original practice questions written by this site based on publicly available skills outlines and exam guides. They are not actual exam questions.
- Microsoft, Azure, Copilot, Microsoft 365, Dynamics 365 and Power Platform are trademarks of the Microsoft group of companies. This site is not affiliated with or endorsed by Microsoft.
- This content is a study aid and does not guarantee a pass. Exam content, format and prerequisites may change without notice; always check the latest information on the official page before taking the exam.
- Your accuracy on the mock exam cannot be converted to the official (scaled) score and does not predict a pass or fail.
- Progress is saved only in this browser (localStorage) unless you sign in with Google to sync it. You can delete it from the Cookie & storage settings page (Japanese).