Exact Robustness Certificates for Ring-Aware Graph Networks Under Edge Edits

Graph neural networks that "see" rings are among the most accurate models for molecules. A plain message-passing network updates each atom from its neighbors and provably cannot tell a closed six-membered ring from an open chain of the same local shape. The fix that works best is to lift the graph: detect its rings and add them as extra objects that exchange messages with atoms and bonds, as in CW Networks. Yet nobody can currently prove that such a model is robust to small edits of the bonds themselves, which are exactly the edits that create or destroy rings. Existing deterministic certificates for graph networks cover only node-feature perturbations on a fixed graph. Existing certificates for edge edits rely on random sampling and give probabilistic guarantees. Existing complexity theory covers only plain message passing.

We propose an exact verifier for ring-aware graph networks under bounded edge insertion and deletion. It works by encoding the lifting step inside a mixed-integer linear program, meaning an optimization problem over continuous and 0/1 variables that commercial solvers handle by branch-and-bound. Each candidate ring that could exist after at most $k$ edits gets a 0/1 indicator. That indicator is tied by linear constraints to the presence of its bonds and the absence of its chords, so the solver reasons about which rings exist and what the network computes at the same time. The scientific question this answers is not only "can we certify these models" but also "does topological expressivity make verification harder or easier?" Our hypothesis is that it makes verification easier. A three-layer cellular network matches tasks that need deep plain networks, and verification cost grows with depth and with the number of ReLUs whose sign the solver cannot settle in advance. If the hypothesis holds, expressivity and verifiability are allies rather than a trade-off.

Core Claim

For a fixed input graph $G$ and a budget of $k$ edge edits, the set of rings that can appear or disappear is finite. For molecular graphs and small $k$ it is also small, and it can be enumerated ahead of time. Encoding these candidate rings as gated 0/1 variables turns exact verification of a CW Network into a mixed-integer program. Its size grows with the number of candidate rings rather than with the number of edge subsets. The topology then supplies valid constraints that tighten the program. A ring can exist only if all its bonds exist. An induced ring, one with no shortcut edge across it, exists only if none of its chords do. The messages an edge receives from rings above it are bounded by the number of candidate rings containing it.

We claim three things, each falsifiable. First, this encoding certifies ring-aware models under edge edits exactly, within practical time on standard molecular benchmarks. Second, at matched clean accuracy, a shallow cellular network certifies more graphs per unit of solver time than a deep plain message-passing network verified with the same machinery. Third, the topological constraints account for a measurable share of that speedup.

Position Relative to Prior Work

Two theoretical papers motivate and bound the project. Fundamental Limits in Formal Verification of Message-Passing Neural Networks proves that verifying graph-level plain message-passing networks over graphs of unbounded size is undecidable. It also shows decidability for node-level tasks under bounded degree, via unrolled computation trees. Verifying GNNs with Readout is Intractable shows that quantized networks with global readout become (co)NEXPTIME-complete, and NP-complete when the vertex count is bounded. Its solver-based prototype goes from about 16 seconds on a 1-vertex graph to 5,421 seconds on a 2-vertex graph. Both papers consider plain message passing only. Both also concern global properties, where the input graph is unknown. We deliberately pick the local question: robustness around a known graph under at most $k$ edits. That question is trivially decidable but practically hard. Choosing it sidesteps the undecidability result rather than contradicting it. It also avoids the $N!$ relabeling symmetry that Optimizing over trained GNNs via symmetry breaking had to break with ordering constraints, because node identities are fixed by the input graph.

Two lines of certified-robustness work set the baselines we must beat.

On the method side, we reuse the exact mixed-integer encoding of ReLUs and the cheap-bounds-first presolve from Evaluating Robustness of Neural Networks with Mixed Integer Programming. That presolve uses interval arithmetic, escalating to linear programs only when needed, to decide which ReLUs are fixed in sign. The architecture comes from Weisfeiler and Lehman Go Cellular: CW Networks. It lifts induced cycles to 2-cells and passes messages along boundaries and adjacencies. It distinguishes graphs 3-WL cannot, and solves RingTransfer perfectly with three layers where deep plain networks fail.

