Mental model
Fairness-Constrained Models
A method for building AI systems that are explicitly designed to minimize biased outcomes by balancing predictive accuracy with fairness goals.
Discover
An AI model approves loans with 95% accuracy but disproportionately rejects qualified applicants from a specific neighborhood. As the developer, which should you prioritize?
Choose your primary goal for the model.
Let's explore how developers handle this balancing act.
Understand
Understand
Fairness-constrained models are AI systems built with specific rules to prevent biased outcomes. Instead of only optimizing for accuracy, they are also forced to satisfy a mathematical definition of fairness, such as ensuring equal loan approval rates for similar applicants across different neighborhoods. This often involves a deliberate tradeoff, where a small amount of overall accuracy is exchanged for a significant reduction in harmful bias. For example, a resume-screening AI might be constrained to ensure its recommendations don't disproportionately favor candidates from a single gender, even if historical data suggests a skew.
Try this: When an automated system makes a decision, think about what fairness rule might be guiding it.
Full explanation
Full explanation
A fairness-constrained model works by changing the fundamental goal of the AI's training process. Standard models have one job: minimize errors. A fairness-constrained model has two jobs: minimize errors and satisfy a specific fairness rule.
The Process: Input → Constraint → Output
Input: The process starts with the usual data (e.g., historical hiring records, loan applications). Crucially, developers also provide a mathematical fairness constraint as a second input. This could be a rule like, "The percentage of men and women recommended for an interview must be within 5% of each other."
Process: During training, the AI learns patterns from the data. However, every potential decision it learns is checked against the fairness constraint. If a pattern leads to a biased outcome (violating the rule), the model is penalized, forcing it to find a different pattern that is both reasonably accurate and fair.
Output: The final model is a product of this compromise. For instance, in medical diagnostics, a standard AI might learn that a certain symptom is less indicative of a disease in women due to biased historical data. A fairness-constrained model would be forced to look past this historical bias and evaluate the symptom's importance more equitably, leading to a fairer, though potentially slightly different, set of predictions.
This same process applies to other domains like content moderation. An AI could be constrained to ensure that rules against hate speech are not disproportionately enforced on posts written in specific dialects, like African-American Vernacular English, thus reducing cultural bias.
Research
Research
Fairness constraints are typically implemented at one of three stages in the machine learning pipeline: pre-processing (modifying the input data), in-processing (modifying the learning algorithm), or post-processing (adjusting the model's outputs). In-processing methods are the most direct implementation, embedding fairness into the model's core logic.
- Hardt, Price, and Srebro (2016) developed a post-processing technique to achieve "equality of opportunity," which ensures that the true positive rate is equal across groups, by setting different decision thresholds for each group without retraining the model. [1]
- Zafar et al. (2017) introduced influential in-processing methods that add fairness constraints directly to the algorithm's optimization objective, forcing it to learn decision boundaries that prevent disparate impact from the outset. [2]
- Bellamy et al. (2018) created the AI Fairness 360 (AIF360) open-source toolkit, which provides developers with a suite of algorithms to detect and mitigate bias, including various pre-, in-, and post-processing methods. [3]
Limitations
Limitations
The concept of a "fairness-accuracy tradeoff" is not universal; improving fairness can sometimes uncover and correct biases that were also sources of inaccuracy. The most significant challenge is that choosing a fairness metric is an ethical, not a technical, decision. Mathematical definitions of fairness, like demographic parity (equal outcomes) and equalized odds (equal error rates), are often mutually exclusive, meaning a model cannot satisfy all of them simultaneously. Furthermore, optimizing fairness for one set of groups (e.g., by race) can inadvertently increase bias for another (e.g., by gender), a phenomenon known as fairness gerrymandering.
Try it
Synthesize
Choose a pattern from the guide, then pick an action to try with it.
Which pattern stands out?
What will you try?
Choose a pattern above to select an action.
Sources
Sources
- [1] Equality of Opportunity in Supervised LearningMoritz Hardt, Eric Price, & Nati Srebro - 2016
- [2] Fairness Beyond Disparate Treatment & Disparate Impact: Learning Classification without Disparate MistreatmentMuhammad Bilal Zafar, Isabel Valera, Manuel Gomez Rodriguez, & Krishna P. Gummadi - 2017
- [3] AI Fairness 360: An Extensible Toolkit for Detecting, Understanding, and Mitigating Unwanted Algorithmic BiasRachel K. E. Bellamy et al. - 2018
- [4] Fairness and Machine Learning: Limitations and OpportunitiesSolon Barocas, Moritz Hardt, & Arvind Narayanan - 2019
- [5] Attacking discrimination with smarter machine learningGoogle - 2018
Try it
Check your understanding
A company wants to build a fairness-constrained model for promoting employees. Besides performance data, what is the most crucial *additional* input they need?
Show the guide's explanation
Answer: A clear, mathematical definition of fairness
The core of the process requires a specific goal. The model cannot optimize for fairness without being told exactly what 'fair' means in measurable terms, such as ensuring promotion rates are similar across different demographic groups.
A developer applies a fairness constraint to a loan approval AI, which reduces its overall accuracy by 1%. Why would the bank likely decide to use this constrained model?
Show the guide's explanation
Answer: To comply with anti-discrimination laws and reduce reputational risk
This addresses the core tradeoff. The small sacrifice in accuracy is often a necessary price to align the model's behavior with crucial legal and ethical standards, preventing costly lawsuits and public backlash.
What is the key *process* difference when training a fairness-constrained model compared to a standard model?
Show the guide's explanation
Answer: It optimizes for both accuracy and a fairness metric at the same time.
This describes the fundamental change in the 'in-processing' approach. The model's training objective is modified to include a fairness goal, forcing it to find a solution that balances the two, often competing, objectives.
Keep exploring
Find another idea for the decision in front of you.
The complete Reframo library is free to read. Explore another guide whenever you are ready.