Class-level counterfactual explanations for GNNs

LLMs as ProposersGenerative Class-Level Counterfactual
Explainer for GNNs

Anonymous authors Under double-blind review

A chemical LLM proposes reusable subgraphs.
A frozen GNN verifies their effects. One ordered library explains a class.

The idea

Shared subgraphs. Individually verified effects.

Blue marks a shared nitro-group candidate in three Mutagenicity parents. Each matched deletion is verified independently by the frozen GNN; the displayed predictions change from 1 to 0. Fig. 1
The three displayed interventions Atom-indexed evidence · Appendix A.6

The deleted motif is O=[N+][O-]. Rows follow Figure 1 from top to bottom; atom indices are zero-based in the recorded parents.

Figure rowDeleted atom indicesWNodeGNN label
1[10, 9, 11]0.0357651 → 0
2[9, 8, 10]0.0297821 → 0
3[0, 1, 2]0.0308631 → 0

Each displayed intervention removes three heavy atoms, has no extra component removal, and has WNode below 0.1. These costs belong to the exact displayed occurrences, not a different minimum-cost match. Appendix A.6

An explanation for one molecule does not summarize a model’s behavior across a class. LAPCE (LLM-as-Proposer for Counterfactual Explanation) turns molecule-conditioned proposals into a compact library of reusable, prediction-changing interventions.

The method

Propose. Verify. Select.

The LLM supplies candidates—not the final verdict.

01

Chemical-LLM proposal

Supervised fine-tuning teaches parent–fragment correspondence. PPO then uses frozen-GNN feedback to improve counterfactual utility.

02

Cross-parent verification

Match and delete each occurrence independently. Retain the least-cost residual that passes sanitization and strictly changes the GNN’s label.

03

Prefix-aware selection

Build one ordered library across cost thresholds and explanation budgets, while controlling redundancy and candidate size.

Calibration fixes the ordering. Held-out evaluation uses frozen prefixes, without reselection. Fig. 2 · §4

What counts as an explanation?

Eqs. 2–3

A finite cost requires a sanitized residual and a strict prediction flip. Completed verification without a successful match gives . A library uses the best independently verified candidate: .

Coverage counts source-class parents admitting a successful intervention within the WNode threshold. The budget counts library candidates, not successive edits to one molecule.

If deletion disconnects a molecule, the fixed policy retains its largest heavy-atom component. WNode compares the complete processed residual; candidate size is not the total number of removed atoms. Appendix A.1

The selection objective Multiple thresholds, one ordering

For the prefix , the multi-threshold coverage utility is

The cost term is a negative capped mean. The penalties control structural similarity, overlapping parent coverage, and candidate size. Greedy initialization and sequence refinement optimize this regularized objective heuristically; the complete objective is not claimed to have a global-optimality guarantee. §4.4 Appendix B

Main results

Higher coverage. Lower semantic cost.

Four molecular tasks, five baselines, and a shared frozen GINE within each task.

+3.01%

relative coverage

−3.19%

relative conditional cost

4 / 4

tasks lead on both metrics

Task-macro relative changes at , compared with the strongest baseline separately for each task and metric. Equal task weights; exact coverage counts and source-precision costs are used before display rounding. Appendix A.4

HIV

HIV activity prediction · binary classification

MethodCoverage ↑Conditional cost ↓
GCFExplainer71.81%0.0759
GlobalGCE55.84%0.0695
COMRECGC66.84%0.0724
CM-CReM+59.36%0.0668
RLHEX74.10%0.0665
LAPCEOurs76.39%0.0645

Bold: best. Underline: second-best. Coverage gain over RLHEX: +2.29 percentage points.

Mutagenicity

Mutagenicity prediction · binary classification

MethodCoverage ↑Conditional cost ↓
GCFExplainer70.02%0.0678
GlobalGCE67.29%0.0736
COMRECGC75.58%0.0785
CM-CReM+68.96%0.0655
RLHEX79.37%0.0645
LAPCEOurs82.05%0.0620

