TL;DR
Graph Neural Networks (GNNs) are remarkably good at predicting molecular properties, but when we ask them why they made a decision, their explanations can be surprisingly unreliable. This paper introduces B-XAIC, a 50,000-molecule benchmark with exact, rule-derived ground-truth explanations, acting as a "unit test" for Explainable AI (XAI) in chemistry. Evaluating popular XAI methods on B-XAIC reveals a troubling gap: even when a GNN achieves near-perfect accuracy, explainers frequently fail—especially when asked to explain why a chemical pattern is absent.
What Problem Does This Paper Address?
In drug discovery and cheminformatics, knowing why a model flags a molecule as toxic or active is just as important as the prediction itself. To peer inside these black-box GNNs, researchers use XAI methods that highlight important atoms (nodes) and bonds (edges).
The catch? We lack good ways to test if these explanations are actually faithful to what the model learned. Existing benchmarks fall into two traps:
- Synthetic datasets (like BA-2Motifs) use artificial graph shapes that lack the messiness and complexity of real-world chemistry.
- Real-world datasets (like MUTAG) are either tiny or rely on experimental labels where subtle, unknown factors influence the outcome—meaning we can't be 100% sure what the "true" explanation is.
Furthermore, most evaluations struggle with null explanations: if a model predicts a molecule is not toxic because it lacks a certain substructure, no single atom should be highlighted. Standard metrics like AUROC are undefined for empty ground truths, and arbitrary thresholding can easily hide an explainer's bad habits.
Methods
The authors design B-XAIC as a diagnostic unit test for molecular XAI—analogous to FunnyBirds in computer vision. If an explainer can't recover simple, unambiguous structural rules that a GNN demonstrably uses, we shouldn't trust it on complex biological endpoints.
They define 7 binary classification tasks of graded difficulty, each paired with exact node- and edge-level ground-truth rationales:
- Single-atom detection: Boron (
B), Phosphorus (P), and Halogens (X: Cl, Br, F, I). - Substructure detection:
indolerings andPAINS(480 known structural alerts that cause false positives in drug screens). - Structural counting:
rings-count(>4 rings) andrings-max(rings with >6 atoms).
To evaluate explainers fairly without arbitrary thresholds, B-XAIC splits evaluation into two regimes:
- Subgraph Explanations (SE): When the target pattern is present, they use AUROC to check if the explainer ranks the true pattern's atoms/bonds higher than the rest of the molecule.
- Null Explanations (NE): When the pattern is absent, a faithful explainer should treat all atoms/bonds equally. They cast this as outlier detection using the classical 1.5× Interquartile Range (IQR) rule—awarding a score of 1 if no outliers are detected, and 0 otherwise.
They benchmark 15 explainers across four families—Gradient-based (e.g., Saliency, IntegratedGradients), Graph-specific (e.g., GNNExplainer, PGMExplainer, SubgraphX), Perturbation-based (e.g., ShapleyValueSampling), and Surrogate (DnX, FastDnX)—on four GNN architectures (GCN, GAT, GIN, and the inherently interpretable ProtGNN).
Datasets
- B-XAIC: 50,000 drug-like small molecules (average size ~34.6 atoms) sampled from ChEMBL 35 (2.5M molecules) using weighted sampling to mitigate class imbalance, split 80/10/10 for training, validation, and testing.
- Out-of-Distribution (OOD) Validation Sets: To prove the GNNs genuinely learned the chemical rules rather than memorizing ChEMBL's chemical space, the authors test on ZINC (commercial compounds) and two synthetic OOD sets: $\text{OOD}_f$ (random atoms sampled at organic frequencies) and $\text{OOD}$ (uniformly random atoms).
Key Insights and Ideas
- High accuracy $\neq$ good explanations: Even when a GNN (specifically GIN) achieves >92% F1 across all tasks—and >99% on several—explainers routinely fail to pinpoint the exact substructures.
- The "feature absence" blind spot: Gradient-based and surrogate methods are great at finding patterns when they are there (high SE), but terrible when they aren't (low NE). Because model sensitivity is rarely zero, these methods hallucinate spurious fragments on negative examples.
- Node vs. Edge contradictions: An explainer can contradict itself on the exact same molecule. For instance, on null instances, Deconvolution's node attributions are clean, yet its edge attributions highlight spurious bonds.
- Near-binary masks: Methods like GraphMaskExplainer produce near-binary attribution scores, making them insensitive to evaluation thresholds and masking nuanced importance.
Key Results
Model Performance: GIN consistently outperformed GCN, GAT, and ProtGNN, achieving 99.96% Weighted-F1 on B, 99.62% on rings-count, and 92.90% on PAINS. Probing experiments (replacing key atoms with carbon) and OOD tests confirmed GIN relied on the true chemical patterns.
Node Explanations (on GIN): - Best overall: PGMExplainer (0.98 NE, 0.76 SE, 0.87 avg) and SubgraphX (0.94 NE, 0.74 SE, 0.84 avg). - Best at localization (SE): GuidedBackprop (0.87 SE), though it struggled on null instances (0.41 NE). - Weakest: Surrogate methods DnX and FastDnX (both 0.41 avg).
Edge Explanations (on GIN): - Edge explanations were noticeably harder across the board. FlowX (0.59 avg) and GNNExplainer (0.58 avg) led overall. PGExplainer achieved the highest edge SE (0.72) but collapsed completely on null explanations (0.02 NE).
Limitations and Future Work
B-XAIC is intentionally scoped as a unit test: its ground truths are rule-derived rather than expert-derived (with PAINS as the chemically curated exception), meaning it tests whether an explainer recovers the label-generating rule rather than whether it offers deep chemical insight. All tasks are binary classification on small organic molecules ($\le 60$ atoms), and the harder tasks remain class-imbalanced (e.g., rings-max has only 5.68% positives). Future work will expand the benchmark to regression targets and "activity-cliff" scenarios, where tiny structural tweaks cause massive shifts in molecular properties.
Summary updated