In federated learning, fairness metrics assess bias in the global aggregated model across a decentralized population. Core metrics include demographic parity (equal prediction rates), equalized odds (equal true/false positive rates), and equal opportunity (equal true positive rates). These are calculated by comparing model performance across protected attributes within the client population, often requiring careful statistical aggregation from local evaluations to preserve privacy.
Glossary
Fairness Metrics

What is Fairness Metrics?
Fairness metrics are quantitative measures used to evaluate whether a machine learning model's predictions exhibit unwanted bias against subgroups defined by sensitive attributes like race, gender, or age.
Applying these metrics in federated settings presents unique challenges due to statistical heterogeneity (non-IID data) and the inability to centrally inspect raw data. Solutions involve federated evaluation protocols that compute fairness statistics locally and aggregate them securely. Engineers must navigate the utility-fairness trade-off, where optimizing for fairness can impact overall model accuracy, and ensure metrics align with legal and ethical definitions of discrimination for the specific application domain.
Key Fairness Metrics & Definitions
Quantitative measures to detect and mitigate unwanted bias in a model's predictions across subgroups defined by sensitive attributes like gender or race.
Demographic Parity
Also known as statistical parity, this metric assesses whether a positive prediction is made at the same rate across different demographic groups. It is defined as P(Ŷ=1 | A=a) = P(Ŷ=1 | A=b) for all groups a, b. Example: If a loan approval model grants loans to 10% of applicants in Group A, it should also grant loans to approximately 10% in Group B. This is a group fairness metric focused on outcomes, not the correctness of those outcomes. A key limitation is that it does not account for potential differences in qualification rates between groups.
Equalized Odds
A stricter fairness criterion requiring that a model's true positive rate (TPR) and false positive rate (FPR) are equal across groups. Formally: P(Ŷ=1 | A=a, Y=y) = P(Ŷ=1 | A=b, Y=y) for y ∈ {0,1}. Example: A recidivism prediction tool should be equally accurate at predicting re-offense (TPR) and equally inaccurate at falsely predicting re-offense (FPR) for all racial groups. This metric ensures fairness is considered conditioned on the true outcome. Satisfying equalized odds implies demographic parity is also satisfied if the base rates (prevalence of the positive class) are equal across groups.
Equal Opportunity
A relaxation of Equalized Odds that requires only the true positive rate (TPR) to be equal across groups. Formally: P(Ŷ=1 | A=a, Y=1) = P(Ŷ=1 | A=b, Y=1). Example: A hiring model should identify qualified candidates from all gender groups at the same rate. This is often considered a more achievable goal than full equalized odds, as it focuses on fairness for the advantaged outcome (e.g., getting a loan, being hired). It does not constrain the false positive rates, which may still differ.
Predictive Parity
Also known as outcome test, this metric requires that the precision (or positive predictive value) of the model is equal across groups. Formally: P(Y=1 | A=a, Ŷ=1) = P(Y=1 | A=b, Ŷ=1). Example: If a medical diagnostic tool flags patients as high-risk, the proportion of those patients who actually develop the disease should be the same for all ethnicities. This is a calibration-based fairness notion. A key result (from Kleinberg et al.) shows that, except in degenerate cases, a model cannot simultaneously satisfy demographic parity and predictive parity if the base rates of the outcome differ between groups.
Disparate Impact
A legal and statistical measure derived from the 80% rule used in U.S. employment law. It is calculated as the ratio of the rate of favorable outcomes for a protected group to the rate for the most favored group. A value less than 0.8 may indicate unlawful discrimination. Formula: (Rate of favorable outcome for protected group) / (Rate for most favored group). Example: If 60% of male applicants are hired and 40% of female applicants are hired, the disparate impact ratio is 40%/60% = 0.67, indicating potential bias. This is closely related to demographic parity but is often used as a legal compliance threshold rather than an optimization target.
Fairness in Federated Context
Evaluating these metrics in federated learning introduces unique challenges. Data is partitioned across clients, which may correspond to different demographic groups. Key considerations:
- Local vs. Global Fairness: A model may appear fair globally but be highly unfair on specific clients (statistical heterogeneity).
- Measurement: Computing group fairness metrics requires knowledge of sensitive attributes, which may be private to each client. This necessitates secure multi-party computation or local differential privacy for aggregation.
- Mitigation: Fairness interventions (e.g., re-weighting, adversarial debiasing) must be adapted for decentralized execution, often requiring clients to perform local fairness adjustments before sending updates to the server.
Fairness Metrics in Federated Learning
Fairness metrics in federated learning are quantitative measures used to evaluate whether a globally aggregated model exhibits unwanted bias against subgroups defined by sensitive attributes like race or gender, despite being trained on decentralized, private data.
These metrics, such as demographic parity, equalized odds, and equal opportunity, are calculated by comparing model performance disparities across protected subgroups. In a federated setting, this requires secure aggregation of local fairness statistics from clients, as raw sensitive data cannot be centralized. This process ensures the global model's predictions are equitable without compromising client privacy.
The core challenge is statistical heterogeneity, where local data distributions vary significantly. A model fair on one client's data may be unfair on another's. Federated fairness evaluation must therefore account for this non-IID data to prevent a globally 'fair' average from masking severe local biases, necessitating techniques like personalized fairness or subgroup-aware robust aggregation.
Comparison of Common Fairness Metrics
A comparison of key fairness definitions, their mathematical formulations, and their applicability in federated learning contexts.
| Metric | Definition | Mathematical Formulation | Federated Learning Considerations |
|---|---|---|---|
Demographic Parity | Requires the model's predictions to be statistically independent of a sensitive attribute (e.g., race, gender). | P(Ŷ=1 | A=a) = P(Ŷ=1 | A=b) for all groups a, b. | Can be evaluated via federated evaluation by aggregating local group statistics. May conflict with accuracy if base rates differ. |
Equalized Odds | Requires the model's true positive and false positive rates to be equal across groups defined by a sensitive attribute. | P(Ŷ=1 | A=a, Y=y) = P(Ŷ=1 | A=b, Y=y) for y ∈ {0,1} and all groups a, b. | Requires knowledge of ground truth labels (Y) per group, which can be computed locally but aggregated securely. More compatible with accuracy than demographic parity. |
Equal Opportunity | A relaxed form of Equalized Odds requiring only true positive rates (or false negative rates) to be equal across groups. | P(Ŷ=1 | A=a, Y=1) = P(Ŷ=1 | A=b, Y=1) for all groups a, b. | Easier to satisfy than full equalized odds. Federated computation focuses on the positive class, which may have limited samples per client. |
Predictive Parity | Requires the model's precision (positive predictive value) to be equal across groups. | P(Y=1 | A=a, Ŷ=1) = P(Y=1 | A=b, Ŷ=1) for all groups a, b. | Difficult to guarantee in federated learning without sharing prediction-outcome pairs, posing a privacy challenge. Sensitive to label noise. |
Treatment Equality | Requires the ratio of false negatives to false positives to be equal across groups. | FN_a / FP_a = FN_b / FP_b for all groups a, b. | Useful in cost-sensitive applications. Can be computed from local confusion matrices but requires careful aggregation to handle small per-client counts. |
Individual Fairness | Requires that similar individuals receive similar predictions, as defined by a task-specific similarity metric. | D(Ŷ_i, Ŷ_j) ≤ L * d(x_i, x_j) for a distance metric d and Lipschitz constant L. | Extremely challenging in federated learning due to the inability to directly compare raw data points (x_i, x_j) across clients to enforce the similarity constraint. |
Counterfactual Fairness | Requires a model's prediction to be the same in the actual world and a counterfactual world where an individual's sensitive attribute was changed. | P(Ŷ_{A←a}(U) = y | X=x, A=a) = P(Ŷ_{A←b}(U) = y | X=x, A=a) | Theoretically rigorous but requires a causal model. Infeasible in standard federated learning where the server cannot access the causal graph or perform interventions on client data. |
Frequently Asked Questions
Fairness metrics are quantitative measures used to evaluate whether a machine learning model's predictions exhibit unwanted bias against specific subgroups defined by sensitive attributes like gender, race, or age. In federated learning, these metrics must be computed in a decentralized, privacy-preserving manner.
Demographic parity, also known as statistical parity, is a group fairness metric that requires a model's predictions to be independent of a sensitive attribute. It is satisfied when the probability of receiving a positive outcome is equal across all subgroups defined by the sensitive attribute (e.g., gender).
How it's measured: The metric is typically calculated as the difference or ratio of positive prediction rates between groups. For a binary classifier and a binary sensitive attribute (e.g., group A and group B), demographic parity difference (DPD) is:
DPD = P(Ŷ=1 | A) - P(Ŷ=1 | B)
Where Ŷ is the model's prediction. A value of 0 indicates perfect parity. In federated learning, these probabilities must be estimated by aggregating local counts from clients without exposing sensitive group memberships, often using secure summation protocols.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Fairness metrics quantify algorithmic bias. These related concepts define the statistical properties, sensitive attributes, and evaluation frameworks necessary for a comprehensive fairness assessment in federated and centralized machine learning.
Demographic Parity
Demographic Parity, also known as statistical parity, is a group fairness criterion requiring that a model's positive prediction rate be equal across groups defined by a sensitive attribute (e.g., race, gender). It assesses independence between the prediction and the sensitive attribute.
- Formula: P(Ŷ=1 | A=a) = P(Ŷ=1 | A=b) for all groups a, b.
- Limitation: Can conflict with model accuracy if the base rates of outcomes differ naturally between groups.
- Use Case: Screening systems where equal selection rates are legally mandated, regardless of underlying qualification differences.
Equalized Odds
Equalized Odds is a stricter fairness criterion requiring that a model's true positive rate and false positive rate be equal across groups defined by a sensitive attribute. This ensures the model's errors are distributed equally.
- Formula: P(Ŷ=1 | A=a, Y=y) = P(Ŷ=1 | A=b, Y=y) for all groups a, b and for y ∈ {0,1}.
- Advantage: Compatible with perfect classifier if base rates are equal; aligns model's error profile across groups.
- Use Case: Criminal risk assessment tools, where both failing to detect risk (false negative) and over-predicting risk (false positive) must be balanced across demographics.
Equal Opportunity
Equal Opportunity is a relaxation of Equalized Odds, requiring only that the true positive rate (or recall) be equal across groups. It focuses on fairness for the advantaged outcome class (e.g., receiving a loan, being hired).
- Formula: P(Ŷ=1 | A=a, Y=1) = P(Ŷ=1 | A=b, Y=1) for all groups a, b.
- Interpretation: Ensures the model is equally good at identifying qualified candidates from each group.
- Use Case: Hiring algorithms, where the primary fairness concern is that qualified candidates from all groups have an equal chance of being selected.
Predictive Parity
Predictive Parity, also known as outcome test or calibration within groups, requires that the precision (positive predictive value) of a model be equal across groups. This means that among those who receive a positive prediction, the probability of actually belonging to the positive class is the same for all groups.
- Formula: P(Y=1 | A=a, Ŷ=1) = P(Y=1 | A=b, Ŷ=1) for all groups a, b.
- Context: Often discussed in fairness of risk assessment scores. A model can satisfy Predictive Parity but violate Equalized Odds.
- Use Case: Medical diagnostic tools, where the confidence in a positive prediction should be equally reliable across patient demographics.
Individual Fairness
Individual Fairness is a principle stating that similar individuals should receive similar model predictions. It contrasts with group fairness metrics by focusing on consistency at the individual level rather than statistical parity across groups.
- Core Tenet: Requires defining a meaningful similarity metric for individuals in the input space.
- Challenge: Formally defining and enforcing the similarity metric is often non-trivial and domain-specific.
- Use Case: Credit scoring, where two applicants with nearly identical financial profiles should receive similar credit scores, irrespective of their group membership.
Counterfactual Fairness
Counterfactual Fairness is a causal fairness notion. A model is counterfactually fair if, for any individual, the prediction remains the same in the actual world and in a counterfactual world where the individual's sensitive attribute (e.g., race) had been different.
- Foundation: Based on causal graphical models and the do-calculus to model interventions on sensitive attributes.
- Strength: Aims to remove the causal influence of the sensitive attribute on the prediction through non-discriminatory pathways.
- Use Case: Long-term loan pricing, where the goal is to ensure an applicant's quote is not influenced by race, even through correlated variables like zip code.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us