AWSAWS Certified Generative AI Developer - Professional2026-103.4 Implement responsible AI principles
Measure uncertainty through calibrated evidence signals
Completed by the knowledge check
Learning objective
Track uncertainty and confidence metrics in CloudWatch; distinguish grounded evidence from uncalibrated model self-confidence.
Core idea
A number becomes useful confidence evidence only when you know what it measures and how it relates to observed outcomes. A model saying “confidence: 0.95” is generated text. Without calibration against reviewed cases, it is not a measured 95 percent probability that the answer is correct.
For an architect, uncertainty telemetry must support a decision: release the answer, request useful missing information, abstain, or escalate. Keep source-support signals, model self-reports, application decisions, and reviewer labels separate. Publish them with enough version context to detect regressions rather than compressing everything into one confidence average.
CloudWatch stores the metrics you publish. It does not turn an arbitrary score into calibrated evidence or determine whether an answer is fair, authorized, or true.
How it works
Identify each signal’s meaning
Bedrock Guardrails contextual grounding checks evaluate a response against a grounding source and query. Grounding asks whether the response is supported by the source; relevance asks whether it answers the query. A response can be grounded but irrelevant, or relevant but unsupported. Lesson 3.1.6 covers the underlying evidence comparison.
AWS documents this feature for summarization, paraphrasing, and question answering, and excludes conversational question-answering/chatbot use cases. Respect that scope when selecting telemetry. Do not present its grounding score as a universal uncertainty measure for arbitrary agent conversations, tool execution, or all model tasks.
For ApplyGuardrail, identify the source and query through text-block qualifiers such as grounding_source and query, and provide the response to evaluate. The operation does not invoke a model. Its returned assessments[].contextualGroundingPolicy.filters[] include type, score, threshold, detected, and action. Record those fields as detector evidence rather than as model self-confidence.
AWS lets you configure grounding and relevance thresholds from 0 to 0.99; 1 is invalid. A score below its threshold triggers the configured check’s detection behavior. Do not teach a chosen threshold such as 0.7 as universally correct. The reference source can itself be stale or wrong, so source support is still narrower than truth.
Publish built-in and custom metrics
Guardrails already publishes counts in the CloudWatch namespace AWS/Bedrock/Guardrails. Use InvocationsIntervened with GuardrailPolicyType = ContextualGroundingPolicy for contextual-grounding interventions. Invocations, InvocationClientErrors, InvocationServerErrors, and InvocationThrottles support dimensions including Operation = ApplyGuardrail, GuardrailArn, and GuardrailVersion. These counts expose service-level assessment traffic and failures; per-request grounding and relevance scores still require custom publication.
Use CloudWatch PutMetricData with Namespace and MetricData to publish application signals. Each datum can identify a MetricName, dimensions, and a numeric value. Give application-defined metrics names that reveal the meaning, such as GroundingScore, RelevanceScore, AbstainedRequests, EvaluatedRequests, and UnsupportedReleasedAnswers. These are proposed custom names, not built-in Bedrock metrics.
Choose bounded dimensions such as approved release, task family, and policy version. Keep request identifiers and raw prompts in an appropriately protected per-request record instead of creating a unique metric series for every request. CloudWatch supports up to 30 dimensions per metric, but that limit is not a reason to encode everything as a dimension.
Use counts and denominators together. An abstention count rising from ten to twenty might reflect twice the traffic rather than worsening answerability. Compute the rate from AbstainedRequests and the corresponding eligible request count. For grounding scores, keep distributions or score-band counts rather than relying exclusively on an average that hides low-support cases.
PutMetricData rejects NaN and infinity. A missing or failed assessment is not a zero score: emit a separate application-defined assessment-failure count and leave the score absent. Otherwise, a detector outage looks like a sudden quality collapse, or an omitted failure looks like normal operation.
Calibrate on reviewed outcomes
Use a labeled set of answerable, unanswerable, ambiguous, and adversarial cases. Save the score, support judgment, released outcome, and model/prompt/policy versions for each case. Within score bands, compare the fraction of reviewed supported answers with the implied interpretation of the score.
For model self-reports, run the same comparison separately. A self-report that stays high on demonstrably unsupported answers should not govern release. Keep it as an experimental signal if it has diagnostic value, label it explicitly, and do not mix it with grounding assessments in the dashboard.
Evaluate the whole decision policy. Measure unsupported released answers alongside unnecessary abstention on answerable requests. Raising a threshold can reduce one error while increasing the other. Select the boundary from the consequences of those errors, then rerun the calibration after changes to prompts, models, evidence, or task population.
Interpret monitoring with its denominator
Production review usually covers a sample, not every request. Publish reviewed sample counts alongside quality outcomes and state how the sample was selected. A sample dominated by easy requests can hide failures among complex or high-consequence cases.
Monitor separately by task and approved population slice when privacy and sample size permit. A stable overall grounding average can conceal a deteriorating slice or an increase in assessment failures. Use PutMetricAlarm.Metrics to alarm on a metric-math expression, such as an abstention rate derived from two counts. Set TreatMissingData deliberately: breaching, notBreaching, ignore, or missing (the default). Missing score data must not silently become evidence of acceptable quality; distinguish a measured quality breach from insufficient evidence to estimate quality.
Key distinctions and trade-offs
Grounding versus self-confidence: Grounding compares output with supplied evidence. Self-confidence is the model’s generated statement about itself. Neither becomes a universal correctness guarantee.
Score versus decision: A detector score is an input. The application chooses release, clarification, abstention, or escalation under an approved policy.
Uncertainty versus assessment failure: Weak evidence is a quality condition. A failed assessment is an operational condition. Separate counters keep recovery decisions meaningful.
Fine-grained slicing helps expose failures but increases data requirements and privacy concerns. Start from slices that can change a release decision, require sufficient reviewed examples, and keep sensitive raw details outside metric dimensions.
Architecture / decision scenario
A policy summarizer reports model self-confidence above 0.9 for nearly every output. Human reviewers find unsupported exceptions, particularly when source documents conflict.
The team uses supported contextual grounding checks on the summarization path and publishes custom grounding, relevance, abstention, assessment-failure, and reviewed-error metrics through PutMetricData. It records policy and prompt releases as dimensions and retains protected request-level labels for calibration.
It rejects the self-report as a release gate because high values do not distinguish correct from unsupported summaries. It calibrates grounding thresholds against reviewed cases and routes conflicting evidence to review. A separate conversational assistant does not inherit the summarizer’s detector guarantee; it requires an evaluation approach suitable for that task.
Common exam traps
- Reading generated self-confidence as a calibrated probability.
- Treating grounding and relevance as interchangeable.
- Assuming CloudWatch creates semantic confidence measurements automatically.
- Recording failed assessments as zero-valued grounding scores.
- Reporting a rate without its eligible or reviewed denominator.
- Applying contextual grounding checks beyond their documented use-case scope.
What to remember
- Define each signal before publishing it.
- Keep detector scores, self-reports, outcomes, and human labels separate.
- Use
PutMetricDatafor explicitly named custom metrics. - Calibrate thresholds against reviewed outcomes and error consequences.
- Monitor assessment coverage and failures alongside quality.
Knowledge check
A policy summarizer asks the model to append confidence: 0-1 to each output. Values above 0.9 appear on nearly every summary, including ones reviewers marked unsupported. How should the team use this value?
PutMetricDataA contextual grounding check scores a question-answering response high for grounding and low for relevance. What does that indicate?
A team wants the contextual grounding score as the main uncertainty metric for its multi-turn customer chatbot. What should the architect decide?
query qualifierThe ApplyGuardrail call that scores grounding times out for some requests. How should the application publish telemetry for those requests?
GroundingScore of 0, since no support was establishedGroundingScore of 1, since no unsupported claim was detectedGroundingScore for those requestsWeekly AbstainedRequests doubles after a launch that also doubles traffic. The team wants an alarm that fires only when answerability actually worsens. What should the alarm evaluate?
AbstainedRequests against a fixed count thresholdAbstainedRequests over EvaluatedRequestsGroundingScore across all released answersInvocationsIntervened count for the grounding policyPutMetricAlarm can alarm on a metric-math expression built from two counts. A grounding average and an intervention count measure other things and can hide the change.