Foundations to Frontier
Tests
P. Responsible AI › P Responsible AI

Scientific Integrity and Documentation: Model Cards, Datasheets

Responsible machine learning needs honest evidence and clear records. Model cards (M. Mitchell and colleagues, 2019) state what a model is for, how it was evaluated and how it performs for different groups; datasheets for datasets (T. Gebru and colleagues, 2018) record why and how data were collected, what they contain and how they should be used. Integrity means the reported numbers can be trusted: no leakage between training and test data, no repeated tuning on the test set, honest uncertainty and documented label quality. The exercises compute Wilson intervals and disaggregated results, then evaluate a classifier on 5,000 test people: overall accuracy is 86.5%, and every breakdown by a single attribute stays near or above 80%, but the intersection of two attributes reveals a group of 324 people at 65.1%, because their features were measured badly. Practice problems cover interval coverage, how many test examples a subgroup needs, duplicated test data, reuse of a test set, and noisy test labels.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

Saying honestly what a model does

A single headline accuracy hides almost everything a user of the model needs to know: what it was built for, what data it saw, where it fails and how sure we are. Model cards and datasheets are short structured documents that answer those questions, and integrity practices make sure the numbers in them mean what they claim.

🎮 Responsible AI lab

A classifier evaluated on 5,000 test people. Bars show accuracy from 50% to 100%, with the 95% Wilson interval as a line.

all
86.5%n = 5000

Every single-attribute breakdown stays near or above 80%; only the intersection reveals a group of 324 people at 65%.

Why engineers care

In Exercise 2, overall accuracy was 86.5% and no single-attribute breakdown fell below 79.9%, but one intersection of two attributes scored 65.1%.

📝 Quick check (Level 0)
0/3 answered
  1. 1. A model card reports…
  2. 2. A datasheet for a dataset records…
  3. 3. Disaggregated evaluation means…

Level 1: Beginner

★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.

By hand

  • Model cards (M. Mitchell and colleagues, 2019): model details, intended and out-of-scope uses, factors (groups, environments), metrics, training and evaluation data, quantitative analyses broken down by factor and their intersections, ethical considerations, caveats.
  • Datasheets for datasets (T. Gebru and colleagues, 2018): motivation, composition, collection process, preprocessing and labelling, uses, distribution and maintenance; data statements and nutrition labels are related formats.
  • Intersectional evaluation: groups defined by combinations of attributes can fail even when every single attribute looks fine (J. Buolamwini and T. Gebru, 2018).
  • Uncertainty: report intervals (Wilson for proportions) and group sizes; small groups need more test data.
  • Integrity: keep test data untouched until the end, check for duplicates and leakage, limit test-set reuse, document label quality, release code and data (topic O2-6), and report negative results (topic O2-7).
📝 Quick check (Level 1)
0/3 answered
  1. 1. Intersectional evaluation looks at groups defined by…
  2. 2. The Wilson interval is used for…
  3. 3. Data leakage means…

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 25 minUndergraduate students and practising engineers.

Disaggregated results with uncertainty

Exercise 1.

  • Compute Wilson intervals for accuracy.
  • Break results down by group, largest first, with sizes and intervals.
  • Check a model card for missing required sections and render a results table.

Practice.

  • Report every group and intersection that matters for the use, with sizes and intervals.
  • Size test sets for the smallest group you need to evaluate.
  • Deduplicate across splits and keep a final test set that is touched once.
  • Document label quality and correct metrics for known noise.
  • Write the card and datasheet as you go, not after release.
def wilson(k, n, z=1.96):
    p = k / n; c = (p + z * z / (2 * n)) / (1 + z * z / n)
    h = z * np.sqrt(p * (1 - p) / n + z * z / (4 * n * n)) / (1 + z * z / n)
    return c - h, c + h
for g in ("a", "b", "a and b"):
    print(render_table(disaggregate(correct, groups[g])))
🐍 Exercise 1: building blocks of a model card
Compute Wilson intervals, disaggregated accuracy by group, missing model-card sections and a markdown results table.
📝 Quick check (Level 2)
0/3 answered
  1. 1. With 10 test examples, the normal (Wald) interval covered a true accuracy of 0.9 about…
  2. 2. Duplicating 30% of the test set from training raised a 1-nearest-neighbour model's measured accuracy from 57.3% to…
  3. 3. Reporting the best of 1,000 variants that are all truly 80% accurate gave a reported accuracy of about…

Level 3: Advanced

★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.

Theory

Wilson interval. Inverting the normal test for a proportion gives (p̂ + z²/2n ± z√(p̂(1 − p̂)/n + z²/4n²))/(1 + z²/n). Unlike p̂ ± z√(p̂(1 − p̂)/n), it never leaves [0, 1] and keeps close to 95% coverage for small n and accuracies near 1.

Test set sizes. A 95% interval of half-width h around accuracy p needs n = z²p(1 − p)/h²: 196 examples for p = 0.85 and h = 0.05. Detecting a gap d between accuracies p and q with 80% power needs about (1.96 + 0.84)²(p(1 − p) + q(1 − q))/d² per group: 248 for a gap of 0.1.

Duplicates. If a share s of test examples are copies of training examples that a memorising model gets right, measured accuracy is s + (1 − s) × clean accuracy: 0.3 + 0.7 × 0.573 = 0.70.

