Algorithmic bias Algorithmic fairness User profiling

GNNFairViz: Visual analysis for fairness in graph neural networks

Graph neural networks are increasingly used to make predictions on relational data in settings such as social and financial networks. Yet, assessing whether these models treat demographic groups comparably is difficult because bias can arise not only from node attributes but also from the graph structure that drives message passing. By introducing a model-agnostic visual analytics framework and a practical tool, we enable developers to inspect fairness across multiple sensitive attributes, select bias-relevant node subsets, and diagnose how attribute and structural biases translate into model bias.

Fairness analysis in graph learning is conceptually different from fairness analysis on tabular data because the graph couples individuals through edges. In a node classification setting, a model prediction for a person-like node can depend on features of many other nodes that are connected through the network, and this dependency is mediated by the model’s aggregation mechanism. As a result, even if sensitive attributes are not used directly, group-level disparities can emerge through correlated attributes, through connectivity patterns, or through interactions between the two.

This makes it easy to misdiagnose what is actually happening. A model can appear “unfair” under one fairness notion and less problematic under another; group definitions can be binary, multinary, or intersectional; and the same graph topology can either amplify disparities (e.g., when connections reinforce within-group separation) or dampen them (e.g., when neighborhoods mix groups heavily). What practitioners often need, before choosing mitigation strategies, is a structured way to localize where the bias comes from and connect that diagnosis to actionable design choices.

In a study, in cooperation with Xinwu Ye, Jielin Feng, Erasmo Purificato, Michael Kamp, Zengfeng Huang, and Siming Chen, and published in IEEE Transactions on Visualization and Computer Graphics, we introduce GNNFairViz, a visual analytics framework and tool for analyzing fairness issues in graph neural networks from a data-centric perspective. Existing fairness tooling is often not designed around the structural nature of graphs and the workflow of GNN developers. We focus on supporting interactive diagnosis that attributes model bias to both attribute-related and structure-related signals, including cases with multiple sensitive attributes and multinary group definitions.

High-level solution overview

We propose a two-phase approach that couples bias computation with interactive visual analysis. Conceptually, we separate:

  • Model bias: disparities observed in the model’s outputs across sensitive groups under multiple fairness perspectives.
  • Data bias: disparities in the underlying attributed graph, decomposed into attribute bias (group-conditional differences in feature distributions) and structural bias (group-conditional differences in connectivity and neighborhood influence).

GNNFairViz instantiates this framework as an interactive, multi-view tool designed to be used during model development (not as a post-hoc report). It supports iterative analysis: developers select node subsets that appear influential, inspect fairness patterns, and then diagnose whether the observed model bias is more consistent with attribute-driven effects, structure-driven effects, or their interaction.

How it works

GNNFairViz pipeline: inputs (a trained GNN plus attributed graph data and sensitive attributes) feed a bias calculation phase that separates model bias and data bias, followed by an interactive analysis phase organized around node selection, fairness inspection, and diagnostics.

Multiple fairness perspectives, including intersectional groups

A first mechanism is to treat “fairness” as inherently multi-perspective. Rather than committing to a single notion, we support a suite of fairness metrics that can be applied to multi-class prediction and to sensitive attributes with more than two categories. Crucially, we also support intersectional group definitions, where sensitive groups are formed by combining attributes (e.g., age × nationality). This matters because group disparities can remain hidden when attributes are analyzed one at a time, but become visible when their intersections are inspected.

The practical implication is that fairness inspection becomes an exploratory step: developers can check whether apparent parity under a coarse grouping is masking disparities in smaller or more specific subpopulations.

Human-guided node subset selection

A second mechanism is to make node subset selection central to fairness diagnosis. Instead of treating the entire dataset as the unit of analysis, we let developers isolate node sets that are plausibly driving disparities. The selection is supported by views that expose complementary signals: representation-level patterns (embeddings), neighborhood influence patterns (how large and repetitive neighborhoods become in computational graphs), and structural concentration patterns (dense subgraphs).

