Source-linked AI summary

Software Engineering for Fairness: A Case Study with Hyperparameter Optimization

Joymallya Chakraborty, Tianpei Xia, Fahmid M. Fahid, Tim Menzies

arXiv:1905.05786v2cs.SEcs.LG

TL;DR

Machine-learning models can produce biased decisions in high-stakes settings, and prior software-engineering work has focused on detecting unfairness. This paper uses fairness-aware hyperparameter optimization to pursue fairer results while preserving predictive performance, though the reported outcomes vary by dataset.

  • Problem

    Machine-learning systems can produce biased decisions, while prior software-engineering work described here focuses on detecting unfairness rather than mitigating it.

    Source: §I · p. 1
  • Method

    The paper applies FLASH-based hyperparameter optimization to jointly pursue learner performance and fairness.

    Source: §I · p. 1, B. FLASH: A Fast Sequential… · p. 2
  • Results

    Multiobjective tuning improved three objectives on German data without reducing recall and improved three objectives on Adult data with minor recall damage, while Compas showed no improvement.

    Source: B. RQ2: Can we optimize machine… · p. 3
  • Takeaways & Limitations

    The authors conclude that fairness testing and mitigation should be included in the software life cycle, including before agile releases.

    Source: §VI · p. 4

    The evaluation covers logistic regression and CART with three small datasets that may not represent other real-world scenarios.

    Source: §VI · p. 4

Abstract

from arXiv · show

We assert that it is the ethical duty of software engineers to strive to reduce software discrimination. This paper discusses how that might be done. This is an important topic since machine learning software is increasingly being used to make decisions that affect people's lives. Potentially, the application of that software will result in fairer decisions because (unlike humans) machine learning software is not biased. However, recent results show that the software within many data mining packages exhibits "group discrimination"; i.e. their decisions are inappropriately affected by "protected attributes"(e.g., race, gender, age, etc.). There has been much prior work on validating the fairness of machine-learning models (by recognizing when such software discrimination exists). But after detection, comes mitigation. What steps can ethical software engineers take to reduce discrimination in the software they produce? This paper shows that making \textit{fairness} as a goal during hyperparameter optimization can (a) preserve the predictive power of a model learned from a data miner while also (b) generates fairer results. To the best of our knowledge, this is the first application of hyperparameter optimization as a tool for software engineers to generate fairer software.

I. INTRODUCTION

Machine-learning decisions affect high-stakes areas, yet models can produce biased outcomes. The paper moves from detecting unfairness to mitigating it by making fairness an optimization goal alongside predictive performance.

I. INTRODUCTION

  • Examples of biased decisions span sentiment analysis, facial recognition, photo tagging, recidivism assessment, and automated hiring.These cases include higher error rates for dark-skinned women and a nearly twofold rate of false criminal labels for Black defendants versus white defendants.Source: §I · p. 1
  • Earlier software-engineering research focused on detecting unfairness, while this work asks how to mitigate it.The authors propose fairness testing before application and optimization when bias is found.Source: §I · p. 1
  • The study applies hyperparameter optimization to pursue fairness without losing predictive power, framing the task as multiobjective optimization.Hyperparameters control learner behavior and affect model performance.Source: §I · p. 1

II. BUT IS THIS A PROBLEM FOR SOFTWARE ENGINEERS?

The authors argue that software engineers have a role in addressing fairness because users may expect them to fix software problems. They also contend that hyperparameter-optimization tools developed in software engineering can be applied to mitigating unfairness.

II. BUT IS THIS A PROBLEM FOR SOFTWARE ENGINEERS?

  • The authors argue developers should ensure software conforms to required ethical standards.They present this as a goal for software developers.Source: §II · p. 2
  • When users discover software problems, the authors say fixing them is the maintainer’s job, even if engineers do not view fairness as their responsibility.They connect this responsibility to users’ potentially different expectations.Source: §II · p. 2
  • Hyperparameter-optimization tools matured in software engineering can be applied to problems such as mitigating unfair software.The paper identifies this application as a way engineers can contribute to the problem.Source: §II · p. 2

III. TERMINOLOGY

The paper studies group fairness, defining it in relation to similar treatment across privileged and unprivileged groups. It uses absolute Equal Opportunity Difference and Average Odds Difference as fairness metrics.

III. TERMINOLOGY

  • Group fairness means privileged and unprivileged groups should be treated similarly with respect to a protected attribute.Protected attributes divide a population into groups with different benefits and are application-specific; this study addresses group, not individual, fairness.Source: §III · p. 2
  • Equal Opportunity Difference measures the difference in true positive rates between unprivileged and privileged groups.The study uses the absolute value of this metric.Source: §III · p. 2
  • Average Odds Difference averages the differences in false positive and true positive rates between privileged and unprivileged groups.The study uses its absolute value; zero indicates equal benefit, while the sign indicates which group has higher benefit.Source: §III · p. 2

IV. METHODOLOGY

The methodology situates fairness optimization within hyperparameter search and describes common search strategies. The authors identify their study as the first application of hyperparameter optimization to software fairness.

IV. METHODOLOGY

  • Hyperparameter optimization searches learner settings, and the paper introduces grid search, random search, Bayesian optimization, and SMBO as common approaches.Grid search tries combinations; random search samples combinations without using prior-step information; Bayesian optimization uses past evaluations to guide the next search, and SMBO formalizes sequential Bayesian optimization.Source: A. Hyperparameter Optimization · p. 2
  • The study describes its datasets by number of rows, features, favorable outcome, and recidivism indicator.Table I is identified as the dataset description table.Source: Table I · p. 2
  • The authors describe this as the first application of hyperparameter optimization in the software-fairness domain.They contrast it with prior software-engineering applications such as effort estimation and defect prediction.Source: A. Hyperparameter Optimization · p. 2

