Search This Blog

Bias and fairness analysis (Machine systems)

 

Here is a list of 100 command prompts for performing a comprehensive bias and fairness analysis on a machine learning system.

1. Scoping & Problem Formulation

  1. Define the fairness goals (e.g., equality, equity, non-discrimination) for this project.

  2. Identify all legally protected sensitive attributes (e.g., race, gender, age, disability).

  3. Identify any additional context-specific sensitive attributes (e.g., income level, zip code).

  4. Define the "favorable" and "unfavorable" outcomes of the model (e.g., "loan approved" vs. "loan denied").

  5. Formulate hypotheses about potential sources of bias in the data and model.

  6. Establish a "bias and fairness" review board or internal stakeholder group.

  7. Audit the problem formulation itself for inherent bias (e.g., "predicting criminality").

  8. Define "harm" in the context of this application (e.g., allocative vs. representational harm).

  9. Select the primary fairness metric(s) to optimize for (e.g., Demographic Parity, Equalized Odds).

  10. Document the societal, historical, and legal context of the problem the model is solving.

2. Data Collection & Auditing

  1. Analyze the demographic representation of each sensitive attribute in the dataset.

  2. Compare dataset demographics to real-world "ground truth" population data.

  3. Analyze missing data patterns (NaNs) across all defined subgroups.

  4. Audit data labels for historical bias (e.g., are "performance" ratings skewed by gender?).

  5. Test for selection bias in the data collection methodology.

  6. Test for measurement bias (e.g., is "risk" measured differently for different groups?).

  7. Calculate the class imbalance of the target variable *within* each subgroup.

  8. Visualize the distribution of a key feature (e.g., 'income') for each subgroup.

  9. Perform a keyword audit on all text data for biased associations (e.g., "doctor" -> "he").

  10. Audit image datasets for stereotypical representations or under-representation.

  11. Identify all potential proxy variables for the sensitive attributes (e.g., zip code as a proxy for race).

  12. Quantify the historical bias in the target variable itself (e.g., past loan decisions).

  13. Sample and manually review [N] data points from each subgroup to identify annotation bias.

  14. Document the data's full provenance and its known limitations.

  15. Test for temporal bias by comparing data collected at different time periods.

  16. Analyze outliers to see if they disproportionately belong to a specific subgroup.

  17. Check for label quality disparities between groups.

3. Data Preprocessing & Feature Engineering

  1. Test the fairness impact of the chosen imputation method (e.g., mean imputation) for missing data.

  2. Analyze if feature scaling (e.g., standardization) affects group-specific distributions differently.

  3. Evaluate if feature selection methods (e.g., RFE) disproportionately remove features important for a minority group.

  4. Analyze the impact of text cleaning (e.g., stopword removal) on text from different dialects (e.g., AAVE).

  5. Test the impact of removing sensitive attributes on both model performance and fairness.

  6. Test the impact of removing known proxy variables on both model performance and fairness.

  7. Analyze word embeddings (e.g., Word2Vec) for biased analogies (e.g., man:doctor::woman:nurse).

  8. Debias word embeddings using a post-processing algorithm (e.g., Hard-Debias, LIN).

  9. Analyze the fairness impact of outlier removal on subgroup representation.

  10. Test synthetic data (e.g., SMOTE) to see if it amplifies or mitigates bias.

  11. Analyze the binning strategy for continuous variables (e.g., 'age') to ensure fair groupings.

  12. Create a "data-bias" report *before* model training begins.

4. Model Training & Evaluation (Group Fairness)

  1. Establish a "bias baseline" using a simple, interpretable model (e.g., Logistic Regression).

  2. Calculate Demographic Parity (Statistical Parity) to compare selection rates across groups.

  3. Calculate Equalized Odds to compare True Positive Rates (TPR) and False Positive Rates (FPR) across groups.

  4. Calculate Equal Opportunity to compare True Positive Rates (TPR) across groups.

  5. Calculate Conditional Use Accuracy (e.g., Predictive Parity) to compare Positive Predictive Value (PPV) across groups.

  6. Compare the False Negative Rates (FNR) for each subgroup.

  7. Compare the False Positive Rates (FPR) for each subgroup.

  8. Generate and analyze the model's confusion matrix for *each subgroup* side-by-side.

  9. Plot the Receiver Operating Characteristic (ROC) curve for each subgroup on the same graph.

  10. Plot calibration curves for each subgroup to check for miscalibration.

  11. Test for "fairness gerrymandering" by evaluating on different data subsets.

  12. Compare the bias-fairness trade-off of different model architectures (e.g., Tree vs. NN).

  13. Audit the model's objective function (loss function) for any implicit bias.

  14. Evaluate model performance and fairness on "edge cases" from minority groups.

  15. Analyze the model for disparate impact using the "80% rule" (four-fifths rule).

  16. Test for representation bias in generative models (e.g., "a picture of a CEO").

  17. Analyze the language of LLM outputs for biased statements or stereotypes.

  18. Test the model's robustness to perturbations in sensitive attributes (e.g., change "Mrs." to "Mr.").