One prior result constrains our hopes. Benchmarking Graph Neural Networks notes that theoretically expressive models often lose to simpler anisotropic ones in practice. We therefore compare at matched clean accuracy, never at matched expressivity alone.

Research Program

The verifier has three parts.

Candidate-ring enumeration. Given $G$, a maximum ring length $L$ (six or seven for molecules, matching the lifting used by CW Networks), and budget $k$, we enumerate every simple cycle of length at most $L$ that uses at most $k$ non-edges of $G$. Under deletion-only edits this set is just the existing rings, which is cheap. Under insertions it grows combinatorially in $k$, so we report the enumeration size honestly as part of the cost.

Gated encoding. Each potential edge $e$ gets a 0/1 variable $a_e$, and the edit budget is the linear constraint $\sum_e |a_e - a_e^G| \le k$, where $a_e^G$ is the edge's status in the original graph. Each candidate ring $r$ gets an indicator $z_r$, made equal to "all bonds of $r$ present and no chord of $r$ present" by standard linearizations of AND and NOT. Every message is then gated by the relevant indicators using big-M constraints. This covers atom-to-atom messages gated by $a_e$, and edge-to-ring and ring-to-edge messages gated by $z_r$.

Topological constraints and bounds. We add the implications above as explicit cuts. We then propagate interval bounds through the gated aggregations, with bounds that depend on the number of candidate rings and edges incident to each cell. This lets the presolve fix as many ReLUs as possible before branching. Cells outside the $T$-hop reach of any editable edge, where $T$ is the number of layers, keep their clean activations as constants. A shallow network therefore yields a small program.

The property is that the predicted class margin stays positive, or for regression that the output stays within $\delta$ of the clean prediction, over all admissible edits. Alongside the exact verifier we build an incomplete variant. It relaxes all 0/1 variables to $[0,1]$ and solves one linear program, which gives a sound but possibly loose certificate in polynomial time.

The same encoding applies with no change to a plain message-passing network whose node features include precomputed ring counts. This matters for the comparisons below.

Baselines

The naive reference point is an attack-only upper bound. We run a greedy and exhaustive-for-small-$k$ edge-edit attack on each test graph. Graphs it breaks are certainly non-robust; all others are only "not yet broken." Any exact certificate must lie between zero and this upper bound, and the gap between our certified fraction and the attack bound measures how much of the truth we recover.

The strongest existing competitor on edge edits is randomized smoothing from Certified Robustness of Graph Neural Networks against Adversarial Structural Perturbation. It reports 0.40 certified accuracy for smoothed GIN on MUTAG against 15 global edge modifications, and 0.49 for smoothed GCN on Cora against 15 edits per node. It is the strongest competitor because it is the only published method that certifies edge edits at all, and it scales to any architecture, including CW Networks. We will run it on the same CW Network and GIN checkpoints and data splits. We use its reported sample range (10,000 to 50,000 Monte Carlo draws) and sweep the edge-keep parameter over the values the paper uses. We report wall-clock time on the same hardware as our solver.

Smoothing certifies a different, smoothed classifier, so the comparison has two axes. The first is certified accuracy of the deployed network at each $k$, which smoothing cannot provide. The second is certified accuracy at each $k$ regardless of guarantee type, where smoothing is a legitimate rival. We count as beating it if our deterministic certificates on the unsmoothed CW Network match or exceed smoothing's certified accuracy at small budgets ($k \le 3$) at lower total time. We expect to lose at large $k$ under insertions and will say so.

The strongest exact competitor is our own mixed-integer encoding applied to a plain message-passing network, GIN with sum aggregation. It uses only edge gating, follows the presolve of Evaluating Robustness of Neural Networks with Mixed Integer Programming, and is trained to matched clean accuracy by adding depth. No reported result was found on Lacuna for exact mixed-integer verification of graph networks under edge edits. This baseline must therefore be built, and it gets the same solver, time limit, and tuning effort.

