AI Ethics & Fairness

GATE DA Relevance: AI ethics and fairness are increasingly prominent in competitive exams. Expect questions on formal fairness definitions (demographic parity, equalized odds), sources of bias, and bias mitigation strategies. Understanding the mathematical formulations of these concepts is essential.

1. Introduction to AI Ethics

AI ethics encompasses the moral principles and techniques used to guide the development and deployment of artificial intelligence. As AI systems influence hiring, lending, healthcare, and criminal justice, ensuring they operate fairly and responsibly is paramount.

AI Ethics: The branch of ethics concerned with the moral behavior of humans as they design, construct, deploy, and use AI systems, as well as the moral behavior of the AI systems themselves.

1.1 Core Ethical Principles

  • Beneficence: AI should promote well-being and benefit humanity.
  • Non-maleficence: AI should not cause harm.
  • Autonomy: Human agency and decision-making should be preserved.
  • Justice: Benefits and risks of AI should be distributed fairly.
  • Transparency: AI systems should be understandable and open to scrutiny.
  • Accountability: Clear responsibility should exist for AI outcomes.

2. Bias in Data and Algorithms

Bias in AI can arise at multiple stages of the machine learning pipeline. Understanding these sources is the first step toward building fairer systems.

2.1 Sources of Data Bias

Historical Bias: Bias that exists in the real world and is reflected in the data. Even a perfectly collected dataset can contain historical biases from societal inequalities.
  • Representation Bias: Certain groups are underrepresented in training data. Example: facial recognition datasets historically contained fewer images of people with darker skin tones.
  • Measurement Bias: Features or labels are measured differently across groups. Example: using arrest records as a proxy for crime rates introduces bias against over-policed communities.
  • Sampling Bias: Training data is not drawn from the same distribution as the deployment population.
  • Label Bias: Human annotators introduce subjective biases into ground truth labels.
  • Aggregation Bias: A single model is used for populations that should be modeled separately.

2.2 Algorithmic Amplification

Even when data is relatively unbiased, algorithms can amplify small biases through feedback loops. A recommendation system that slightly favors popular content will, over time, make popular content even more dominant—a phenomenon called the Matthew effect or rich-get-richer dynamic.

Example — COMPAS Recidivism Prediction: The COMPAS system, used in US courts to predict criminal recidivism, was found to have significantly higher false positive rates for Black defendants compared to white defendants (ProPublica, 2016). Black defendants who did not reoffend were incorrectly flagged as high-risk nearly twice as often.

3. Formal Fairness Definitions

Fairness in machine learning has been formalized through several mathematical criteria. Let Y be the true label, Ŷ the predicted label, and A the sensitive attribute (e.g., gender, race).

3.1 Demographic Parity (Statistical Parity)

Demographic Parity: A classifier satisfies demographic parity if the prediction is independent of the sensitive attribute:

P(Ŷ = 1 | A = 0) = P(Ŷ = 1 | A = 1)

In other words, the positive prediction rate should be equal across all groups.

3.2 Equalized Odds

Equalized Odds: A classifier satisfies equalized odds if the prediction is conditionally independent of the sensitive attribute given the true label:

P(Ŷ = 1 | A = 0, Y = y) = P(Ŷ = 1 | A = 1, Y = y) for y ∈ {0, 1}

This requires equal true positive rates AND equal false positive rates across groups.

3.3 Equal Opportunity

Equal Opportunity: A relaxation of equalized odds that requires equality of true positive rates only:

P(Ŷ = 1 | A = 0, Y = 1) = P(Ŷ = 1 | A = 1, Y = 1)

Qualified individuals from all groups should have an equal chance of receiving a positive prediction.

3.4 Calibration

Calibration (Predictive Parity): Among individuals who receive the same predicted score s, the proportion of true positives should be equal across groups:

P(Y = 1 | Ŷ = s, A = 0) = P(Y = 1 | Ŷ = s, A = 1)
Impossibility Theorem (Chouldechova, 2017; Kleinberg et al., 2016): It is mathematically impossible to simultaneously satisfy calibration, equalized odds, and demographic parity when base rates differ between groups (i.e., P(Y = 1 | A = 0) ≠ P(Y = 1 | A = 1)). This fundamental result means practitioners must choose which fairness criterion to prioritize based on the application context.
Example — Hiring Classifier: A hiring model has: Group A (male) TPR = 0.85, FPR = 0.10; Group B (female) TPR = 0.70, FPR = 0.20. This violates equalized odds (both TPR and FPR differ). It also violates equal opportunity (TPR differs). The model systematically under-identifies qualified female candidates and over-flags unqualified female candidates.

4. Detecting Bias

Before mitigating bias, we must detect and quantify it using appropriate metrics.

4.1 Key Metrics

MetricFormulaInterpretation
Disparate Impact RatioP(Ŷ=1|A=0) / P(Ŷ=1|A=1)Values < 0.8 indicate adverse impact (US 80% rule)
Statistical Parity DifferenceP(Ŷ=1|A=0) − P(Ŷ=1|A=1)Should be close to 0
Equal Opportunity DifferenceTPRA=0 − TPRA=1Should be close to 0
Average Odds Difference½[(FPR0−FPR1) + (TPR0−TPR1)]Should be close to 0

4.2 Visualization Techniques

  • Confusion matrix per group: Compute separate confusion matrices for each sensitive group.
  • ROC curves per group: Plot ROC curves stratified by group to visualize performance disparities.
  • Calibration curves per group: Check if predicted probabilities are well-calibrated for each group.
  • Fairness dashboards: Tools like IBM AI Fairness 360, Google What-If Tool, and Microsoft Fairlearn provide interactive bias auditing.

5. Bias Mitigation Strategies

Bias can be mitigated at three stages of the ML pipeline: pre-processing (data level), in-processing (algorithm level), and post-processing (output level).

5.1 Pre-Processing Methods

  • Resampling: Oversample underrepresented groups or undersample overrepresented ones.
  • Reweighting: Assign higher weights to underrepresented group-label combinations.
  • Disparate Impact Remover: Transform features to remove correlations with the sensitive attribute while preserving rank ordering.
  • Learning Fair Representations: Learn a latent representation that encodes information about the data but obfuscates the sensitive attribute (Zemel et al., 2013).

5.2 In-Processing Methods

  • Adversarial Debiasing: Train the model jointly with an adversary that tries to predict the sensitive attribute from the model’s predictions. The model is penalized if the adversary succeeds.
  • Fairness Constraints: Add fairness metrics as constraints to the optimization objective:
    minθ L(θ) subject to |FPRA=0 − FPRA=1| ≤ ε
  • Prejudice Remover: Adds a regularization term that penalizes mutual information between predictions and the sensitive attribute.

5.3 Post-Processing Methods

  • Threshold Adjustment: Use different classification thresholds for different groups to equalize a chosen fairness metric (Hardt et al., 2016).
  • Reject Option Classification: Re-label instances near the decision boundary in favor of the disadvantaged group.
  • Calibrated Equalized Odds: Adjusts predicted probabilities post-hoc to satisfy equalized odds while maintaining calibration as much as possible.
Example — Threshold Adjustment: A credit scoring model has TPRmale = 0.90, TPRfemale = 0.75 at threshold t = 0.5. By lowering the threshold for the female group to t = 0.42, both groups achieve TPR ≈ 0.85, satisfying equal opportunity.

6. Ethical Frameworks for AI

Several ethical frameworks guide how we reason about the morality of AI systems.

6.1 Consequentialism (Utilitarianism)

Judges actions by their outcomes. An AI system is ethical if it maximizes overall well-being. Challenge: How to measure and compare well-being across different stakeholders.

6.2 Deontological Ethics (Kantian)

Judges actions by adherence to rules or duties, regardless of outcomes. An AI system should respect rights and follow ethical rules (e.g., never discriminate based on race). Challenge: Rules may conflict.

6.3 Virtue Ethics

Focuses on the character of the agent. Applied to AI: the development team should cultivate virtues like honesty, diligence, and empathy throughout the development process.

6.4 Care Ethics