5. Intersectional & Individual Fairness

  1. Calculate all fairness metrics for intersectional groups (e.g., "Black women," "Asian men").

  2. Identify which intersectional group has the worst-case performance.

  3. Test for individual fairness: "Treat similar individuals similarly."

  4. Develop and run counterfactual fairness checks (e.g., "What if this person's gender was different, holding all else equal?").

  5. Calculate individual fairness metrics (e.g., "consistency") to ensure similar inputs get similar outputs.

  6. Manually review the model's highest-confidence errors (false positives/negatives) for each subgroup.

  7. Analyze the range and distribution of the model's output "scores" (e.g., 'risk_score') across groups.

6. Model Interpretation & Explainability (XAI)

  1. Generate local explanations (e.g., LIME, SHAP) for predictions for individuals in each subgroup.

  2. Analyze the explanations: Are they equally coherent or stable across groups?

  3. Generate global feature importance (e.g., SHAP summary plot) for each subgroup's model.

  4. Identify if the model relies on different features for different groups (e.g., 'income' for men, 'job_title' for women).

  5. Identify which features are the largest contributors to biased predictions.

  6. Use explanations to audit the model for reliance on proxy variables.

  7. Check if the model's "confidence" in its predictions is systematically higher for one group.

  8. Analyze error patterns: Is the model failing in *different ways* for different groups?

7. Mitigation Strategies

  1. Apply a **pre-processing** mitigation technique (e.g., Reweighing, Disparate Impact Remover).

  2. Apply an **in-processing** mitigation technique (e.g., Adversarial Debiasing, Regularization).

  3. Apply a **post-processing** mitigation technique (e.g., Calibrated Equalized Odds, Reject Option Classification).

  4. Implement group-specific prediction thresholds to equalize odds.

  5. Evaluate the model's fairness on a hold-out "fairness" test set (not used for training or tuning).

  6. Re-train the model on a dataset augmented to correct for representation bias.

  7. Compare the performance and fairness of the mitigated model against the original baseline.

  8. Document the trade-offs (e.g., loss in overall accuracy) introduced by the mitigation technique.

  9. Test the model for "re-biasing" (i.e., fixing bias for one group but worsening it for another).

  10. Analyze the long-term impact of deploying a "fair" model (e.g., "feedback loops").

8. Deployment & Monitoring

  1. Develop and publish a "bias impact statement" or "model card" before deployment.

  2. Implement a "human-in-the-loop" (HITL) review process for high-stakes, low-confidence predictions.

  3. Define and document the "red-line" for unacceptable bias or performance disparity.

  4. Roll out the model using a canary release to monitor initial bias in a live environment.

  5. Create an "Algorithmic Bias" dashboard for internal stakeholders to monitor key metrics.

  6. Implement a continuous monitoring system to track fairness metrics in real-time.

  7. Set up automated alerts for "fairness metric" drift or sudden changes.

  8. Monitor the model for performance and fairness decay across all subgroups over time.

  9. Establish a clear feedback channel for end-users to report perceived biased outcomes.

  10. Schedule a regular (e.g., quarterly) "bias audit" of the live model by an independent team.

  11. Analyze the model's performance on new, out-of-distribution data from all subgroups.

  12. Create a plan for rapid model disabling ("kill switch") if severe bias is detected.

  13. Test the model for fairness in simulated, adversarial scenarios.

  14. Ensure the "right to explanation" can be fulfilled for individuals in all groups.

  15. Compare model-driven decisions against a "human-only" baseline for bias.

  16. Audit the user interface (UI) that presents the model's output for priming or bias.

  17. Ensure all bias-related findings and mitigations are version-controlled with the model.

  18. Plan and budget for the computational and human cost of continuous bias monitoring and re-mitigation.

No comments:

Post a Comment

Agents

  Build me an agent that finds news from WVMR (West Virginia Mountain Radio in Pocahontas County, West Virginia and rewrites as a news st...

Shaker Posts