Manuscript Offprint

arXiv:2610.03526

Beyond Trained Models: Compiling GNNs for a Sound Explainer Benchmark

Steve Azzolin, Francesco Paolo Nerini, Stefano Teso, Francesco Bonchi, Bruno Lepri, André Panisson, Andrea Passerini

A PREPRINT

Steve Azzolin ∗^{*}

University of Trento

Trento, Italy

Francesco Paolo Nerini ∗^{*}

Sapienza University

Rome, Italy

Bruno Lepri

Fondazione Bruno Kessler

Trento, Italy

Stefano Teso

University of Trento

Trento, Italy

Francesco Bonchi

Intesa Sanpaolo AI Research

Turin, Italy

André Panisson

Intesa Sanpaolo AI Research

Turin, Italy

Andrea Passerini

University of Trento

Trento, Italy

October 5, 2026

ABSTRACT

Explainers for Graph Neural Networks (GNNs) are commonly evaluated by their plausibility, i.e., how well their explanations recover a predefined ground truth, such as a motif planted in the data. This protocol implicitly assumes that a GNN trained on such data relies on the intended motif. Although prior work has questioned this assumption, plausibility remains widespread. First, we show that the assumption is violated on several widely used benchmarks, where, e.g., degree statistics alone suffice to solve the task. Then, we remove this confounder by replacing training with compilation. We achieve this by introducing Gracr, the first compiler translating graded modal logic formulas into GNN weights, yielding models that replicate the behaviour of the corresponding formulas. Since the behaviour of the model is now known by construction, we can define its ground truth explanation formally and compute it exactly. Building on this, we introduce GracrBench, a benchmark of compiled GNNs for the evaluation of explainers against this exact ground truth. Experiments on eleven explainers across six tasks show its effectiveness for fine-grained diagnostic evaluation: notably, we discover that most explainers are not robust to indirect influences or alternative implementations of the same formula. These results position GracrBench as a novel, rigorous evaluation setting for graph post-hoc explainability.

1 Introduction

Explaining why a Machine Learning (ML) model produces a particular output is a core challenge for deploying these models in the real world. Graph Neural Networks (GNNs) [Scarselli et al., 2008, Bronstein et al., 2021] are no exception, and a rich literature has emerged to develop methods for explaining such models [Yuan et al., 2022, Amara et al., 2022, Longa et al., 2025]. One of the most widely used techniques for evaluating the quality of GNN explainers is plausibility 2^{2}, i.e., how well the explanation recovers a “ground-truth” pattern. It follows this blueprint: First, identify or create a dataset with a known discriminative pattern, e.g., graphs containing a house-like motif versus graphs containing a cycle-like motif; then, train a GNN on this dataset; last, evaluate how well the explanations produced by the explainer under evaluation recover the known discriminative pattern.

Previous work has already identified shortcomings of this blueprint [Faber et al., 2021, Himmelhuber et al., 2021, Agarwal et al., 2023, Fontanesi et al., 2024]. Yet, despite these findings, our extensive literature review (see Fig. 1) shows that plausibility remains widely used: strikingly, roughly 25% of all 155 papers we surveyed adopt plausibility as the only criterion for evaluating explanations. The fundamental issue is that the trained GNN may learn other,

∗^{*}Equal contribution

2^{2}A.k.a. explanation accuracy [Agarwal et al., 2023]

A PREPRINT

potentially spurious patterns present in the data that differ from the intended discriminative pattern, as illustrated by the example in Fig. 2. Consequently, we scrutinize the definition and usage of plausibility closely.

In our work, we first extend previous findings by identifying specific, widely used datasets where the above shortcoming is likely to occur, and then propose a new strategy for evaluating plausibility that replaces GNN training with a compilation step. We begin by identifying a pattern of interest, represented as a Boolean logic formula. Then, we introduce a compiler to transform this logic formula into a GNN that, by construction, shares the same behaviour and explanations as the formula. This raises the question of what the “ground truth” explanation of a formula actually is. Common practice answers with a designated motif, but already for simple patterns – such as a node having more red than blue neighbours – several subgraphs justify the prediction equally well. We therefore need a notion of ground truth that generalizes beyond simple motifs and accounts for alternative explanations. To do so, we borrow from formal XAI the definition of prime implicant [Darwiche and Hirth, 2020, Marques-Silva and Ignatiev, 2022] – i.e., a minimal subgraph that alone suffices to determine the prediction – and take the union of all prime implicants as the ground truth explanation. Finally, the explainer is evaluated based on how well its explanations recover such ground truth. Crucially, the compilation step allows us to control exactly the behaviour of the GNN, as it is equivalent to the logic formula from which it was derived: effects that are usually inextricably confounded on a trained model can be studied in controlled experiments, allowing specific hypotheses to be tested rigorously.

Summarizing, our contributions are as follows:

Figure

Figure 1: We manually reviewed 155 published GNN explainability papers (2019–2025), recording how they evaluate explanation quality. Plausibility remains a core criterion, used alone in at least 20% of papers each year. Numbers above bars indicate the number of papers analysed; details in Appendix G.

• We show that popular benchmarks are not a reliable test bed for evaluating plausibility, as the GNN over which explainers are evaluated may not behave as expected.

• We propose a compiler capable of translating a logic formula into the weights of a GNN. This yields GNNs where the exact behaviour is known and controllable, addressing the issue above.

• To derive a principled notion of what characterizes a ground truth explanation, we build on formal XAI and adopt prime implicants, and develop an efficient procedure to extract them.

• We exploit this compiler to propose a new, sound benchmark for evaluating plausibility. Our experiments recover previously known findings while uncovering new ones, exposing limitations of explainers in understudied scenarios beyond motif-based tasks.

References (100)

Couldn't load all references. Reload the page to try again.