Responsible AI: bias, fairness, transparency

In one sentence

Measure quality per user group, not just on average; document what the system is for and where it fails; keep humans able to intervene; and keep monitoring after launch.

Analogy: A nutrition label plus food-safety inspections: the label (model card) says what's inside and who shouldn't eat it; inspections (slice evals, monitoring) check it stays true batch after batch.

Review depth scales with risk, but every system gets slice evals, a card and per-slice monitoring that loops back into evals.

How it works

  • Break metrics down by slice (language, region, age band, device) and compare error rates; averages hide gaps.
  • Check disparate impact: each group's selection rate ÷ the top group's; under 0.8 is a red flag.
  • Fairness definitions conflict when base rates differ, so pick one per use case and write down why.
  • Model cards, datasheets and system cards document intended uses, per-group results and known limitations.
  • Chain-of-thought may not be a faithful explanation; prefer citations to sources and decision logs.

Check yourself

Answer to mark it learned; your answers aren't scored.

Your résumé screener shortlists applicants over 50 at a much lower rate than those aged 25–34, with thousands of applicants in each group. The team removes age from the inputs and retrains, but the gap barely moves. Most likely cause?

Go deeper

Full explanation

Responsible AI means making sure a system works well, and fails fairly and visibly, for everyone it affects. Four parts:

  • Fairness, measured by slice. Averages hide gaps. Break metrics down by group (language, region, age band, gender where lawful, device, disability) and compare error rates, not just accuracy. For decisions about people, check disparate impact: each group's selection rate ÷ the top group's; under 0.8 (the US four-fifths rule) is a red flag. Fairness definitions conflict: when base rates differ you can't equalize calibration and error rates at once, so pick one per use case and write down why.
  • Transparency artifacts. Model cards (Mitchell et al., 2019): intended and out-of-scope uses, per-group evaluation, limitations. Datasheets for datasets (Gebru et al.): origin, collection, consent, known gaps. System cards: the whole product, meaning model plus prompts, tools and guardrails.
  • Human oversight and explainability. Affected people can contest a decision and operators can override it. An LLM's chain-of-thought is not guaranteed to be a faithful explanation; prefer citations to sources and decision logs.
  • Accessibility: screen readers, plain language, non-English users.

A lightweight program has four steps: an impact assessment at intake, a review sized to the risk, documentation that ships with the system, and monitoring per slice after launch.

Code Per-group metrics and a four-fifths gate with Fairlearn
pythonPer-group metrics and a four-fifths gate with Fairlearn
from fairlearn.metrics import MetricFrame, selection_rate, false_negative_rate
from sklearn.metrics import accuracy_score

# y_pred: 1 = shortlisted by the screening model
mf = MetricFrame(
    metrics={
        "accuracy": accuracy_score,
        "selection_rate": selection_rate,
        "false_negative_rate": false_negative_rate,  # qualified but rejected
    },
    y_true=y_true,
    y_pred=y_pred,
    sensitive_features=df["age_band"],
)
print(mf.overall)        # the number everyone reports
print(mf.by_group)       # the table that average hides
print(mf.difference())   # worst gap between groups, per metric

# Disparate impact: lowest selection rate / highest (four-fifths rule)
rates = mf.by_group["selection_rate"]
ratio = rates.min() / rates.max()
if ratio < 0.8:
    raise SystemExit(f"Disparate impact ratio {ratio:.2f} < 0.8: block release")
Real example

A résumé-screening assistant agrees with recruiters 91% of the time overall. Sliced by language, it's 93% on CVs by native English speakers and 78% on CVs by non-native speakers, and its shortlist rate for applicants over 50 is 0.62× that of the 25–34 band, below the 0.8 threshold. The team drops graduation years from the input, adds counterfactual tests (same CV, swapped name and age), re-evaluates per slice, ships a model card stating "decision support only: a recruiter reviews every rejection", and adds a monthly per-slice dashboard.

Trade-offs +3 · −3

+ You gain

  • Catches failures that averages hide, before users, journalists or regulators do.
  • Model and system cards speed up reviews, procurement and audits, and double as onboarding docs.
  • The same artifacts become evidence for the EU AI Act and NIST AI RMF.

− You pay

  • Needs group labels you often don't have, or may not lawfully collect.
  • Fairness metrics conflict; choosing one is a value judgment someone must own.
  • Small slices give noisy metrics; you need enough examples per group.

Use it when

Any system that ranks, scores or decides about people (hiring, credit, healthcare, moderation, education) or serves a diverse user base. Scale the depth of review to the risk.

Avoid it when

A full review board for an internal log summarizer with no effect on people is pure overhead; a short checklist and a named owner suffice.

Numbers to know 3
  • Four-fifths rule (US EEOC guidelines, 1978): a group's selection rate below 80% of the top group's signals adverse impact.
  • Gender Shades (2018): commercial gender classifiers erred up to 34.7% on darker-skinned women vs 0.8% on lighter-skinned men.
  • Model cards: Mitchell et al., 2019. Datasheets for datasets: Gebru et al., 2018.
Common pitfalls 4
  • Reporting one aggregate metric and calling the system fair.
  • "Fairness through unawareness": dropping the protected attribute while zip code or graduation year still proxies for it.
  • Writing the model card once at launch and never updating it.
  • Treating an LLM's stated rationale as an explanation of how the decision was actually made.
Interview questions 3

Answer out loud first, then reveal.

How would you assess fairness for an LLM feature that prioritizes support tickets?Show answer

First I define who could be harmed: customers whose urgent tickets get deprioritized. Then the slices that matter: language, region, plan tier, writing style. I build an eval set with enough examples per slice and measure the false-negative rate on truly urgent tickets per slice, not overall accuracy. I add counterfactual tests, the same ticket with a different name or dialect. If a slice lags, I fix data or prompts or route it to a human queue, and I monitor per-slice metrics in production because the input mix drifts.

What goes in a model card versus a system card?Show answer

A model card documents one model: intended uses and explicit out-of-scope uses, a training-data summary, evaluation broken down by relevant groups, known limitations. A system card documents the deployed product, because that's what users experience: the model plus prompts, retrieval sources, tools, guardrails, human oversight and monitoring. When we build on a vendor LLM, the system card is the one I own; the vendor's model card is an input to it, not a substitute.

How do you run responsible AI without slowing every team down?Show answer

I make it tiered and mostly self-serve. Every use case fills a 15-minute impact assessment, and most land in a low tier with a checklist and an accountable owner. Only systems that decide about people or act autonomously go to a review board, with a fixed turnaround. Card templates live next to the code, slice evals run in the same CI as quality evals, and monitoring reuses the observability stack. Skipping it isn't cheaper: rework after a public failure costs far more than a review.