Emphasizes relationships and responsibilities. AI systems should be designed with particular care for vulnerable populations who may be disproportionately affected.

7. Responsible AI Principles

Major technology organizations and governments have established responsible AI frameworks.

Common Responsible AI Pillars:
  • Fairness: AI should treat all people equitably.
  • Reliability & Safety: AI should perform reliably and safely.
  • Privacy & Security: AI should respect privacy and be secure.
  • Inclusiveness: AI should empower everyone and engage people.
  • Transparency: AI should be understandable.
  • Accountability: People should be accountable for AI systems.

7.1 Privacy Concerns in AI

  • Data Collection: Models often require vast amounts of personal data for training.
  • Model Memorization: Large models can memorize and potentially leak training data (Carlini et al., 2021).
  • Membership Inference: Attackers can determine if a specific data point was in the training set.
  • Model Inversion: Attackers can reconstruct training data features from model outputs.

7.2 Informed Consent

Users should be informed about how their data is collected, used, and shared. Meaningful consent requires:

  • Clear, plain-language explanation of data usage.
  • Granular control over what data is shared.
  • Easy ability to withdraw consent.
  • Transparency about automated decision-making.

8. Societal Impacts of AI

8.1 Labor Market Disruption

AI automation is reshaping employment. While AI creates new job categories, it also displaces workers in routine cognitive and manual tasks. The net effect depends on the pace of automation, investment in reskilling, and policy responses.

8.2 Concentration of Power

AI development requires massive computational resources and data, favoring large corporations. This can lead to monopolistic dynamics and power imbalances between technology companies, governments, and individuals.

8.3 Surveillance and Civil Liberties

AI-powered surveillance (facial recognition, behavioral analytics) raises serious concerns about civil liberties, freedom of expression, and the potential for authoritarian misuse.

8.4 Environmental Impact

Training large AI models has significant carbon footprints. GPT-3 training was estimated to produce approximately 552 tonnes of CO&sub2;. Responsible AI must consider environmental sustainability.

Example — Bias in Recruiting AI: Amazon’s experimental hiring tool (scrapped in 2018) was found to penalize résumés containing the word “women’s” because it was trained on historically male-dominated hiring patterns. This illustrates how historical bias in training data directly translates to discriminatory AI behavior.

9. Fairness-Accuracy Trade-Off

Imposing fairness constraints typically comes at some cost to predictive accuracy. The magnitude of this trade-off depends on:

  • Degree of existing bias: More biased models see larger accuracy drops when corrected.
  • Choice of fairness criterion: Stricter criteria (demographic parity) may cost more than relaxed ones (equal opportunity).
  • Base rate differences: Larger base rate differences between groups amplify the trade-off.
Practical Guideline: In many applications, modest fairness improvements can be achieved with minimal accuracy loss. The first few percent of fairness improvement is usually “cheap” in terms of accuracy, while achieving perfect fairness may be prohibitively expensive or impossible (per the impossibility theorem).

10. Summary & GATE DA Key Takeaways

GATE DA Exam Tips:
  • Memorize the formal definitions of demographic parity, equalized odds, equal opportunity, and calibration.
  • Understand the impossibility theorem: you cannot simultaneously satisfy all fairness criteria when base rates differ.
  • Know the three stages of bias mitigation: pre-processing, in-processing, post-processing.
  • Be prepared to calculate disparate impact ratios and statistical parity differences from confusion matrices.
  • Understand the sources of bias: historical, representation, measurement, sampling, label, aggregation.
  • Questions may present a scenario and ask you to identify which fairness criterion is violated.
Chapter Summary:
  • AI ethics encompasses fairness, accountability, transparency, and privacy.
  • Bias enters through data (historical, representation, measurement) and algorithms (amplification).
  • Formal fairness: Demographic Parity, Equalized Odds, Equal Opportunity, Calibration.
  • The impossibility theorem limits simultaneous satisfaction of multiple fairness criteria.
  • Mitigation: pre-processing (reweighting, fair representations), in-processing (adversarial debiasing, constraints), post-processing (threshold adjustment).
  • Responsible AI requires balancing fairness, accuracy, privacy, safety, and transparency.