15 / 16 · Responsibility and Cost
Fairness, privacy and accountability in production
Fairness criteria, privacy guarantees and accountable releases: original confusion-count and clipping examples, Laplace noise arithmetic, documentation and the limits of a regulatory overview.
Designing an ML system · LLMOps · Classification metrics · Stochastic gradient descent
On this page 11
A model can satisfy its accuracy and latency targets while distributing mistakes unevenly, exposing information about training records or leaving a harmful decision without an accountable owner. System design specifies what a service should do. Responsible operation also specifies whose interests a decision affects, what evidence supports it and how someone can challenge it.
We use a fictional document-preview service to keep the calculations concrete. A positive decision requests human correction; a false positive creates unnecessary review, while a false negative leaves a defective preview uncorrected. All counts below are newly constructed. Groups A and B are artificial cohorts, not demographic observations or evidence about real people.
Baseline: leave the protected attribute out#
Removing a group column does not make a decision independent of the group. Construct eight cases: in group A, three of four have a flag set; in group B, one of four does. A rule that requests review whenever the flag is set uses no group input, yet its selection rates are 75% and 25%. Correlated inputs can carry the distinction.
That calculation does not establish unfairness: it contains no outcome labels, costs or account of why the flag differs. It establishes the narrower failure of an argument: “the model does not read the group, therefore its decisions cannot differ by group.” To assess a deployment, define the affected population, the relevant outcomes and the harm of each error. Otherwise a dashboard can equalize a convenient number while ignoring the actual concern.
Measurement also needs appropriate access to group information. Do not infer sensitive categories from names merely to fill an audit table. Determine the permitted collection and use, who can access the data and how long it is retained. Missing information should be recorded as a limit of the assessment.
Three fairness criteria#
Let mean that correction is needed, and that the service requests it. Use the confusion-count definitions from Classification metrics. Three distinct questions concern the decision rate, the error rates conditional on truth, and the reliability of a positive decision:
- Demographic parity asks for equal selection rates across the specified groups.
- Equalized odds asks for equal true-positive and false-positive rates. Equal opportunity retains only the true-positive condition (Hardt, Price and Srebro).
- Predictive parity asks for equal positive predictive value: among selected cases, what fraction truly need correction?
These are properties of a specified distribution and decision rule. They do not by themselves determine whether the labels, groups or intended action are appropriate. Predictive parity for a binary decision is also different from score calibration. A score calibrated within each group satisfies
at supported score values in each group. A thresholded decision combines multiple scores; its positive predictive value can differ between groups even when the scores are calibrated.
Here are two independently specified batches, each containing one hundred cases:
| Group | True positive | False negative | False positive | True negative |
|---|---|---|---|---|
| A | 30 | 10 | 15 | 45 |
| B | 15 | 5 | 20 | 60 |
Both groups have true-positive rate 0.75 and false-positive rate 0.25. Their other rates differ:
| Group | Positive truth rate | Selected | Positive predictive value |
|---|---|---|---|
| A | 0.40 | 0.45 | 2/3 |
| B | 0.20 | 0.35 | 3/7 |
Every entry follows from the displayed counts. For instance, A selects 45 cases and 30 need correction. The table satisfies empirical equalized odds, but neither demographic nor predictive parity. It is an exact finite construction, not an estimate precise enough to certify a real population.
Why they cannot all hold#
The conflict can be derived without a benchmark. Suppose groups have different positive truth rates , and equalized odds fixes a common true-positive rate and false-positive rate . Partition selected cases by their true outcome:
For positive and an interior base rate, apply the quotient rule to differentiate the second expression with respect to :
Thus different base rates give different PPVs under those assumptions. Substituting our common rates reproduces two thirds and three sevenths. The first expression has slope , so selection rates also differ when the classifier is informative in this sense. These conditions matter: a perfect predictor has and PPV one wherever positives occur. Undefined rates from empty denominators require separate handling.
Chouldechova studies related incompatibilities (2017). The calculation here is a binary-decision argument, not a claim that every fairness definition conflicts in every setting. It tells a team to specify the harm it prioritizes and disclose the remaining differences, rather than promise all metrics will be equal simultaneously.
What a team can do with this#
In the preview service, a missed defect and unnecessary review have different consequences. Choose acceptable error conditions with the people responsible for those consequences. Compare counts as well as rates: a small subgroup can have a wide uncertainty interval, and a zero observed error is not proof of zero risk. Examine relevant intersections when there is sufficient and appropriately obtained evidence.
A threshold change moves the tradeoff; it does not repair an unreliable label. First check whether human reviewers follow the same correction standard, whether all cohorts have comparable chances of receiving a label and whether capture conditions differ. Then compare candidate policies on a fixed evaluation version. Document the selection rule, uncertainty, important exclusions and the person who accepts the residual risk.
An appeal path is another part of the system. Preserve enough evidence to reconstruct a decision, offer a way to correct input errors and specify when a human may override the model. Logging every document forever is not required to make a decision traceable: identifiers, artifact versions and access-controlled evidence can have different retention periods.
Privacy: what a model reveals about its training data#
Membership inference asks whether a particular record participated in training, given access to the model or its outputs. Shokri and coauthors demonstrate this attack setting (2017). Membership can itself be sensitive even when the attacker already knows the record’s contents.
Removing a person’s name from a dataset does not establish that model outputs conceal their contribution. Nor does withholding confidence scores prove protection: other observable behavior may carry information. Empirical attack evaluation depends on the attacker’s knowledge and access. Failing to find a successful attack is bounded evidence about the tested attack, not a universal privacy guarantee.
Separate model privacy from ordinary system exposure. A well-designed private training procedure cannot protect an unrestricted log containing the original documents. Access control, data minimization and deletion must cover inputs, intermediate checkpoints, evaluation artifacts and observability as well as the released model.
Differential privacy#
Choose an adjacency relation that represents one protected contribution. For example, adding or removing one person’s single bounded record can be the unit. A randomized mechanism is -differentially private when every adjacent pair and output event satisfy
The probability is over the mechanism’s randomness; the requirement is not an average over easy records. With zero delta this is pure differential privacy. The parameters bound output-distribution changes, not the probability that a person’s identity is discovered (Dwork and Roth).
The contribution unit is essential. Protecting one row is weaker than protecting a person who supplies many rows unless that multiplicity is accounted for. Specify clipping or contribution limits before calibrating noise. Choose a privacy budget for all releases, including training and evaluation that query private data. Under basic sequential composition, two pure-private releases with budgets 0.2 and 0.3 give a combined bound of 0.5; repeating a query does not reset the budget.
The Laplace mechanism#
For a scalar query , sensitivity bounds its largest change between adjacent datasets. The idealized Laplace mechanism releases the query plus centered Laplace noise of scale . Its density at output is proportional to the exponential of the negative distance from the true query value. The reverse triangle inequality gives
Exponentiating and integrating over any event establishes the pure-privacy inequality. This uses a correct random mechanism and the declared sensitivity; adding an arbitrary small noise value does not inherit the proof.
For a count to which each person contributes at most one, sensitivity is one. At , the scale is approximately 1.428571. To show the arithmetic, take a fixed illustrative uniform quantile . The positive-side inverse Laplace CDF gives
Fixing that quantile makes this demonstration deterministic and not a private release. A deployed mechanism requires an appropriate random sampler and implementation analysis. The fixture checks the formula, not privacy of floating-point sampling.
For a different adjacency relation, replacing one bounded value in a fixed, publicly known batch of one hundred values in , the mean has sensitivity 0.01. At the same epsilon its noise scale is approximately 0.014286. This does not apply to an unbounded mean or a secretly changing denominator. Bounds and adjacency determine the noise, not the observed sample’s convenient range.
DP-SGD in brief#
DP-SGD bounds each example’s gradient, adds noise to the aggregated update and accounts for privacy across sampling and training steps (Abadi and coauthors). Clipping the final batch gradient alone does not bound each person’s influence in the same way.
Take three newly specified gradients , and , with norm bound . Their norms are five, ten and two. Scaling only the second vector gives , and , whose mean is . The unclipped mean is ; its norm is already below five, so clipping only that mean leaves a different answer.
Our calculation ends at clipping. It does not train a private model, add Gaussian noise or compute an epsilon. A real accountant needs the sampling method, contribution unit, number of updates and noise scale. Tuning many private runs and selecting one can consume additional privacy budget. A small optimizer learning rate is not a substitute for that accounting.
Documentation: model cards and datasheets#
Model cards describe a model’s intended context and evaluation; datasheets document a dataset’s creation and use (Mitchell and coauthors; Gebru and coauthors). Neither is a permission slip or proof that the measured system is appropriate. Link each document to the actual model or data revision so that a replacement does not inherit obsolete claims.
For our fictional release, an independently specified evidence record would connect these questions:
| Decision question | Evidence to retain |
|---|---|
| What does a positive result do? | Requests correction; never deletes the source document |
| Which cases were checked? | Versioned evaluation set and cohort definitions |
| What may be disclosed? | Declared contribution unit and release-budget record |
| Who can change a decision? | Named operational role and override procedure |
| When is evidence invalidated? | New artifact, capture process or labeling rule |
This is a small example of connecting claims to artifacts, not a reproduced model-card template. Add actual owners and results when deploying; do not invent favorable measurements to complete a form. Dataset access, reuse rights and personal-data processing are separate questions and each needs evidence.
Regulation: the EU AI Act#
Applicability depends on the operator’s role, the use and the jurisdictional scope. Article 2 includes certain providers and deployers outside the EU when system outputs are used in the Union; scope also contains exceptions. Do not classify a system from its model architecture alone. Check the applicable category, obligations and transition rules against the current official text for the concrete deployment.
For high-risk systems, Article 9 addresses lifecycle risk management and testing; Article 10 addresses data governance and suitability for the intended setting. These connect to engineering evidence, but an internal evaluation report does not automatically satisfy the legal requirements. Data-protection rules remain relevant. Article 4a’s provisions on special-category data for bias detection and correction include strict necessity and cumulative safeguards; they are not blanket permission to collect sensitive attributes.
This bounded overview was checked against the Commission’s consolidated-text explorer on 13 November 2026. Use its official implementation timeline and the current regulation when planning a deployment. This note does not assign a legal category to the fictional preview service or provide a compliance determination. A course summary cannot replace assessment of the actual purpose, operator and data flows.
Attacks on models in production#
A threat model specifies what an attacker can change or observe. Poisoning alters training inputs or state; evasion changes inference inputs; model extraction attempts to recover model behavior or parameters through access. NIST’s taxonomy distinguishes these mechanisms (Vassilev and coauthors). Their controls must match the attack surface.
For the preview service, untrusted correction uploads should not become trusted training labels merely because they passed a file-format check. Record their origin, limit who can approve them and evaluate changes before release. A signed or hashed snapshot can expose an unexpected substitution relative to a trusted record; it cannot prove that the original labels were honest.
Separate permissions for uploading data, approving labels, registering artifacts and moving the serving alias. Minimize returned information and observe unusual access patterns without claiming that rate limits prevent every extraction attack. Preserve rollback evidence and rehearse containment. No attack code or external exploit is needed to identify these boundaries.
What changed#
Responsibility now has inspectable decisions: the chosen harm criterion, the population measured, the protected contribution, the release budget and the person authorized to act. A high overall score cannot silently stand in for all of them.
Limitations#
The counts are synthetic, and matching their rates provides no evidence about a real group. The privacy calculations assume mathematical mechanisms and do not validate a sampler or training library. Documentation can expose missing evidence but cannot manufacture it. Regulatory applicability changes with purpose and law; recheck it at release. Technical metrics help make decisions accountable without selecting the acceptable social tradeoffs by themselves.
What you should remember#
- State the harm and population before choosing a fairness metric.
- Equal error rates can coexist with unequal positive predictive values.
- Privacy needs a contribution definition, a mechanism and release accounting.
- Per-example clipping alone is not a privacy guarantee.
- Bind claims, owners and evidence to the deployed revision.
Example#
The original standard-library program calculates both confusion tables, the eight-case proxy rule, Laplace quantile arithmetic and per-example clipping. Saved output includes exact rates and explicit limits. It downloads no data, trains no model and releases no private information. The fixed quantile is deliberately a calculation rather than a usable private sampler.
Next#
Cost and efficiency compares resource choices under explicit service constraints. A cheaper configuration is a candidate only after the release, privacy and accountability conditions are specified.
References#
- Moritz Hardt, Eric Price and Nathan Srebro. Equality of Opportunity in Supervised Learning. NeurIPS, 2016. Definitions 2.1–2.2; no FICO example or figure reused.
- Alexandra Chouldechova. Fair prediction with disparate impact. 2017. Primary abstract on incompatible criteria; the binary-count calculation here is independently derived.
- Reza Shokri, Marco Stronati, Congzheng Song and Vitaly Shmatikov. Membership Inference Attacks against Machine Learning Models. IEEE S&P, 2017. Abstract: membership-inference setting, not a reused attack experiment.
- Cynthia Dwork and Aaron Roth. The Algorithmic Foundations of Differential Privacy. 2014. Definition 2.4; scalar specialization of the Laplace mechanism, Section 3.3; composition, Theorem 3.16. Standard definitions and mathematics; no book example or algorithm listing reproduced.
- Martín Abadi, Andy Chu, Ian Goodfellow, H. Brendan McMahan, Ilya Mironov, Kunal Talwar and Li Zhang. Deep Learning with Differential Privacy. CCS, 2016. Algorithm 1 mechanism; no source code or benchmark reused.
- Margaret Mitchell and coauthors. Model Cards for Model Reporting. FAT*, 2019. Primary abstract: intended use and contextual evaluation.
- Timnit Gebru, Jamie Morgenstern, Briana Vecchione, Jennifer Wortman Vaughan, Hanna Wallach, Hal Daumé III and Kate Crawford. Datasheets for Datasets. CACM, 2021. Primary abstract: documenting dataset creation and use.
- European Commission. AI Act Service Desk, consolidated text as at 27 July 2026: Article 2, Article 4a, Article 9, Article 10. Checked 13 November 2026; read actual provisions, not only explanatory summaries.
- Apostol Vassilev, Alina Oprea, Alie Fordyce, Hyrum Anderson, Xander Davies and Maia Hamin. Adversarial Machine Learning: A Taxonomy and Terminology of Attacks and Mitigations. NIST AI 100-2e2025, March 2025. Sections 2.2–2.4: attack categories; no source attack case, diagram or measured result reproduced.