This choice matters because fairness issues in graphs are rarely uniform. A small number of structurally central regions, or a subset of nodes with atypical neighborhood reach, can disproportionately shape learned representations and group-level outcomes. By enabling targeted selection, the subsequent diagnosis becomes more interpretable and actionable.

Counterfactual “bias contribution” to connect data factors to model bias

A third mechanism is to connect candidate causes (attributes, structure) to observed model bias through counterfactual comparisons. For a selected node set, we ask structured “what-if” questions: how would group disparities in the model’s outputs change if we obscured certain node attributes, removed edges incident to the selected nodes, or did both simultaneously?

The key abstraction is that change in group-level output distributions serves as evidence about contribution: if masking an attribute or altering local structure substantially changes the disparity signal, that component is implicated as a driver. This is conceptually different from relying only on label-level fairness summaries, because it aims to capture how the model’s predictive behavior shifts under controlled perturbations, even when final predicted labels might not change much.

Joint diagnostics of attribute bias and structural bias

A fourth mechanism is to explicitly diagnose the interaction between attribute bias and structural bias. Attribute bias is characterized by how feature distributions differ across groups; structural bias is characterized by how connectivity patterns and neighborhood influence differ across groups. GNNFairViz provides views that let developers compare group-to-group connectivity at different hop distances and relate attribute values to neighborhood influence.

This matters because structural patterns can either amplify or dampen attribute-driven disparities. For example, heavy inter-group connectivity can cause minority-group representations to incorporate substantial information from majority-group neighborhoods, changing how attribute bias manifests in model outputs. Conversely, strong within-group connectivity in dense regions can reinforce separation and increase disparity signals.

Findings and insights

Across the usage scenarios and expert feedback in the paper, a consistent theme is that fairness issues in GNNs are often diagnosable only when attributes and structure are analyzed together, and when group definitions are allowed to be intersectional.

One insight is that intersectional analysis can reveal disparities that disappear under single-attribute grouping. When sensitive attributes are combined, the resulting finer-grained groups can exhibit markedly different outcome patterns, suggesting that “fairness with respect to age” and “fairness with respect to nationality” do not automatically imply fairness with respect to their intersection.

A second insight concerns the role of graph structure in highly imbalanced settings. The paper highlights an “Overwhelming Effect”: when minority groups are small, their nodes may connect largely into majority neighborhoods, and message passing can cause their learned representations to be dominated by majority-group information. In the observed scenarios, this mixing sometimes reduced between-group differences in representations and promoted group-level parity in outputs. Conceptually, this reframes structural effects: mixing is not inherently good or bad for fairness, but it can change disparities in ways that may also affect how minority-specific signals are preserved.

A third insight is that architecture choices can materially change fairness outcomes even without explicit fairness constraints. Mechanisms that reweight neighborhoods (such as attention) or reduce neighborhood information (such as sampling) can weaken or strengthen the structural effects that shape group disparities. The tool’s value here is not to declare one architecture “fair,” but to help developers form a causal hypothesis about why a given architecture yields certain disparity patterns on a particular dataset.

Finally, expert interviews suggest that an interactive, multi-view workflow can reduce the barrier to systematic fairness diagnosis in GNN development. At the same time, the paper notes practical limitations: scalability to larger graphs remains challenging, and there is a learning curve for users unfamiliar with coordinated interactive views.

Conclusions

This work contributes a data-centric way to reason about GNN fairness: we do not treat model bias as a single score, but as an outcome shaped by attribute distributions, connectivity patterns, and their interaction through message passing. By operationalizing this perspective in an interactive tool, we make it more feasible for practitioners to move from “the model looks biased” to “these attributes and these structural regions appear to drive the disparity signal under these group definitions.”

Several extensions follow naturally from the framework. A first direction is comparative analysis across models, so developers can directly contrast how architectural choices change bias mechanisms on the same graph. A second direction is extending the approach beyond node classification, since fairness concerns also arise in tasks such as link prediction and recommendation on graphs. A third direction is improving scalability and analyst guidance: larger graphs call for more efficient backends and more explicit analysis playbooks that help users choose which selections and diagnostics are most informative for a given fairness question.