Fairness Invariants: A Relational Approach to Explaining and Mitigating Fairness Bugs
Ranit Debnath Akash, Ashish Kumar, Gang Tan, Saeid Tizpaz-Niari
Abstract
Data-driven software systems are increasingly deployed in high-stakes socio-economic domains, from criminal justice to financial lending. However, these systems often exhibit individual discrimination-unjustified disparities in which a program yields different outcomes for similar individuals who differ only in their protected attributes (e.g., race, gender, age). While existing research has focused on detecting and quantifying these bugs, there remains a critical lack of principled mechanisms to explain and localize individual fairness bugs. Current explanation techniques are largely designed for single-input decisions rather than the relational nature of discrimination, which inherently involves a comparison between an original and a counterfactual pair.
We present Remi, a framework for the automated localization, explanation, and mitigation of individual discrimination. Inspired by loop-invariant synthesis in formal methods, we treat counterfactual fairness as a relational invariant discovery problem. We introduce a bidirectional relational explanation framework that learns over paired examples (𝑥, 𝑥 ′ ) to identify regions of the input space where fairness is violated. Unlike traditional one-way implication pairs used in invariant inference, our approach enforces bidirectional constraints: requiring identical outcomes for both original and counterfactual samples. Remi utilizes three data-alignment techniques to infer interpretable rule-based models that act as "fairness invariants." These rules serve as guardrails to selectively block or relabel unfair predictions without requiring model retraining. Our evaluation on symbolic and neural network programs demonstrates that Remi localizes ground-truth fairness bugs in over 83% of cases, significantly outperforming state-of-the-art baselines and reducing discriminatory decisions in black-box models by up to 70%.
CCS Concepts: • Software and its engineering → Software testing and debugging; • Computing methodologies → Machine learning; Rule learning.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 5db6bfde-fda9-4907-806f-933cf5b48dc9Builds on28
- Bias in machine learning software: why? how? what to do?Joymallya Chakraborty, Suvodeep Majumder, Tim MenziesFSE 2021 · 186 citations
- Fairway: a way to build fair ML softwareJoymallya Chakraborty, Suvodeep Majumder, Zhe Yu, Tim MenziesFSE 2020 · 131 citations
- White-box fairness testing through adversarial samplingPeixin Zhang, Jingyi Wang, Jun Sun, Guoliang Dong et al.ICSE 2020 · 127 citations
- Causality-Based Neural Network RepairBing Sun, Jun Sun, Long H. Pham, Tie ShiICSE 2022 · 69 citations
- "Ignorance and Prejudice" in Software FairnessJie M. Zhang, Mark HarmanICSE 2021 · 69 citations
Related papers
- Uncovering Discrimination Clusters: Quantifying and Explaining Systematic Fairness ViolationsRanit Debnath Akash, Ashish Kumar, Verya Monjezi, Ashutosh Trivedi et al.ASE 2025
- Efficient white-box fairness testing through gradient searchLingfeng Zhang, Yueling Zhang, Min ZhangISSTA 2021 · 51 citations
- Information-Theoretic Testing and Debugging of Fairness Defects in Deep Neural NetworksVerya Monjezi, Ashutosh Trivedi, Gang Tan, Saeid Tizpaz-NiariICSE 2023 · 47 citations
- Fairness Testing Through Extreme Value TheoryVerya Monjezi, Ashutosh Trivedi, Vladik Kreinovich, Saeid Tizpaz-NiariICSE 2025 · 4 citations
- Latent Imitator: Generating Natural Individual Discriminatory Instances for Black-Box Fairness TestingYisong Xiao, Aishan Liu, Tianlin Li, Xianglong LiuISSTA 2023 · 31 citations
