arXiv:2609.37650cs.LGSep 2026

Manuscript Offprint

arXiv:2609.37650

RACE: Relation-Level Counterfactual Explanations for Heterogeneous Graph Neural Networks

Yuxiang Yao, Zijun Zhao

ABSTRACT

Counterfactual explanations of graph neural networks identify edge deletions that flip a prediction. On heterogeneous graphs, however, existing methods first collapse the graph into untyped edges, so they cannot answer the question a domain expert actually asks: which relation type drives this prediction? We present RACE (Relation-Aware Counterfactual Explanations), which gives this question an exact, per-instance answer. For every explained instance, an exhaustive search over relation subsets returns the certified minimum relation-deletion set that flips the prediction—or an explicit report that no such deletion exists; each relation-level answer is then refined into a typed edge set within the attributed relations, verified on the discrete model by single-edge restoration. The relation-level answer is exact and deterministic given the frozen backbone, whereas soft-mask baselines vary by 6–8 pp in success rate across runs differing only in random ordering. On ACM, a Cora-derived graph, and ogbn-mag, RACE improves counterfactual success rate over the strongest baseline by up to +2.7 pp while deleting fewer edges, and attains the highest success rate among all same-task baselines on every dataset; the advantage reproduces across four backbones on ogbn-arXiv and on DBLP, with cross-seed relation-set agreement up to 0.89. A synthetic study with known generating mechanisms confirms that the search recovers the relation the trained model actually relies on—and reports infeasibility rather than fabricating an attribution when the model has learned none—so the explanations stay trustworthy exactly where explanations matter.

1 INTRODUCTION

Graph neural networks (GNNs) are the workhorse for learning on graph-structured data, yet their predictions remain opaque. Counterfactual explanations address opacity by identifying the minimal input perturbation that flips the prediction: CF-GNNExplainer Lucic et al. (2022), CF 2^{2} Tan et al. (2022), and RCEexplainer Bajaj et al. (2021) delete edges until the prediction changes, and recent work keeps extending this line Zhang et al. (2026). Real-world graphs, however, are rarely homogeneous: academic networks, knowledge graphs, and e-commerce platforms are heterogeneous information networks in which co-authorship, citation, and shared-subject links coexist Shi et al. (2017). On such data the existing methods have two defects. First, they collapse the heterogeneous graph into a pairwise graph, discarding relation-type semantics, so the resulting explanation cannot answer “which relation type drives the prediction”—the question a domain expert asks of a heterogeneous model. Second, even in their native regime, their edge-level outputs are a scattered set of individual edges whose semantics are not aggregable into a human-readable statement such as “co-authorship is what this prediction relies on”.

We close this gap with RACE, a framework that (i) preserves relation-type semantics in the explained model, (ii) computes instance-level minimal relation-deletion sets by exact search, (iii) re-

∗^{*}Equal contribution.

†^{\dagger}Corresponding author.

fines them into verified, single-edge-restoration-irreducible edge deletions inside the attributed relations (a relation-to-edge hierarchy), and (iv) evaluates everything with deletion- and sufficiency-fidelity metrics plus explicit coverage, cost, and stability reporting. We make three contributions:

• Instance-level relation counterfactuals by exact search. For each explained instance v we solve Sv∗=arg⁡min⁡SCv(S)S_v^* = \arg\min_S C_v(S) subject to the prediction flipping (a margin constraint), with a lexicographic cost (number of relations, then local edge fraction, then margin). Because K is small, enumeration over the 2K2^K subsets is exact, deterministic, and cheap ( ≤10\leq 10 s at K=10K=10); every instance receives either this certified answer or an explicit infeasibility report—no force-attribution—and the resulting coverage is disclosed. A budgeted branch-and-bound search extends the same contract to larger K (RQ6). We further document non-monotonicity: some predictions flip under a relation subset but not under full removal, evidence that aggregate flip-rate searches cannot substitute for the instance-level problem.

• A verified hierarchical relation-to-edge pipeline. The edge-level stage deletes the attributed relations and then verifies the intervention on the discrete model by restoring edges one at a time along the saliency order while the flip persists, repeated to a fixpoint—so the reported set carries a single-edge-restoration irreducibility certificate (or an explicit budget-limited status), evaluated on the instance’s exact local computation subgraph. Under a strict same-frozen-typed-backbone, instance-targeted protocol, the hierarchical explainer beats the strongest baseline (CF²-hetero) on both success rate (+0.8/+2.7/+1.4 pp on ACM/Cora/ogbn-mag, p = 0.002 raw, Holm-corrected ≤0.062, ten seeds) and edge cost (-1.9/-1.0/-2.7 pp), reproduces on ogbn-arXiv across four backbones and on DBLP, yields cross-seed relation-set agreement of 0.78–0.89 on the separable datasets, and attains the highest success rate among the same-task counterfactual baselines under the same frozen checkpoint.

• A fidelity framework and an identifiability characterization. We adopt the deletion/sufficiency statistics as descriptive fidelity metrics—Necessity Fidelity (NF) and Sufficiency Fidelity (SF)—reserving causal language for settings with an explicit generating mechanism; we characterize when relation-level attribution is identifiable (causally separable relations), and—via a five-mechanism synthetic study separating model-dependence from data-causal recovery—show that the search recovers the relation the trained model actually relies on and reports infeasibility instead of fabricating an attribution when the model has not learned a mechanism.

References (38)