Lesson 3 of 4 Amazon SageMaker AI

Detecting Bias, Monitoring Models and Documenting Them

This lesson explains the SageMaker AI tools for responsible, transparent and well-governed machine learning: detecting bias, explaining predictions, monitoring models in production and documenting them.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe how SageMaker Clarify detects bias and explains predictions.
  • Describe how Model Monitor detects drift and how Model Cards document models.
  • Explain when a human review step is used.

SageMaker Clarify

SageMaker Clarify helps make models fair and understandable. Before training, it looks for bias in the training data, such as a group that is under-represented or has far fewer positive labels. After training, it looks for bias in predictions, such as different loan approval rates for different groups.

For explainability, Clarify uses a method called SHAP to show which features drove a prediction, for example that income and credit history contributed most to a loan rejection. It can also evaluate foundation models for accuracy, toxicity, robustness and stereotyping. The following table summarises its capabilities.

CapabilityWhat it does
Bias in training dataBefore training, finds under-represented groups or uneven positive labels
Bias in predictionsAfter training, finds differences such as approval rates between groups
Explainability (SHAP)Shows which features drove a prediction, e.g. "income and credit history contributed most to this rejection"
Foundation model evaluationChecks accuracy, toxicity, robustness and stereotyping
Sort into groups

What is Clarify checking?

Exam skills 4.1.7 · 4.2.2

Decide which SageMaker Clarify capability each finding comes from.

Log in to try this activity Interactive activities are free with an account.

Monitoring and governance

After deployment, models must be watched and documented. Model Monitor compares a deployed model's inputs and outputs with a baseline captured at training time, checking data quality, model quality, bias drift and feature attribution drift, and raises CloudWatch alerts when they change. Model Cards document each model's intended use, risk rating, training data, evaluation results and limitations, which auditors and reviewers need.

The Model Registry tracks model versions and whether each is approved. The Model Dashboard shows every model in one place, with its monitoring status and card. Role Manager defines least-privilege permissions for the different people who work on ML, such as data scientists and ML engineers. The following table summarises the features.

FeatureWhat it does
Model MonitorCompares endpoints with a baseline for data quality, model quality, bias drift and feature attribution drift; raises CloudWatch alerts
Model CardsDocument intended use, risk rating, training data, evaluation and limitations for audits
Model RegistryTracks versions and approval status
Model DashboardOne view of every model with its monitoring status and card
Role ManagerDefines least-privilege permissions for ML personas
Match the pairs

Governance features

Exam skills 4.2.2 · 5.2.1

Match each SageMaker AI feature with what it provides.

Log in to try this activity Interactive activities are free with an account.

Human review

A human-in-the-loop step sends predictions, for example low-confidence results, to people for review before they are used. This approach is common for regulated or high-impact decisions.

Worked example

Governing a loan approval model

A lender's model approves or rejects loan applications, a high-impact, regulated decision. The governance process uses several SageMaker tools in turn:

QuestionToolFinding
Is the training data balanced across age groups?Clarify (pre-training bias)Applicants over 60 are under-represented; more data is collected
Does the model approve groups at different rates?Clarify (post-training bias)Approval rates are similar after rebalancing
Why was this applicant rejected?Clarify (SHAP explanations)Debt-to-income ratio and missed payments contributed most
Who approved this model, for what use?Model Cards and Model RegistryIntended use, risk rating and approver recorded
Is it still fair six months later?Model Monitor (bias drift)Alerts if approval rates begin to diverge
Borderline cases?Human review stepLow-confidence decisions go to a human underwriter

Each tool answers a different governance question; together they give the regulator evidence that the model is fair, explainable, documented and supervised.

Check yourself

What is a SageMaker Model Card?

Show answer

A record of a model's intended use, training data, evaluation results and risks, used for governance and audits.

Exam Tips

Remember for the exam

  • To detect bias in data or models and explain predictions with SHAP, use SageMaker Clarify.
  • To detect drift in production, use SageMaker Model Monitor.
  • To document intended use, risks and evaluation for governance, use SageMaker Model Cards.
  • To track model versions and approvals, use the Model Registry.
  • For regulated or high-impact decisions, add human review of low-confidence predictions.