Skip to main content
Back

CFSA Beats Bias in ML Models Without Wrecking Accuracy 84% of the Time

A counterfactual debiasing framework ranks training examples by their contribution to unfairness, then rebalances and retrains to beat baselines in 84.6% of cases.

Pro

  • CFSA introduces a Counterfactual Bias List that ranks training examples by their measured contribution to model bias.
  • The method beats state-of-the-art fairness baselines in 84.6% of scenarios across 8 datasets and 10 tasks.
  • A weighted ensemble of a fairness model and an accuracy model performs best at 0.6/0.4 weighting.
  • Only 2% of runs produced lose-lose outcomes, versus 28% for Fair-SMOTE on the same Fairea benchmark.
  • Evaluated against REW, ADV, ROC, Fair-SMOTE, and MAAT using logistic regression, SVM, and random forest bases.
  • Published in AI and Ethics; targets tabular classification with defined sensitive attributes like race, gender, age.

Bias in machine learning software rarely comes from a single line of buggy code. It usually hides in the training data, and every attempt to scrub it out tends to bruise accuracy on the way. A new paper published in AI and Ethics takes a different route: instead of down-sampling groups at random or bolting a fairness constraint onto the loss, it ranks individual training examples by how much they poison the model, deletes the worst offenders, and blends a fairness-tuned model with an accuracy-tuned one at inference time.

The approach is called Counterfactual Fair Software Approach, or CFSA. Across the evaluation suite it outperforms state-of-the-art solutions in 84.6% of overall cases based on a recent benchmarking tool, while keeping accuracy within striking distance of the original biased models.

Why fairness bugs are so hard to squash

The core problem the authors target is a well-documented tradeoff: bias mitigation techniques usually pay for fairness with accuracy. Existing approaches either reweight examples, run adversarial training, or post-process predictions, but most of them treat every training example in a subgroup as equally problematic. That assumption breaks down quickly. Some rows in your dataset carry far more discriminatory signal than others, and undersampling them randomly is a blunt instrument.

The authors' central critique targets MAAT, the previous state-of-the-art ensemble method. Unlike existing methods that treat all training examples in a subgroup equally, their framework adopts the concept of counterfactual fairness of a training example to quantify its impact on the fairness of the model. In plain terms: figure out which specific rows would flip a prediction if you swapped the sensitive attribute, and prioritize those for removal.

Ranking bias, one row at a time

CFSA pipeline diagram

The pipeline hinges on a construct the authors call the Counterfactual Bias List (CBList). For every training instance, they build a counterfactual twin that differs only in the sensitive attribute (say, flipping gender from female to male) and run two tests:

  • Counterfactual Flip Test (CFTest): Does the predicted class label flip between the real instance and its counterfactual? A binary signal of bias.
  • Counterfactual Deviation Test (CDTest): How much does the predicted probability shift? This catches cases where the label doesn't flip but the confidence changes suspiciously.
  • Counterfactual Bias Test (CBTest): The combined score. If the label flipped, add both signals; otherwise just use the probability deviation.

Sort every training example by CBTest and you get a ranked hit list. The examples at the top are the ones the model would treat most differently if you changed their protected attribute, which makes them the highest-priority candidates for removal.

Rebalancing under the "We are all equal" worldview

Once the list exists, CFSA rebalances the data along a specific normative principle: the "We are all equal" worldview, which demands that the favored and deprived groups have equal probability of a positive outcome. The paper splits the training set into four subgroups (deprived-rejected, deprived-granted, favored-rejected, favored-granted) and undersamples the two overrepresented cells (favored-granted and deprived-rejected) using the CBList ranking rather than random selection.

For the other two cells, it corrects biased labels: instances whose counterfactual test scores exceed a threshold are removed, and the population is topped back up either by flipping labels of previously removed deprived-rejected samples or by synthesizing new points. CFSA is a data pre-processing framework that changes the training set by removing a subset of training instances and generating a limited amount of synthetic data to keep class balance.

The synthesis step is worth flagging. Standard oversamplers like SMOTE tend to worsen intra-class imbalance by generating points near cluster centers indiscriminately. CFSA clusters within each subgroup using k-nearest-neighbors, filters out the 20% of points farthest from cluster centers to preserve boundaries, and generates new samples proportionally so the synthesized distribution matches the original.

Two models are better than one

After debiasing, CFSA trains a fairness-oriented model on the cleaned data and a separate performance model on the original data, then ensembles them at inference time with a weighted average of their probability outputs. This is where the paper produces one of its more actionable findings.

CFSA weighting strategy effectiveness curve

The authors sweep the ensemble weights from pure-fairness to pure-performance in steps of 0.1 and find a sweet spot at 0.6 fairness weight, 0.4 performance weight, which beats the tradeoff baseline in roughly 84% of scenarios. Slightly favoring the fair model wins, but tipping too far toward pure fairness costs more than it gains.

How it stacks up on the benchmark

The evaluation is exhaustive: 10 benchmark tasks using a combination of 5 performance metrics, 3 fairness metrics, and 15 measurement scenarios, all applied to 8 real-world datasets. Datasets span finance (Adult, Bank, German, Default), criminal justice (COMPAS), social records (Dutch), medical (Heart), and education (Law School). Five baselines are pitted against CFSA:

  • REW, ADV, ROC from IBM's AIF360 fairness toolkit (reweighing, adversarial debiasing, reject-option classification)
  • Fair-SMOTE and MAAT, the two strongest baselines from software engineering venues

Every method is run with logistic regression, SVM, and random forest bases for 50 repetitions per task, yielding 9,000 mitigation cases. Fairness gets measured using the Fairea benchmarking tool, which categorizes each result as win-win, good, inverted, poor, or lose-lose depending on how it moves along the fairness-performance frontier.

Comparison of trade-off outcomes across bias mitigation methods

CFSA lands a good or win-win outcome in 85% of cases, versus 77% for MAAT, 76% for REW, 50% for ADV, 49% for ROC, and 44% for Fair-SMOTE. Its lose-lose rate sits at 2%, roughly 14 times lower than Fair-SMOTE's 28%. In head-to-head metric comparisons across 15 fairness-performance combinations, CFSA takes first place in 14 and second place in the remaining one.

What it is not

A few caveats matter before you drop this into production. CFSA is designed for tabular classification with clearly defined sensitive attributes; the authors flag text and image domains as future work. The counterfactual construction assumes you can meaningfully flip a single sensitive attribute while holding everything else constant, which is a strong assumption when the attribute is correlated with many other features. The evaluation is limited to standard classical models (LR, SVM, RF), so behavior on deep networks is untested. And accuracy still drops in about 22% of scenarios, which is better than the 25.7% seen with ROC but higher than REW's 10.5%.

The paper does not appear to release code publicly, though baselines are drawn from IBM's AIF360 and the released implementations of Fair-SMOTE and MAAT, which anyone reproducing the work would need to combine with the CBList logic described in the paper.

The takeaway

The real contribution is not another fairness constraint, it is a way to identify which training rows are actually causing the bias, ranked by counterfactual sensitivity. Combining that with a two-model ensemble at inference time turns out to move the fairness-accuracy frontier meaningfully, particularly on tasks like criminal recidivism prediction and income classification where the tradeoff has historically been painful. For anyone maintaining tabular models with regulated sensitive attributes, treating fairness as a data-quality problem instead of a training-objective problem is a shift worth studying.