Would Retrained Models Agree? Jackknife Uncertainty for Auditing Graph Explanations

A common way to check an explanation of a graph neural network (GNN, a model that classifies graphs by passing messages along edges) is to cut out the small subgraph the explainer calls important and feed only that piece back to the model. If the prediction holds, the explanation is called faithful. The problem is that the model never saw such tiny, broken graphs during training, so its answer on them is partly arbitrary. A fidelity score measured there can reflect that confusion rather than the removal of real evidence. Existing fixes either synthesize a realistic background around the subgraph with a generative model, or fine-tune the GNN on pruned graphs before measuring. The first can add its own artifacts. The second is expensive.

We propose asking a narrower question for each pruned input: would models retrained on slightly different training sets give the same answer? Leave-one-out influence (an estimate of how the model would change if one training example were deleted) answers this cheaply. Summing the squared leave-one-out effects of every training example on the prediction for a subgraph gives the infinitesimal jackknife variance, a classical estimate of how much that prediction would move under resampling of the training data. We treat this as the epistemic part of the model's uncertainty on the subgraph, meaning the part caused by the model's ignorance rather than by genuine ambiguity in the data. Our claim is that fidelity should only be trusted where this jackknife variance is low. Weighting fidelity by it should recover the explainer rankings that expensive fine-tuning produces, and it should do so without a generator or retraining. The same computation also names the few training graphs that an unsupported prediction leans on.

Core Claim

Let $f(G')$ be the model's logit on a pruned input $G'$ and $\theta^*$ the trained parameters. Let $H$ be the Hessian (the matrix of second derivatives) of the regularized training loss at $\theta^*$, and $\ell(z_n)$ the loss on training graph $z_n$ out of $N$. The influence-function estimate of how $f(G')$ changes when $z_n$ is removed is $I_n(G') = \frac{1}{N}\nabla_\theta f(G')^\top H^{-1}\nabla_\theta \ell(z_n)$. The jackknife variance of the prediction is then

$$\hat V(G') = \sum_{n=1}^{N} I_n(G')^2 .$$