B. FLASH: A Fast Sequential Model-Based Method

FLASH is a fast sequential model-based optimization method for multiple objectives. This study applies it to learner performance and fairness together.

B. FLASH: A Fast Sequential Model-Based Method

  • FLASH is a fast SMBO approach for multiobjective optimization.This is the first study to use FLASH to optimize learner performance while also improving fairness.Source: B. FLASH: A Fast Sequential… · p. 2
  • FLASH’s acquisition function selects configurations with the highest expected performance measure.It uses Maximum Mean and a separate CART model for each objective.Source: B. FLASH: A Fast Sequential… · p. 2
  • The study applies FLASH to learner performance and fairness together.The passage identifies this as the first study to try that combination.Source: B. FLASH: A Fast Sequential… · p. 2

A. RQ1: Does optimizing for fairness damage model prediction performance ?

The study compares FLASH with four prior algorithms for mitigating discrimination. Its results indicate that fairness-focused mitigation can damage prediction performance.

A. RQ1: Does optimizing for fairness damage model prediction performance?

  • The experiments use logistic regression with training, validation, and test splits of 70%, 15%, and 15%.The authors selected logistic regression because prior researchers had used it with these datasets.Source: A. RQ1: Does optimizing for fairness… · p. 3
  • Pre-processing methods reduce discrimination by changing the data before classification.Reweighing assigns different weights to group-label combinations; optimized pre-processing learns a probabilistic transformation of labels and features.Source: A. RQ1: Does optimizing for fairness… · p. 3
  • In-processing methods optimize a model using training and validation data before applying it to test data.The paper places FLASH in this category and describes adversarial debiasing as jointly maximizing accuracy and limiting an adversary’s ability to infer protected attributes.Source: A. RQ1: Does optimizing for fairness… · p. 3
  • Post-processing changes class labels after classification to reduce discrimination.Reject option classification changes outcomes for privileged and unprivileged groups within a confidence band around the uncertain decision boundary.Source: A. RQ1: Does optimizing for fairness… · p. 3
  • Fairness mitigation produced several cases of damaged performance in the comparison of FLASH with four prior algorithms.The authors conclude that fairness can have a cost and then ask whether multiobjective optimization can improve the trade-off.Source: A. RQ1: Does optimizing for fairness… · p. 3

B. RQ2: Can we optimize machine learning model for both fairness and performance?

The study tunes models against performance and fairness objectives together. Results vary by dataset: two show improvements on three objectives, while Compas shows none.

B. RQ2: Can we optimize machine learning model for both fairness and performance?

  • The optimization considers recall and false alarm for performance, and AOD and EOD for fairness.Higher recall is preferred; smaller values are preferred for the other objectives. The study uses logistic regression and CART.Source: B. RQ2: Can we optimize machine… · p. 3
  • Table II compares recall and false-alarm changes before and after bias mitigation, marking improvement in gray and damage in black.The table is described as optimizing just for fairness.Source: Table II · p. 3
  • The study optimizes four hyperparameters for each learner: C, penalty, solver, and max_iter for logistic regression, and criterion, splitter, and min_split for CART.The supplied passage truncates the final CART parameter name after “min”.Source: B. RQ2: Can we optimize machine… · p. 3
  • German improved three objectives without lowering recall, while Adult improved three objectives with minor recall damage; Compas showed no improvement.The reported objectives include performance and fairness measures.Source: B. RQ2: Can we optimize machine… · p. 3
  • Multiobjective optimization can achieve one learning goal without damaging the other when it accounts for both fairness and performance.The authors present this as the conclusion indicated by their results.Source: B. RQ2: Can we optimize machine… · p. 3

C. RQ3. How much time does optimization take?

Hyperparameter optimization adds seconds to the reported runs, which the authors regard as a modest cost for fairness. Whether the approach scales to larger, more complex fairness problems remains for future research.

C. RQ3. How much time does optimization take?

  • Tuned training, tuning, and testing took 16.33s on Adult, 4.34s on Compas, and 3.55s on German, versus default logistic regression times of 0.56s, 0.15s, and 0.11s, respectively.The authors call runtimes under 20 seconds a relatively small price to pay for fairness.Source: C. RQ3. How much time does… · p. 3
  • Whether FLASH’s scaling can handle fairness in larger, more complex software-engineering data remains future research.The authors say it remains to be seen whether that scale is possible or needed.Source: C. RQ3. How much time does… · p. 3
  • Table III optimizes for fairness, lower false alarm, and higher recall, and its caption reports far less damage than Table II.Gray denotes improvement and black denotes damage.Source: Table III · p. 4

VI. CONCLUSION & FUTURE WORK

Experiments suggest fairness may be improved without compromising predictive performance, and the authors recommend fairness testing and mitigation before release. Their evidence is limited to logistic regression and CART on three small datasets that may not represent other real-world scenarios.

  • Experiments suggest software fairness may be improved without compromising predictive performance.Source: §VI · p. 4
  • Before release, the authors recommend fairness testing and mitigation as part of the software life cycle.Source: §VI · p. 4
  • The study is limited to logistic regression and CART, using three small datasets that may not represent other real-world scenarios.Source: §VI · p. 4
  • Companies should consider making useful data available, while domain knowledge remains important for judging protected attributes, including whether to train without them.Source: §VI · p. 4
Loading 1905.05786v2…