Test-set reuse. If k variants with true accuracy a are each scored on the same n examples, the best score is the maximum of k estimates with standard deviation √(a(1 − a)/n), about a + 3.2 × 0.0126 = 0.841 for k = 1,000 and n = 1,000.

Noisy labels. If test labels are flipped at random with rate η, observed accuracy is a(1 − η) + (1 − a)η, so a = (observed − η)/(1 − 2η).

📝 Quick check (Level 3)
0/3 answered
  1. 1. Examples needed for a ±5-point interval around 85% accuracy are about…
  2. 2. Measured accuracy with a share s of memorised duplicates is…
  3. 3. Random label noise at rate η makes observed accuracy…

Level 4: Expert

★★★★★ Expert⏱ 30 minResearchers: original papers and open problems.

Can a model look fair on every single-attribute breakdown and still fail an intersectional group?

History.

  • Electronics and other engineering fields have long used datasheets for components; T. Gebru and colleagues (2018) proposed datasheets for datasets, and M. Mitchell and colleagues (2019) proposed model cards.
  • J. Buolamwini and T. Gebru (2018) showed that commercial face analysis failed most on darker-skinned women, a group hidden by breakdowns by gender or skin type alone; K. Crenshaw (1989) coined the term intersectionality.
  • C. Dwork and colleagues (2015) analysed adaptive reuse of a holdout set; B. Recht and colleagues (2019) found accuracy drops of 3% to 15% on fresh ImageNet test sets; C. Northcutt, A. Athalye and J. Mueller (2021) estimated an average of 3.3% label errors in common test sets.
  • Reproducibility checklists at NeurIPS (2019) and ICML, and the EU AI Act’s technical documentation requirements (topic P-6), made documentation part of standard practice.

Exercise 2.

  • People have attribute a (30% are 1) and attribute b (0, 1 or 2 with shares 50%, 30% and 20%). Labels follow a logistic model of 5 features.
  • Features are measured with noise of sd 0.3, except in the intersection a = 1, b = 2 (about 6% of people), where the noise sd is 2.0.
  • Logistic regression is trained on 5,000 people and evaluated on 5,000 more, overall, by a, by b and by a and b together, with 95% Wilson intervals.

Seed 0:

group n accuracy 95% interval
all 5,000 86.5% 85.5% to 87.4%
a = 0 3,534 88.1% 87.0% to 89.1%
a = 1 1,466 82.5% 80.4% to 84.3%
b = 0 2,456 87.6% 86.2% to 88.8%
b = 1 1,503 89.2% 87.5% to 90.6%
b = 2 1,041 79.9% 77.4% to 82.2%
a = 0, b = 0 1,742 87.7% 86.1% to 89.2%
a = 0, b = 1 1,075 89.8% 87.8% to 91.4%
a = 0, b = 2 717 86.6% 83.9% to 88.9%
a = 1, b = 0 714 87.3% 84.6% to 89.5%
a = 1, b = 1 428 87.6% 84.2% to 90.4%
a = 1, b = 2 324 65.1% 59.8% to 70.1%

Seeds 1 and 2: overall 87.4% and 86.3%; lowest single-attribute group (b = 2) 82.2% and 80.3%; intersection a = 1, b = 2 68.6% (280 people) and 64.4% (298 people).

Findings.

  • The overall accuracy of 86% to 87% hid a failure: one intersection of about 300 people scored 64% to 69%.
  • Single-attribute breakdowns diluted it: the groups containing it (a = 1 and b = 2) scored about 80% to 85%, because the failing intersection is under a third of either.
  • The other five intersections all scored about 86% to 90%, so the failure was specific to the combination.
  • Intervals mattered: the failing group’s interval (about ±5 points) was far wider than the overall one (about ±1 point), but still clearly below every other group.
🐍 Exercise 2 (research): can a model look fair on every single-attribute breakdown and still fail an intersectional group?
Train a classifier where one intersection of two attributes has badly measured features, and report its accuracy overall, by each attribute and by their intersection, with Wilson intervals.

Documentation in practice

  • Write a datasheet when you collect or adopt data: motivation, composition, collection, consent (topic O4-3), labelling, known gaps.
  • Write a model card before release: intended and out-of-scope uses, evaluation data, disaggregated and intersectional results with intervals (topic P-2), limitations.
  • Protect the test set: deduplicate across splits, freeze it, and use a separate validation set for tuning.
  • Report uncertainty and label quality, and say how results might differ in deployment.
  • Keep documents versioned with the model and data and update them when either changes (topic C2-1).

References

  1. M. Mitchell, S. Wu, A. Zaldivar, P. Barnes, L. Vasserman, B. Hutchinson, E. Spitzer, I. D. Raji and T. Gebru (2019). “Model cards for model reporting.” FAccT.
  2. T. Gebru, J. Morgenstern, B. Vecchione, J. W. Vaughan, H. Wallach, H. Daumé III and K. Crawford (2021). “Datasheets for datasets.” Communications of the ACM.
  3. J. Buolamwini and T. Gebru (2018). “Gender shades: intersectional accuracy disparities in commercial gender classification.” FAccT.
  4. B. Recht, R. Roelofs, L. Schmidt and V. Shankar (2019). “Do ImageNet classifiers generalize to ImageNet?” ICML.
  5. C. G. Northcutt, A. Athalye and J. Mueller (2021). “Pervasive label errors in test sets destabilize machine learning benchmarks.” NeurIPS Datasets and Benchmarks.