Justicia: A Stochastic SAT Approach to Formally Verify Fairness

Bishwamittra Ghosh, Debabrota Basu, Kuldeep S. Meel

Abstract

As machine learning (ML) models are increasingly deployed in high-stakes societal domains, ensuring their fairness has become a critical technical requirement. However, existing fairness verification tools often lack robustness or fail to scale to complex, multi-attribute scenarios. We present Justicia, a novel formal verification framework that leverages Stochastic Boolean Satisfiability (SSAT) to mathematically prove model fairness against underlying data distributions. Justicia significantly outperforms state-of-the-art distributional verifiers in both speed and accuracy, while uniquely handling compound sensitive attributes.

Introduction

The transition of ML into domains like hiring, insurance, and criminal justice necessitates rigorous fairness guarantees. Traditional sample-based verification methods, which test models on specific datasets, are often brittle; their results can vary wildly depending on the choice of test set. Conversely, distribution-based verifiers offer more robust guarantees by checking fairness against the generative distribution of the data. However, these tools frequently struggle with scalability and the "curse of dimensionality" when dealing with intersectional fairness (e.g., race and gender combined).

Justicia addresses these challenges by framing fairness verification as a logic problem. By reducing fairness metrics to SSAT, Justicia provides a mathematically rigorous way to calculate disparate impact and other metrics with high efficiency.

The Justicia Framework

The core of Justicia is the translation of fairness verification into the language of Stochastic Boolean Satisfiability. Unlike standard SAT, which seeks a single satisfying assignment, SSAT incorporates randomized variables (representing data distributions) and existential/universal quantifiers (representing the search for favored or disfavored groups).

Figure 1: The Justicia pipeline involves modeling the data distribution (left/middle) and the classifier (right) to compute fairness metrics via SSAT.

As shown in Figure 1, the framework operates on a model of the world where sensitive attributes (like age) influence features (like fitness and income), which in turn drive the model's prediction ($\hat{Y}$). Justicia encodes both the distribution (often represented as a Bayesian network) and the classifier (e.g., a decision tree) into Conjunctive Normal Form (CNF).

The authors propose two primary algorithms:

  1. Justicia_enum: An exhaustive approach that calculates metrics for all possible subgroups.
  2. Justicia_learn: A more advanced algorithm using Exist-Random SSAT (ER-SSAT) to directly identify the most and least favored groups. This allows Justicia to handle "compound" attributes where the number of subgroups grows exponentially.

Experimental Evaluation

Justicia was evaluated on standard fairness benchmarks, including UCI Adult, COMPAS, German Credit, and a custom synthetic dataset designed for ground-truth comparison.

Key Results

  • Scalability and Speed: Justicia is 1 to 3 orders of magnitude faster than existing distributional verifiers like FairSquare and VeriFair. In many instances where competitors timed out after 900 seconds, Justicia provided results in under a second.
  • Accuracy: On synthetic benchmarks, Justicia achieved less than 1% error relative to the analytical ground truth, whereas competing tools often missed significant fairness violations.
  • Intersectionality: Justicia successfully analyzed datasets with up to 40 compound protected groups. It revealed that discrimination often intensifies at the intersection of multiple attributes—a phenomenon that single-attribute checks fail to capture.
  • Stability: By verifying against distributions rather than samples, Justicia's estimates are 10x to 100x more stable than sample-based tools like AIF360.

Discussion and Future Work

Justicia represents a significant leap in formal fairness verification. By utilizing the duality of SSAT, the framework can efficiently find the "least favored" group by negating the classifier logic and searching for the "most favored" group for the negative outcome.

However, limitations remain. The current framework is optimized for models easily translatable to CNF, such as decision trees and linear classifiers. Extending this to Deep Neural Networks (DNNs) and Support Vector Machines (SVMs) is a key area for future research. Additionally, while discretization is currently used for continuous variables, future SSAT solvers capable of handling continuous distributions natively could further enhance precision.

Conclusion

Justicia provides a robust, scalable, and mathematically grounded framework for ensuring ML fairness. By bridging the gap between formal logic and social requirements, it offers a path toward more accountable and transparent automated decision-making systems.

Summary updated

BibTeX
@inproceedings{ghosh2021justicia,
  author = {Bishwamittra Ghosh and Debabrota Basu and Kuldeep S. Meel},
  title = {{Justicia: A Stochastic SAT Approach to Formally Verify Fairness}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2021},
  doi = {10.1609/aaai.v35i9.16925},
}
Figure