Bold: best. Underline: second-best. Coverage gain over RLHEX: +2.68 percentage points.

BACE

BACE activity prediction · binary classification

MethodCoverage ↑Conditional cost ↓
GCFExplainer37.82%0.0642
GlobalGCE33.33%0.0673
COMRECGC36.97%0.0628
CM-CReM+34.62%0.0621
RLHEX38.03%0.0632
LAPCEOurs39.10%0.0617

Bold: best. Underline: second-best. Coverage gain over RLHEX: +1.07 percentage points.

TasteMolNet

Three-class prediction · Sweet is the explained class

MethodCoverage ↑Conditional cost ↓
GCFExplainer43.65%0.0431
GlobalGCE36.72%0.0460
COMRECGC41.28%0.0447
CM-CReM+35.84%0.0406
RLHEX47.81%0.0405
LAPCEOurs49.12%0.0384

Bold: best. Underline: second-best. Coverage gain over RLHEX: +1.31 percentage points.

Read the metrics together. Coverage uses the full source-class cohort and the cost threshold. Cost is the median over parents with a finite strict-flip cost, without an extra threshold filter; successful subsets can differ. Budgets count each method’s native explanation elements, not equal numbers of edits or GNN queries. Table 2 Appendix A.3 Appendix D

Budget and threshold profiles Figures 3–4
Figure 3. Lines join evaluated budgets; cost axes are task-specific.

At K ∈ {6, 9, 12, 15, 18, 20}, LAPCE leads all five baselines in both metrics on every task. Against RLHEX, it has higher coverage in 31 of 32 task–budget pairs and lower cost in 31 of 32. The exceptions are Mutagenicity coverage at K = 1 and HIV cost at K = 3. §5.1 · Fig. 3

Figure 4. Frozen top-20 libraries; connecting segments are visual guides, not additional measurements.

LAPCE exceeds RLHEX at all 28 positive task–threshold checkpoints. It leads all baselines at every positive sampled threshold on HIV, Mutagenicity, and TasteMolNet, and from 0.04 onward on BACE. Fig. 4

The supplied figure PDFs are reproduced directly. Connecting lines are visual guides, not additional measurements.

Comparison protocol and uncertainty What the reported results establish

Five baseline realizations. GCFExplainer supplies complete counterfactual graphs with parent-specific applicability; GlobalGCE uses independent single mappings; COMRECGC uses endpoint-supported common recourses. CM-CReM+ is our class-level realization of Counterfactual Masking with CReM. RLHEX generates complete molecules with a frozen PS-VAE and PPO latent adapter, using fingerprint-supported parent eligibility and WNode-calibrated terminal-coverage selection. Appendix D

Point estimates and interval scope are different. The main comparison includes RLHEX. The paired coverage-margin intervals in Appendix F.1 use a fixed four-method comparator set that excludes RLHEX; they should not be read as significance tests against RLHEX. Paired conditional-cost intervals against the fixed CM-CReM+ comparator include zero on BACE. Models and explanation libraries remain frozen during the bootstrap. Appendices F.1–F.2

Why the components matter

Better proposals. Useful explanations earlier.

Adaptation improves proposal utility

BACE coverage rises from 20.51% with ChemLLM-7B to 27.56% with SFT and 39.10% with SFT + PPO, with verification and selection fixed. PPO also raises raw-attempt strict-flip yield from 11.2% to 17.6% and candidate-macro reuse from 7.2% to 11.3%.

Table 3(a) · K = 20, θ = 0.1

Prefix scoring helps at small budgets

At budget 5, the complete selector gains 3.21 and 3.89 percentage points in coverage on BACE and Mutagenicity over the matched terminal-only objective.

Table 6 · S6 versus S11

Manuscript figure

Supplied manuscript figure; presentation does not recompute model predictions.