For a linear model this reduces to the familiar sandwich variance $x^\top \Sigma x$, which grows as the input moves away from the data. That is the reason to expect it to be large on out-of-distribution subgraphs and small on subgraphs the model has effectively seen. The cost per query is one inverse-Hessian-vector product, applied to $\nabla f(G')$, followed by dot products against the training gradients. Only the training gradients need storing, and they are shared across queries.

Separately, we take the entropy of the predictive distribution at $\theta^*$ as the aleatoric part, the ambiguity that remains even among models that agree. Our fidelity score counts a prediction change on $G'$ only to the extent that it exceeds what the jackknife spread could produce. Concretely, each subgraph's fidelity contribution is standardized by $\sqrt{\hat V(G')}$.

Relation to Prior Work

Three lines of work motivate the proposal by showing that the out-of-distribution problem is real and large.

  • GInX-Eval. GInX-Eval fine-tunes the GNN on degraded graphs and finds that gradient explainers such as Grad-CAM and Saliency then do no better than random edges, while GNNExplainer and PGMExplainer stay strong.
  • Deconfounded Subgraph Evaluation. Deconfounding to Explanation Evaluation treats distribution shift as a hidden confounder and applies a front-door adjustment through a generated surrogate graph. It raises Spearman correlation with ground truth on TR3 and MNIST superpixels from near zero to 0.943.
  • Generative in-filling. ProxyExplainer and D4Explainer generate in-distribution proxy or counterfactual graphs. The graph-mixup methods of Zhang et al. and Zhang et al. pad subgraphs with random structure.

All of these change either the input or the model. We change neither. Instead, we measure how much the frozen model's answer on the broken input is actually determined by its training data.

The method comes from the training-attribution literature. Koh and Liang supply the influence estimate. The Bayesian Infinitesimal Jackknife shows that summed squared influences recover bootstrap variance, reporting 186× faster computation on ecological models. That paper works with MCMC posteriors in classical statistical models. We use the influence-function form on a trained GNN and apply it to explanation subgraphs, which it never considers.

Two results constrain the design, and they point in opposite directions. Influence Functions in Deep Learning Are Fragile reports Spearman correlation with true retraining of 0.87 for a small MNIST CNN, but 0.22 for ResNet-50 and below 0.15 on ImageNet, with collapse when weight decay is absent. BIND reports correlation above 0.9 for GNN node influence, at over 450× speedup. The molecular GNNs we target are shallow and can be trained with weight decay, which is the regime where influence works. We therefore train with weight decay and verify this directly rather than assume it.

The uncertainty work supplies the comparison points for the epistemic score.

  • ConfExplainer learns a single confidence scalar per edge and admits that its independence assumption fails under severe shift. It does not separate ignorance from ambiguity.
  • GEBM is a density-style estimator of epistemic uncertainty on graphs, based on energy scores.
  • EPN-reg fits evidential (Dirichlet-output) probes on frozen GNN features.

Both GEBM and EPN-reg decompose uncertainty on full graphs only, and neither links uncertainty back to training data. Our score is not a density. It asks whether the training data pins down the answer, and that difference is what we test.

Research Program

We first build the estimator for graph classifiers: three- to five-layer message-passing GNNs trained with weight decay on the molecular and synthetic benchmarks below. We compute $H^{-1}\nabla f(G')$ with conjugate gradients on Hessian-vector products, with a damping term chosen on held-out data. We also build a cheaper variant that restricts influence to the final layers on frozen features, where the loss is close to convex and the Hessian is well conditioned.

Second, we validate the estimator against the quantity it approximates. On MUTAG and BA-2motifs, where training is cheap, we train 50 bootstrap-resampled models and compute the empirical variance of their logits on the same pruned subgraphs. We then report rank correlation between $\hat V(G')$ and this bootstrap variance, separately for full graphs and for pruned subgraphs at increasing removal fractions. We expect agreement to degrade as subgraphs get smaller, and we want to know where the degradation happens.

Third, we apply the score to explanation auditing:

  1. Run each explainer.
  2. Remove or keep its top edges at several fractions.
  3. Compute frozen-model fidelity, then the jackknife-standardized version.
  4. For low-agreement subgraphs, list the training graphs with the largest $|I_n(G')|$.

The last step tests whether the model's verdict on, say, an isolated nitro group rests on a handful of training molecules or on broad support. We check these lists against known label noise and near-duplicates.

Baselines

Vanilla fidelity (the naive reference). The explainer's subgraph is fed to the frozen model with no correction. GInX-Eval and DSE both show it is confounded, and DSE reports near-zero or negative Spearman correlation on TR3 and MNIST. It runs on identical models and subgraphs. Beating it means a clearly higher Kendall agreement with the fine-tuned explainer ranking and with ground-truth motifs.

GInX-Eval fine-tuning (the reference we aim to approximate, not beat on accuracy). GInX-Eval fine-tunes on pruned distributions for each explainer and removal level. No reported numerical result was found on Lacuna for GInX-Eval's accuracy-drop or EdgeRank scores. The file gives only its qualitative finding that gradient explainers fall to random while GNNExplainer and PGMExplainer lead, so we regenerate its numbers ourselves with the published protocol. Success means reproducing its explainer ordering at a small fraction of its wall-clock cost, with both methods timed on the same GPU.

DSE and ProxyExplainer (the strongest generative competitors). DSE reports Spearman 0.943 on TR3 and MNIST superpixels. ProxyExplainer reports average edge-identification gains of 10.6% on real-world and 7.5% on synthetic datasets over GNNExplainer, PGExplainer, ReFine, and MixupExplainer. We run both from their released protocols on the same trained models, with generator training counted in their compute budget. Matching DSE's rank correlation on TR3 and MNIST without training any generator would count as a win. Exceeding it is not required.

Deep ensembles and seed variance (the most direct alternative uncertainty estimate). We train five-member ensembles and compute disagreement on each subgraph, holding the tuning budget equal to that of our estimator.

Density and evidential scores. GEBM reports AUC-ROC gains of 5.8 to 10.9 points over a vanilla energy model on out-of-distribution detection. It serves as a drop-in replacement for $\hat V$ in the standardization, alongside EPN-reg and plain softmax entropy.

Ablations. Two ablations isolate the key ingredient:

  • Replace $H^{-1}$ with the identity, which gives a gradient-similarity score with no counterfactual meaning.
  • Keep only the aleatoric entropy term.

If either matches the full score, the leave-one-out structure is not doing the work.

Why not just…?

Why not just fine-tune the model, as GInX-Eval does? For small molecular datasets, fine-tuning is affordable. If the goal were a single audit on MUTAG, fine-tuning would be the right tool. The case for our method is threefold:

  • Fine-tuning evaluates a different model from the one being explained.
  • Its cost multiplies with every explainer and removal level.
  • It says nothing about why a given subgraph is unreliable.

We will report the cost ratio honestly. If it is small on our benchmarks, the per-subgraph diagnosis and the training-data attribution carry the contribution, not speed.

Why not just use a five-model ensemble's disagreement? This is the most serious threat. For shallow GNNs, ensembles are cheap and often strong. Ensembles measure variation across random seeds, while the jackknife measures variation across data resamples. On broken subgraphs these may diverge, because seeds can agree on an arbitrary answer that the data does not support. The head-to-head test is which score better predicts where frozen and fine-tuned predictions disagree. If ensembles win or tie, we will say so and reposition the jackknife as the variant that also yields training-example attribution.

Why not just use an existing epistemic estimator such as GEBM or EPN-reg on the subgraph? These estimate novelty in the model's feature space. A subgraph can look novel while the prediction remains well determined, and it can look familiar while the prediction is carried by a few training points. Neither estimator was evaluated on explanation subgraphs, and EPN-reg itself notes that evidential models confuse structural shift with class overlap. The same disagreement-prediction test settles whether this conceptual difference matters in practice.

Why not just trust influence functions despite Basu et al.? We don't trust them blindly. The bootstrap-validation experiment is designed to show where $\hat V$ fails. The last-layer variant serves as a fallback if full-network influence degrades on pruned inputs.

Proposed Experiments

We use the following benchmarks:

  • Synthetic graphs: BA-2motifs and BA-HouseGrid, which have ground-truth motifs.
  • Molecular graphs: MUTAG, Benzene, Fluoride-Carbonyl, and Alkane-Carbonyl.
  • Superpixel graphs: TR3 and MNIST superpixels, for direct comparison with DSE.
  • Additional datasets: BBBP and NCI1, via the D4Explainer codebase and its out-of-distribution evaluation scripts.

The explainers are GNNExplainer, PGExplainer, PGMExplainer, Grad-CAM, Saliency, and random edges.

The first decisive check is per-subgraph. Does $\hat V(G')$ predict where the frozen model's prediction differs from the GInX-Eval fine-tuned model's prediction? We measure this by AUROC against ensemble disagreement, GEBM, EPN-reg, and softmax entropy.

The second is per-explainer. Does jackknife-standardized fidelity reproduce the fine-tuned ranking, measured by Kendall tau, in particular pushing Grad-CAM and Saliency down to the random baseline as GInX-Eval found? The third is ground-truth motif AUC on the synthetic datasets and on MUTAG's nitro and amine groups.

We also run three supporting checks:

  • Bootstrap agreement: rank correlation between $\hat V$ and the 50-model bootstrap variance, broken down by removal fraction.
  • Training-data attribution: a controlled test in which we flip labels on a known set of training molecules and check whether they surface among the top-influence graphs for subgraphs flagged as unsupported.
  • Compute: wall-clock time and memory against fine-tuning, DSE, and ProxyExplainer.

The proposal fails cleanly if $\hat V$ does not track bootstrap variance on pruned subgraphs, or if the identity-Hessian ablation or ensemble disagreement does as well at predicting fine-tuning disagreement.