Function Composition in Trustworthy Machine Learning: Implementation Choices, Insights, and Questions

Manish Nagireddy, Moninder Singh, Samuel C. Hoffman, Evaline Ju, Karthikeyan Natesan Ramamurthy, Kush R. VarshneyarXiv 2023 · DOI

Abstract

Trustworthy machine learning is often treated as a collection of independent "pillars"—such as fairness, explainability, and robustness—but in real-world applications, these functions must operate in concert. This paper introduces an extensible "composer tool" to chain these interventions into unified pipelines. Our findings reveal that stacking multiple trust-focused algorithms can lead to over-correction, degraded explanation quality, and unpredictable performance trade-offs.

Introduction

As machine learning (ML) systems are deployed in high-stakes domains like healthcare and criminal justice, developers are increasingly tasked with ensuring models are "trustworthy." This typically involves satisfying multiple requirements: models should be fair, decisions should be explainable, and systems should be robust against adversarial attacks.

Historically, research in these areas has occurred in silos. A developer might apply a fairness "pre-processor" to their data and a "post-processor" to their model's output without understanding how these functions interact. Does stacking fairness interventions make a model "twice as fair," or do they cancel each other out? Does fixing bias break the "faithfulness" of explanations? This research addresses this gap by empirically studying the composition of trust functions.

Methodology

The researchers developed a modular Composer Tool (configured via YAML) that allows users to string together different trust-related functions across the ML lifecycle. The study evaluated 9 different pipeline combinations across 6 model classes (including XGBoost and Random Forest) to observe how these chains affected standard performance metrics alongside fairness metrics (e.g., Disparate Impact) and explainability metrics (e.g., Faithfulness).

The interventions are categorized into four primary stages:

  1. Pre-processing: Modifying training data (e.g., Reweighing or Learning Fair Representations).
  2. In-processing: Modifying the training algorithm (e.g., Grid Search Reduction).
  3. Post-processing: Adjusting final predictions (e.g., Reject Option Classification).
  4. Explainability: Generating post-hoc insights (e.g., LIME).

Datasets

The study utilized 7 diverse, real-world datasets frequently used in fairness research: Adult Income, Bank Marketing, COMPAS Recidivism, German Credit, HMDA (over 1 million records), Mexico Poverty, and Zindi.

Key Insights

The empirical study revealed several critical phenomena regarding the composition of trust functions:

  • The Over-Correction Trap: If a model is already relatively fair after one intervention, adding a second often leads to over-correction. The model may flip from being biased against a minority group to being biased against the majority group, rather than achieving a perfect balance.
  • Fairness vs. Explanation Quality: There is a hidden cost to fairness. As more fairness interventions are added to a pipeline, the "faithfulness" of local explanations—how accurately an explanation describes the model's actual logic—tends to deteriorate.
  • Dataset Dependency: There is no "silver bullet" pipeline. A sequence of interventions that works perfectly for the COMPAS dataset might fail or provide diminishing returns on the Adult Income dataset.
  • Incompatibility of Methods: Some post-processing methods (like Calibrated Equalized Odds) have strict requirements for model calibration. When composed with certain in-processing steps, these requirements are often violated, causing the post-processor to fail entirely.

Results and Discussion

In many cases, a single pre-processing step (like Reweighing) provided the bulk of the fairness improvement. Adding in-processing or post-processing on top often yielded marginal gains at a high cost to accuracy. For example, on the Adult dataset, achieving a "fair" Disparate Impact ratio (>0.8) required multiple interventions but resulted in a significant drop in ROC AUC and accuracy compared to the baseline.

Fairness metric variations across different pipeline compositions for various datasets, highlighting the potential for over-correction and dataset-specific behavior.

Visualizing these shifts using LIME, the authors showed that fairness interventions physically shift feature importance. A "fair" model might be forced to ignore or invert the weight of a protected attribute (like race) to counter-balance inherent biases in the rest of the data.

Conclusion and Future Work

This study provides a foundational look at the interaction between fairness and explainability. Future work will expand the scope to include adversarial robustness, privacy transformations, and uncertainty quantification. The authors intend to open-source the composer tool as part of the AI Fairness 360 (AIF360) and AI Explainability 360 (AIX360) ecosystems, while also investigating automated optimization for function composition.

Summary updated

Abstract

Ensuring trustworthiness in machine learning (ML) models is a multi-dimensional task. In addition to the traditional notion of predictive performance, other notions such as privacy, fairness, robustness to distribution shift, adversarial robustness, interpretability, explainability, and uncertainty quantification are important considerations to evaluate and improve (if deficient). However, these sub-disciplines or 'pillars' of trustworthiness have largely developed independently, which has limited us from understanding their interactions in real-world ML pipelines. In this paper, focusing specifically on compositions of functions arising from the different pillars, we aim to reduce this gap, develop new insights for trustworthy ML, and answer questions such as the following. Does the composition of multiple fairness interventions result in a fairer model compared to a single intervention? How do bias mitigation algorithms for fairness affect local post-hoc explanations? Does a defense algorithm for untargeted adversarial attacks continue to be effective when composed with a privacy transformation? Toward this end, we report initial empirical results and new insights from 9 different compositions of functions (or pipelines) on 7 real-world datasets along two trustworthy dimensions - fairness and explainability. We also report progress, and implementation choices, on an extensible composer tool to encourage the combination of functionalities from multiple pillars. To-date, the tool supports bias mitigation algorithms for fairness and post-hoc explainability methods. We hope this line of work encourages the thoughtful consideration of multiple pillars when attempting to formulate and resolve a trustworthiness problem.
BibTeX
@misc{nagireddy2023function,
  author = {Manish Nagireddy and Moninder Singh and Samuel C. Hoffman and Evaline Ju and Karthikeyan Natesan Ramamurthy and Kush R. Varshney},
  title = {{Function Composition in Trustworthy Machine Learning: Implementation Choices, Insights, and Questions}},
  year = {2023},
  eprint = {2302.09190},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2302.09190},
}
Figure