We also run the incomplete single-LP variant, in the spirit of the dual bound in Certifiable Robustness and Robust Training for Graph Convolutional Networks. That paper reports fewer than 20% of Citeseer nodes certified under 12 attribute flips for a standard GCN. This is a different threat, so we use it only as context for how loose linear relaxations can be.

Finally, the key-ingredient ablation removes the topological cuts and the incidence-aware bounds while keeping the encoding itself. This isolates whether topology helps the solver or merely the model.

Why not just…?

Why not just use randomized smoothing, which already works for any architecture? It is a genuine threat on raw certified accuracy, especially at large budgets, where exact search will time out. Two things favor our approach. Smoothing certifies a voting ensemble over noisy graphs rather than the network one ships. It also pays tens of thousands of forward passes per graph, and its edge-keep parameter trades clean accuracy against certified radius, according to its own authors. The head-to-head experiment reports both guarantee types on the same checkpoints. If smoothing dominates even at $k \le 3$ under deletion-only edits, the regime where our candidate set is tiny, that is a negative result we will publish.

Why not just add ring-count features to a plain message-passing network and verify that? This is the most serious alternative, because such a model sees rings without any cellular message passing. Our answer is that it does not avoid the hard part. Under edge edits the ring counts themselves change, so verifying it needs exactly our candidate-ring indicators. We therefore include it as a third architecture under the identical encoding. If it verifies as fast as the CW Network at matched accuracy, the conclusion is that ring awareness, not cellular message routing, drives verifiability. That would still be a useful result, and we would reframe the contribution around the lifting encoding rather than the architecture.

Why not just use Laplacian positional encodings, which already reach 100% on CSL? Benchmarking Graph Neural Networks shows they lift plain networks from 10% to 100% on CSL. Under edge edits, however, the encodings are eigenvectors of a perturbed matrix. Their signs and subspaces can flip discontinuously, and that cannot be expressed with piecewise-linear constraints. We will not verify them. Instead, we report their attack-only robustness as a reference, to check whether their clean expressivity comes with worse empirical stability.

Why not just run an off-the-shelf solver on the network translated to C, as in the readout paper? The 16-second to 5,421-second jump reported in Verifying GNNs with Readout is Intractable comes from leaving the whole topology symbolic. Our local setting fixes most of the topology and exposes only $k$ edits. The program's size is then governed by the candidate rings and the receptive field, which the scaling experiment measures directly.

Proposed Experiments

We train CW Networks with ring lifting, GIN of matched accuracy, and GIN with ring-count features on MUTAG and PROTEINS for classification. We also train them on ZINC, posed as output reachability: does predicted solubility move by more than $\delta$ under $k$ edits? For a stress test with very small graphs we use QM7. Budgets range over $k \in \{1,2,3,5\}$ for insert-and-delete and up to 15 for deletion-only, so that MUTAG results line up with the smoothing paper's 15-edit figure. We report:

  • fraction of test graphs certified;
  • fraction falsified by a solver-found counterexample;
  • fraction timed out under a fixed per-graph limit;
  • median solve time;
  • candidate-ring count and program size;
  • clean accuracy.

The first decisive check is the expressivity–verifiability curve. We plot certified fraction against solver time for the three architectures at matched clean accuracy. If the shallow CW Network does not certify more graphs per second than deep GIN, our central hypothesis fails.

The second check is the ablation. If removing the topological cuts and incidence-aware bounds leaves solve times unchanged, the topology helps only through shallowness, and we will say so.

The third check is soundness. Every certified graph is attacked exhaustively at $k \le 2$ in exact arithmetic, and at quantized precision on hardware, following the warning in No Soundness in the Real World: On the Challenges of the Verification of Deployed Neural Networks that floating-point effects can invalidate proofs. Any counterexample found this way is a bug in the verifier, and its rate must be zero.

The fourth check is the RingTransfer task from the CW Networks paper, used as a scaling probe. Ring size grows there while the cellular network's depth stays fixed. If our verifier's time stays flat with ring size for the CW Network but grows for GIN, whose depth must grow with ring size, we will have direct evidence that topological shortcuts shrink the region a verifier must reason about.