HyFair: Hybrid Fairness Verification
- HyFair is a hybrid framework that quantifies, certifies, and explains systematic fairness violations by detecting discrimination clusters beyond simple pairwise biases.
- It integrates formal verification methods (SMT/MILP) with scalable randomized search to uncover high-discrimination clusters in high-dimensional deep neural networks.
- The approach also employs decision-tree rule extraction to generate interpretable explanations and guide targeted mitigation, ensuring robust fairness analysis.
HyFair is a hybrid verification and search framework for quantifying, certifying, and explaining systematic algorithmic fairness violations, specifically those exhibiting "discrimination clustering" rather than isolated pairwise unfairness. It combines formal symbolic methods for counterfactual fairness certification with scalable random search for discrimination cluster detection, supporting robust, interpretable explanations and targeted mitigation in high-dimensional deep neural networks. HyFair extends standard fairness analysis by identifying local regions of the input space where small counterfactual perturbations of protected features yield multiple “clusters” of distinct model outcomes, thus exposing arbitrary and potentially severe unfairness not detected by pairwise comparisons (Akash et al., 29 Dec 2025).
1. Formalization: Individual Fairness and k-Discrimination
Traditional formalizations of algorithmic fairness focus on individual counterfactual fairness. Let denote the domain of non-protected features, the (finite) protected feature domain (), and a fixed classifier (typically a DNN).
Individual fairness (2-fairness): is 2-fair iff for all and all ,
for a small threshold (e.g., $0.05$), with a norm (e.g., ).
Discrimination clustering generalizes to -discrimination: given all protected variants , form output clusters such that
where counts the number of -separated output clusters. If , resides in a discrimination cluster, indicating systematic unfairness across protected group combinations not captured in traditional pairwise checks.
2. Hybrid Verification and Search: SMT/MILP plus Randomized Exploration
HyFair leverages two algorithmic paradigms:
- Symbolic formal verification (SMT or MILP): To certify global 2-fairness (absence of pairwise violations) or to extract concrete counterexamples ("seeds"), HyFair encodes two network copies with same non-protected inputs and distinct protected attributes. SMT instances (e.g., Z3) assert
and report UNSAT if no violation exists, proving 2-fairness. MILP encodings linearize all ReLU/Max operators with binary neuron indicators; the resulting optimization
either certifies or extracts maximally unfair pairs.
- Randomized local search: For -discrimination, HyFair applies search algorithms (random walk, simulated annealing, k-nearest augmentations) to maximize around seed counterexamples, empirically climbing toward high-discrimination clusters. The per-iteration step proposes candidate neighbors and uses a Metropolis rule to accept higher- (or sometimes lower- to escape local maxima). This sidesteps the exponential complexity of multi-copy formal encodings.
Guarantees:
- UNSAT on 2-fairness encoding certifies full absence of pairwise unfairness over , and thus -fairness for all .
- Randomized search uncovers worst-case clusters () with high probability near seeds; however, global optimality is not guaranteed for general due to NP-hardness.
3. Explanation Generation: Decision-Tree Rule Extraction
HyFair produces succinct, symbolic explanations describing regions of the input space where discrimination clustering occurs. Given a seed set of points exhibiting high -discrimination, HyFair perturbs non-protected variables locally, labels each with their -value (above/below a threshold), and fits decision trees (e.g., via Gini impurity criteria).
Each leaf labeled "high-" yields a predicate , a conjunction of feature splits tracing its path. Robustness is verified by measuring the drop in mean when sampling inputs outside : Predicates act as interpretable hyper-rectangles (e.g., : hours and marital_statusMarried-spouse). Rules are selected for high coverage, minimal size (number of conjuncts), and robustness (large ).
4. Theoretical Properties and Computational Complexity
Symbolic (MILP/SMT) certification of 2-fairness leverages the completeness and soundness of the network's operator linearization. However, complexity is:
- NP-complete for MILP/SMT over network activations—each neuron introduces combinatorial case splits.
- Exponential blow-up for discrimination: requires network copies and explicit clustering logic; infeasible for large or deep networks.
- Empirical search (simulated annealing/random walk) finds large in practice but lacks formal global optimality guarantees for .
5. Experimental Results
HyFair was evaluated on 20 pre-trained ReLU DNNs (3–11 layers, 10–318 neurons) covering Adult Census Income and Bank Marketing benchmarks. Protected attributes included race and gender; non-protected variables were income, education, etc.
- Certification (FAIRIFY vs HyFair-MILP): HyFair identified more individual discrimination instances in 17/20 models, and was up to 10× faster at first detection in 18/20 cases. Maximum observed (cluster size) was 15–20 for HyFair versus 5–12 for FAIRIFY.
- Random Search (RW vs SA vs SA+KNN): Simulated annealing delivered highest in 94% of cases, faster detection in 72%, and greater diversity of high- examples in 56%. k-NN improved average on large datasets.
- Explanation Generation (LIME vs HyFair): HyFair produced decision-tree rules with 20–50% fewer conjuncts, 2–10× higher input-space coverage, and ≥2× increase in robustness compared to LIME in 78% of models.
- Mitigation by Guardrail Rule Addition: Incorporating explanation predicates as guardrails reduced discrimination cluster occurrence rates from ≈87% to 36% and Max.K values by 3–7 in 67% of cases, with negligible () model accuracy loss. Counterfactual retraining sometimes reduced individual unfairness but increased cluster sizes in 39% of cases, indicating the necessity of iterative HyFair mitigation.
Selected Metrics and Algorithmic Overview
| Task | HyFair Metric/Result | Baseline Comparison (FAIRIFY/LIME) |
|---|---|---|
| IDs found in 100s | Up to 10× more, 15–20 Max.K | 5–12 Max.K |
| First ID time | 10× faster in 18/20 cases | |
| Explanation size | 20–50% fewer conjuncts | |
| Robustness (Diff) | ≥2× greater in 78% models |
6. Limitations and Directions for Extension
- Counterfactual realism: Full enumeration over all protected attribute combinations can yield unrealistic samples.
- Intersectionality: Present analysis focuses on one protected attribute at a time; intersectional fairness requires iterative or extended formalisms.
- Scalability: Formal 2-fairness certification is practical for moderate-sized DNNs and protected domains but scales poorly to deep/wide architectures or large ; randomized search cannot guarantee global optima.
Potential extension points include integrating generative models (cGANs/VAEs) for realistic counterfactual sampling, multi-attribute intersectional encodings, incremental HyFair-powered retraining loops, and amortized fairness verification for evolving or model families.
7. Significance and Impact
HyFair provides a unified framework capable of both certifying and uncovering discrimination clusters in high-dimensional decision systems. By exploiting both symbolic verification and scalable randomized exploration, it advances the frontier of algorithmic fairness assessment beyond isolated pairwise violations to systematic, interpretable clustering of unfair outcomes. Decision-tree-style explanation artifacts guide effective guardrail construction and model mitigation, supporting comprehensive, targeted fairness improvements in practical machine learning deployments (Akash et al., 29 Dec 2025).