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.
| Capability | What it does |
|---|---|
| Bias in training data | Before training, finds under-represented groups or uneven positive labels |
| Bias in predictions | After 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 evaluation | Checks accuracy, toxicity, robustness and stereotyping |
What is Clarify checking?
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.
| Feature | What it does |
|---|---|
| Model Monitor | Compares endpoints with a baseline for data quality, model quality, bias drift and feature attribution drift; raises CloudWatch alerts |
| Model Cards | Document intended use, risk rating, training data, evaluation and limitations for audits |
| Model Registry | Tracks versions and approval status |
| Model Dashboard | One view of every model with its monitoring status and card |
| Role Manager | Defines least-privilege permissions for ML personas |
Governance features
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.
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:
| Question | Tool | Finding |
|---|---|---|
| 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 Registry | Intended 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 step | Low-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.
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.