Towards Fair Graph Neural Networks via Graph Counterfactual

Zhimeng Guo, Jialiang Li, Teng Xiao, Yao Ma, Suhang Wang

Abstract

Graph Neural Networks (GNNs) are known to inadvertently amplify societal biases present in training data due to their message-passing mechanisms. This paper introduces CAF (Counterfactual Augmented Fair GNN), a framework that utilizes a causal lens to select realistic counterfactual examples directly from training data. By learning "content" representations that are predictive of labels but invariant to sensitive attributes, CAF achieves a superior fairness-accuracy trade-off. Experimental results on real-world datasets like German Credit and Bail demonstrate CAF's effectiveness and its backbone-agnostic nature.

Introduction

While GNNs excel at modeling relational data, they often inherit and exacerbate biases. For instance, in social networks with high homophily, neighborhood aggregation can lead a model to rely on sensitive attributes (e.g., race, gender) for predictions. Existing fairness methods often rely on statistical parity or generate synthetic counterfactuals that may be unrealistic. CAF addresses these issues by identifying real-world counterfactuals within the dataset to guide fair representation learning.

Methodology

Structural Causal Model (SCM)

The CAF framework is grounded in a Structural Causal Model that decomposes node features into Content ($C$), which is task-relevant, and Environment ($E$), which is influenced by the sensitive attribute ($S$).

Structural Causal Model (SCM) for Graph Data

As illustrated in the SCM, the observed graph $G$ acts as a "collider" between $E$ and $C$. Conditioning on $G$ during standard GNN training induces a spurious dependency between the sensitive attribute $S$ and the label $Y$, leading to biased predictions. CAF aims to break this dependency by disentangling $C$ from $E$.

The CAF Framework

CAF implements this causal decomposition through a multi-stage pipeline:

  1. Disentangled Representation Learning: A GNN encoder splits node representations into content and environment vectors.
  2. Counterfactual Selection: Instead of generating "fake" data, CAF searches the dataset for real nodes that serve as counterfactuals (e.g., nodes with the same label but different sensitive attributes).
  3. Pseudo-Labeling: To handle unlabeled nodes in semi-supervised settings, a pre-trained backbone provides pseudo-labels to expand the counterfactual pool.
  4. Learning Constraints: The model is optimized using four losses: Informativeness, Sufficiency, Orthogonality, and Invariance.
The CAF Framework: From Input Graph to Fair Representation Learning

Experimental Results

CAF was evaluated on several real-world datasets, including German Credit, Credit Defaulter, and Bail. It consistently outperformed state-of-the-art models like NIFTY and GEAR in both accuracy and fairness metrics. For example, on the Bail dataset, CAF reduced the Statistical Parity gap ($\Delta_{SP}$) to 2.29, compared to 7.50 for a standard GCN and 5.74 for NIFTY. Across all datasets, CAF achieved an average rank of 1.75, significantly better than the runner-up at 3.83. Additionally, CAF proved to be backbone-agnostic, improving fairness across GCN, GraphSAGE, and GIN architectures.

Conclusion

By shifting from counterfactual generation to selection, CAF provides a more robust and realistic approach to fair GNNs. It effectively "quarantines" bias within environment representations, ensuring that decision-making relies solely on invariant content features. Future work will explore extending this framework to multi-class attributes and dynamic graph structures.

Summary updated

BibTeX
@inproceedings{guo2023towards,
  author = {Zhimeng Guo and Jialiang Li and Teng Xiao and Yao Ma and Suhang Wang},
  title = {{Towards Fair Graph Neural Networks via Graph Counterfactual}},
  booktitle = {ACM International Conference on Information and Knowledge Management},
  year = {2023},
  doi = {10.1145/3583780.3615092},
}
Figure