All guides
Practice now
D4 · Guidelines for responsible AI

Bias, fairness, and SageMaker Clarify

Bias is the responsible-AI problem with the most practical weight on the exam: where it comes from, how it's detected, and which AWS tool measures it.

Where bias comes from

An ML model doesn't "decide" to be unfair — it learns statistical patterns from the data you give it. Bias almost always enters through one of these three doors.

Historical data

If the training data reflects a real inequality from the past (e.g. hiring, credit approval), the model learns that inequality as a "normal pattern" and reproduces it going forward.

Under-representation of groups

If a demographic group appears very little in the data, the model has fewer examples to learn to treat it well and makes more errors with that group — without anyone having "programmed" it that way.

Human annotator bias

When humans label data (e.g. "is this comment toxic?"), their own biases seep into the labels, and the model learns that exact bias as if it were objective truth.

Desirable dataset characteristics to mitigate bias

Curated sources

Data reviewed and selected with judgment, rather than collected without quality control

Balanced datasets

Proportional representation of the different groups, without any being under- or over-represented

Inclusiveness

The dataset deliberately includes perspectives and cases from the groups the model will serve in production

Data diversity

Variety of sources, contexts, and demographic profiles, so the model generalizes well beyond the majority group

Types of bias (conceptual level)

The exam doesn't ask for formulas — it asks you to recognize the type of bias described in a scenario.

Sampling bias

The collected data doesn't represent the real population the model will operate on.

Example: A speech-recognition model trained only on speakers from one specific region performs worse with accents from other regions.

Measurement bias

The way a piece of data is measured or collected differs systematically between groups, distorting the comparison.

Example: A medical sensor calibrated mainly for one skin type produces less accurate readings for other skin tones, and the model trained on that data inherits that error.

Exclusion bias

Data is removed during cleaning under the assumption it's "noise" or "irrelevant", when it actually represents a valid group.

Example: While cleaning transaction data, records with uncommon names are discarded as apparent data-entry errors, systematically removing a specific ethnic group.

What does

A SageMaker tool dedicated to detecting bias and explaining predictions

Bias detection — pre-training

Analyzes the dataset BEFORE training: measures whether a protected group is under-represented or if there are suspicious correlations between a sensitive attribute and the variable being predicted.

  • • Compares a group's proportion in the data vs. the expected population
  • • Detects class imbalance between groups
  • • Runs before spending compute training a potentially biased model

Bias detection — post-training

Analyzes the PREDICTIONS of the already-trained model: does the model succeed or fail differently depending on the group? Does it approve/reject at unequal rates between comparable groups?

  • • Measures differences in approval rate between groups
  • • Measures whether the error rate concentrates in a specific group
  • • Also runs in production, continuously
Related labD1 · AI and ML Fundamentals

Detect bias in a dataset with SageMaker Clarify

Detect and mitigate bias in a credit application dataset using SageMaker Clarify.

Understand what Clarify measures: the favorable-outcome rate per group
Interpret Disparate Impact and the 80% rule

+1 more...

9 min5 steps

Explainability — feature importance

Clarify also explains individual predictions: for a specific decision, it indicates which variables (features) influenced it most and in which direction — without going into the math behind it (based on game-theory concepts, like SHAP), it simply provides a ranking of "what weighed most in this decision and how much".

Example: for a credit rejection, Clarify might indicate that "debt-to-income ratio" weighed 40% in the decision, "payment history" 30%, etc. — information a human can communicate to the customer.

Related labD4 · Guidelines for Responsible AI

Explain a prediction with feature importance

Break down an individual credit-denial prediction into the features that drove it most, with a waterfall chart.

Understand explainability at the individual prediction level, not the group level
Interpret a waterfall chart of feature contributions

+1 more...

7 min2 steps

— human review in the prediction flow

Icon-Architecture/48/Arch_Amazon-Augmented-AI-A2I_48

Inserts a human review step before accepting an ML prediction

Amazon A2I lets you build flows where an ML prediction is sent to a human reviewer before being used, instead of applying it automatically. It's AWS's concrete mechanism for achieving "human in the loop" (controllability) in a production pipeline.

  • • Triggers when the model's confidence score is below a defined threshold
  • • Also triggers for cases flagged as sensitive, regardless of the model's confidence
  • • Complements SageMaker Clarify (which detects bias) and Model Monitor (which detects degradation in production): A2I adds the human-intervention step when the prediction is uncertain
  • • Useful in content moderation, document extraction, or high-impact decisions (credit, health)
Related labD4 · Guidelines for Responsible AI

Review a prediction with Amazon A2I (human-in-the-loop)

Review, as a human, a low-confidence prediction routed by Amazon Augmented AI (A2I).

Understand what human-in-the-loop is and when it triggers
Review a low-confidence prediction against the original document

+1 more...

6 min3 steps

— standard model documentation

A Model Card is a standardized document that accompanies a model so that anyone — another team, an auditor, a regulator — understands what the model is, what it's for, and where its limits are, without having to read the code.

Purpose

What use case the model was designed for and which ones it should NOT be used for

Training data

What data (at a high level) was used and its provenance

Known limitations

Scenarios where the model has low performance or bias risk

Per-subgroup metrics

Performance broken down by demographic group, not just an overall average

Why the exam mentions them

An overall accuracy metric (e.g. "92% accuracy") can hide the fact that the model gets 98% right for one group and 70% for another. Model Cards force reporting per-subgroup metrics, exposing exactly that kind of hidden bias.

Related labD4 · Guidelines for Responsible AI

Document a model with SageMaker Model Cards

Document the intended use, limitations, and training data of a model with SageMaker Model Cards.

Understand why documenting a model is part of AI governance
Fill in the standard fields of a model card: intended use, limitations, and data

+1 more...

8 min6 steps

When bias causes real harm

Scenario: automatic resume screening

A company trains a model to pre-filter resumes using 10 years of historical hires. Over those 10 years, 85% of hires for technical roles were men — not because of an explicit rule, but because of biases in the human hiring process that existed before the model.

The model learns that certain words associated with women's resumes (for example, mentioning "captain of the women's chess team" or graduating from an all-women's university) correlate with "not hired", and starts systematically penalizing those resumes — without anyone explicitly telling it "penalize gender".

Consequence: qualified candidates are automatically discarded before a human recruiter ever sees them. The harm is twofold: it perpetuates historical inequality and exposes the company to legal and reputational risk from algorithmic discrimination.

An analogous and widely cited case occurs in credit-approval models, where a zip code correlated with ethnicity or socioeconomic status acts as an indirect proxy for a protected attribute, even if that attribute was never directly included as an input variable.

Summary for the exam

ConceptWhat it does / what it is
SageMaker Clarify — pre-trainingDetects imbalance and suspicious correlations in the dataset before training
SageMaker Clarify — post-trainingMeasures differences in performance/decisions between groups in the model's predictions
SageMaker Clarify — explainabilityFeature importance: which variables weighed most in an individual prediction
Model CardsStandard documentation: purpose, data, limitations, and per-subgroup metrics
Sampling biasThe data doesn't represent the real population well
Measurement biasThe way data is measured varies systematically between groups
Exclusion biasValid data from a group is removed during cleaning

Did you get this topic?

Test what you just learned

A data science team wants to check, BEFORE training a loan-approval model, whether the dataset has an imbalanced representation across demographic groups. Which AWS tool should they use?

Ready to test "Bias, fairness, and SageMaker Clarify"?

Put what you learned to the test with original AIF-C01 exam questions.

Start AIF-C01 mock exam

Unlimited mock exams with the Pro plan

Log in to track your progress.