Skip to content
BIASED

Fairness, privacy and accountability in production

Calculate error tradeoffs and privacy mechanisms while keeping contribution, ownership and limits explicit.

Define groups, decisions and error denominators

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 Y=1Y=1 mean that correction is needed, and Y^=1\widehat Y=1 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 SS calibrated within each group satisfies

P(Y=1∣S=s,G=g)=sP(Y=1\mid S=s,G=g)=s

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.

Derive the rate tradeoff with its conditions

Why they cannot all hold

The conflict can be derived without a benchmark. Suppose groups have different positive truth rates pgp_g, and equalized odds fixes a common true-positive rate tt and false-positive rate ff. Partition selected cases by their true outcome:

P(Y^=1∣G=g)=tpg+f(1−pg),PPVg=tpgtpg+f(1−pg).\begin{aligned} P(\widehat Y=1\mid G=g)&=tp_g+f(1-p_g),\\ \mathrm{PPV}_g&=\frac{tp_g}{tp_g+f(1-p_g)}. \end{aligned}

For positive t,ft,f and an interior base rate, apply the quotient rule to differentiate the second expression with respect to pp:

ddptptp+f(1−p)=tf[tp+f(1−p)]2>0.\frac{d}{dp}\frac{tp}{tp+f(1-p)} =\frac{tf}{[tp+f(1-p)]^2}>0.

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 t−ft-f, so selection rates also differ when the classifier is informative in this sense. These conditions matter: a perfect predictor has f=0f=0 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.

Choose the harm and the appeal path

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.

Specify the protected contribution

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 D∼D′D\sim D' that represents one protected contribution. For example, adding or removing one person's single bounded record can be the unit. A randomized mechanism MM is (ε,δ)(\varepsilon,\delta)-differentially private when every adjacent pair and output event EE satisfy

P(M(D)∈E)≤eεP(M(D′)∈E)+δ.P(M(D)\in E)\le e^{\varepsilon}P(M(D')\in E)+\delta.

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.

Calibrate noise to adjacency and sensitivity

The Laplace mechanism

For a scalar query hh, sensitivity Δ\Delta bounds its largest change between adjacent datasets. The idealized Laplace mechanism releases the query plus centered Laplace noise of scale b=Δ/εb=\Delta/\varepsilon. Its density at output zz is proportional to the exponential of the negative distance from the true query value. The reverse triangle inequality gives

log⁡pD(z)pD′(z)=∣z−h(D′)∣−∣z−h(D)∣b≤∣h(D)−h(D′)∣b≤Δb=ε.\begin{aligned} \log\frac{p_D(z)}{p_{D'}(z)} &=\frac{|z-h(D')|-|z-h(D)|}{b}\\ &\le\frac{|h(D)-h(D')|}{b}\\ &\le\frac{\Delta}{b}=\varepsilon. \end{aligned}

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 ε=0.7\varepsilon=0.7, the scale is approximately 1.428571. To show the arithmetic, take a fixed illustrative uniform quantile u=0.8u=0.8. The positive-side inverse Laplace CDF gives

z0.8=−10.7log⁡(2(1−0.8))≈1.308987,7+z0.8≈8.308987.\begin{aligned} z_{0.8}&=-\frac{1}{0.7}\log\bigl(2(1-0.8)\bigr)\\ &\approx1.308987,\\ 7+z_{0.8}&\approx8.308987. \end{aligned}

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 [0,1][0,1], 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.

Bound individual gradients before averaging

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 (3,4)(3,4), (−6,8)(-6,8) and (0,2)(0,2), with norm bound C=5C=5. Their norms are five, ten and two. Scaling only the second vector gives (3,4)(3,4), (−3,4)(-3,4) and (0,2)(0,2), whose mean is (0,10/3)(0,10/3). The unclipped mean is (−1,14/3)(-1,14/3); 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.

Bind claims and obligations to a deployment

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.

Separate upload, approval and release permissions

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.

Keep the limits of the evidence visible

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.

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

Check your understanding

The same questions as in Pulse. Answers are shared between modes.

Go deeper — optional

Code and labs do not count toward the main percentage or the certificate.

  • Error-rate denominators and privacy arithmeticoptional

    Groups are artificial, not demographic data. The fixed Laplace quantile is deterministic and is not a private release. Clipping includes no noise or accountant and is not DP-SGD training. No attack code, sensitive data or legal classification is executed.

    ~20 min · easier on a computer · The corresponding lesson and basic Python functions.

    Self-check in the notebook — not part of mastery or the certificate.

Full notes

Answers are saved on the server and tied to this browser until you sign in.