Many protein models represent a folded protein as a graph. Each amino acid (residue) becomes a node, and two residues are joined by an edge whenever their 3D positions lie within a fixed cutoff, typically 10 Å. A graph neural network then predicts things like which residues form a catalytic site or a binding interface. Moving any residue by a fraction of an ångström can push a pair of residues across the cutoff and make an edge appear or vanish. Thermal motion, the change in shape between a protein's bound and unbound states, and errors in AlphaFold2 structures all move residues by about this much. These flips matter most for residues on the protein surface. A surface residue has few neighbors, so one flipped edge can make up a third or half of everything it aggregates. No method can currently tell you, for a given residue, whether its prediction is guaranteed to stay fixed under every coordinate jitter of size ε.
We propose to compute such guarantees exactly. Two facts make this possible. First, a perturbation of size ε can only flip edges whose current length is within 2ε of the cutoff. For small ε, this set of "boundary edges" is a small and sparse graph, even though the full contact graph is dense. Second, Courcelle's theorem says that properties written in monadic second-order logic, which can quantify over sets of edges, can be checked in time linear in graph size on graphs that are tree-like (bounded treewidth). If the network's computation is quantized into a finite set of states, then the question "does some set of boundary-edge flips change this residue's label?" becomes exactly such a property. The theorem guarantees that this question is tractable on tree-like boundary graphs. We do not use the theorem's generic, impractically expensive compilation. Instead we write the corresponding dynamic program over a tree decomposition of the boundary graph by hand, and use it to produce sound, exact certificates for each residue, broken down by residue degree.
Core Claim
Consider a residue proximity graph with Cα coordinates $x_v$, cutoff $r$, and perturbation radius $\epsilon$. Every pairwise distance $d_{uv}$ changes by at most $2\epsilon$, so the only edges that can flip form the set
$$B_\epsilon = \{(u,v) : |d_{uv} - r| \le 2\epsilon\},$$
and every other edge is fixed. A residue $t$ is certified at radius $\epsilon$ if its predicted label is unchanged for every subset $S \subseteq B_\epsilon$ of flipped edges within its receptive field. This over-approximates the flips that are physically realizable, so the certificate is sound but conservative.
We make three claims. First, for message-passing networks whose node states take finitely many values and whose updates depend on neighbor-state counts capped at a constant, this certificate can be computed exactly. The computation is a dynamic program over a tree decomposition of the graph that encodes how flips interact. Its cost is exponential only in that graph's treewidth, not in $|B_\epsilon|$. Second, for physically relevant ε (0.25–1 Å), the treewidth of this interaction graph stays small even though the full 10 Å contact graph has large treewidth. This is an empirical claim, and the first thing we test. Third, the certified fraction will be strongly degree-stratified. Low-degree surface residues, where interface and many catalytic residues sit, will be the least certifiable. Training against the exact worst case on those residues, and treating backbone (sequence-neighbor) edges as unflippable anchors, will close much of that gap. It should do so at lower clean-accuracy cost than densifying the graph with diffusion.
What is new is the combination of three things: a threat model tied to physical coordinate motion and expressed as a discrete edge set, an exact rather than relaxed worst-case certificate, and the use of graph structure (treewidth) to make exactness affordable. Existing work has at most one of these.
Relation to Prior Work
Work on low-degree vulnerability motivates the proposal. Adversarial Attacks on Neural Networks for Graph Data showed that a node's robustness grows with its degree. Minimum Topology Attacks for Graph Neural Networks showed that low-degree nodes need far fewer edge edits to be misclassified. Reliable Graph Neural Networks via Robust Aggregation proved that mean and sum aggregation have breakdown point zero. Its Soft Medoid aggregator tolerates up to half of a neighborhood being corrupted, but only once graph diffusion densifies sparse neighborhoods, which costs clean accuracy. All three studied abstract graphs such as citation networks, with adversarial edits. None studied residue graphs, where the possible edits are dictated by geometry.
On protein graphs, the closest work is Towards Stable Representations for Protein Interface Prediction (ATProt). It treats the bound-to-unbound shape change as a perturbation and regularizes a spectral filter (a filter defined on the graph's frequency components) to be globally smooth. It reaches a median AUC (MedAUC) of 0.928 on unbound DB5.5 structures. Its guarantee is a global Lipschitz-style smoothness bound and it gives no per-residue certificate. We differ by certifying each residue exactly and by measuring where certification fails. Deterministic Certification of Graph Neural Networks against Graph Poisoning Attacks with Arbitrary Perturbations (PGNNCert) gives deterministic certificates by hashing a graph into subgraphs and voting. It was evaluated on PROTEINS and DD, but only for whole-graph classification and against arbitrary training-time edits. We instead target residue-level predictions at test time, under a threat set restricted by geometry.
The parameterized-complexity papers supply the method and one constraint. Courcelle-style evaluation over tree decompositions is the engine. Its well-known weakness is the non-elementary constant hidden in generic automaton compilation, which is why we write the dynamic program directly. Approximate Evaluation of Quantitative Second Order Queries extends this style of evaluation to counting queries. Its counting logic is the right formal home for capped neighbor counts, and its approximation results suggest a fallback if exact counting proves too costly. Enumerating Minimal Solution Sets for Metric Graph Problems constrains the design. Metric problems carry double-exponential lower bounds in treewidth. This is why we precompute all geometry into $B_\epsilon$ before running the dynamic program and do not encode distance reasoning in the logic. Dropping exact realizability is the price of avoiding those lower bounds.
Research Program
The first stage is measurement. We will use PDB structures from the DeepFRI setting (Structure-based protein function prediction using graph convolutional networks), the complexes in DB5.5, and AlphaFold2 models from CAPSUL. For each, we compute treewidth upper bounds using min-fill heuristics, and exact values where solvers finish. We do this for the full 8 Å and 10 Å graphs, for $B_\epsilon$ across ε, and for the flip-interaction graph defined below. We also record each residue's degree, its solvent exposure, and the fraction of its edges lying in $B_\epsilon$. This stage answers Gap 2 directly, and it can falsify the project cheaply. If the interaction graphs routinely exceed treewidth around 6 at 0.5 Å, the exact approach is not viable at useful radii, and we would report that as a negative result.
The second stage is the model. We use a two-layer quantized message-passing network. The node inputs are residue type plus protein language model embeddings, vector-quantized into a codebook. Each layer's node state lives in an alphabet of $S$ symbols, typically 4 to 8. The update depends on the node's own symbol and on how many neighbors hold each symbol, with each count capped at $c$. We train with straight-through gradients. Sequence-neighbor backbone edges form a separate, unflippable edge type. Inputs are fixed under coordinate jitter, so in a two-layer model a flipped edge $(u,w)$ has a precomputed effect on the layer-1 counts of $u$ and $w$. The target's output then depends on those layer-1 states and on flips of edges incident to the target. The variables that must be tracked jointly are therefore the flip edges in the target's two-hop region, coupled through shared endpoints. This interaction graph is a small subgraph of $B_\epsilon$.
The dynamic program processes a tree decomposition of the interaction graph. For each vertex in a bag, it keeps a partial, capped count vector of the flips introduced so far, and it records whether a label change is reachable. Deeper models create longer-range coupling through fixed edges. We will report how treewidth and runtime grow for three-layer models rather than assume they stay small.
The third stage is training. We train with the exact worst case: on residues the dynamic program cannot certify, it returns a violating flip set, and we add those flipped graphs as training examples. We compare this against two alternatives, spending more aggregation weight on the trusted backbone edges, and Soft Medoid with diffusion. All three are evaluated on certified accuracy, broken down by degree.
Baselines
The do-nothing reference is a standard, unquantized residue graph network at 10 Å, in the style of DeepFRI. Its robustness is estimated empirically, using random coordinate jitter and gradient-based coordinate attacks, which give only an upper bound on true robustness. As anchors, DeepFRI reports $F_{max}$ = 0.657 on PDB700 and catalytic-residue AUROC = 0.81 against the Catalytic Site Atlas using Grad-CAM. Our residue classifier is trained directly on catalytic-site labels, so that 0.81 is a reference point rather than a like-for-like target. For each benchmark, the unquantized model trained on the same splits is the accuracy ceiling. A quantized model that falls far below it would make its certificates uninteresting.
The strongest existing method on the interface task is ATProt, at MedAUC 0.928 on unbound DB5.5 structures and 0.925 on AlphaFold2 structures (ATProt paper). We will retrain it on our splits with its published regularizer and the same tuning budget. We will measure its empirical robustness and certify it with a sound bound-propagation relaxation, which tracks interval bounds on activations through the network. This gives it a certified-accuracy number under the same threat set $B_\epsilon$. Beating it means a higher certified fraction of low-degree interface residues at matched ε, while staying within 0.02 MedAUC of its clean score.
Two certified competitors complete the comparison. The first is randomized smoothing over coordinate noise, which certifies a prediction by checking that it holds with high probability when the input is randomly perturbed. The second is a PGNNCert-style partitioned ensemble adapted to residue-level test-time certification. For PGNNCert, the file reports up to 30 certified perturbations on Cora-ML with clean accuracy within 5% of undefended models. No reported result on PROTEINS or DD accuracy was found on Lacuna. Soft Medoid with diffusion is the empirical-defense baseline. Its reported gains are an 8× robustness improvement on low-degree nodes and over 200% higher accumulated certified robustness on Cora ML. There is no reported result on protein graphs.
Three ablations isolate the key ingredient. Replacing the exact dynamic program with bound propagation on the same quantized model separates the value of exactness from the value of quantization. Removing the unflippable backbone edge type tests the anchor hypothesis. Comparing exact worst-case training against training on random-jitter augmentation tests whether the exact counterexamples are what drive the gain.
Why not just…?
Why not just use a smooth distance cutoff so edges never flip? This is the most serious alternative. With radial-basis edge weights that decay smoothly to zero, small coordinate motion changes weights continuously, and a Lipschitz bound then certifies robustness with no discrete search at all. It does not, however, remove low-degree sensitivity. A surface residue with two weighted neighbors is still dominated by them, as the breakdown-point argument of Reliable Graph Neural Networks via Robust Aggregation implies. Lipschitz bounds composed across layers are also usually loose. We will train a smooth-cutoff network with spectral normalization at matched clean accuracy and certify it at the same ε. If it certifies as many low-degree residues as our method, the discrete approach is unnecessary, and we will say so.
Why not just solve the worst-case flip search with an integer program, or by enumeration? For small ε and small receptive fields, enumerating all $2^{|B_\epsilon \cap \text{field}|}$ flip sets or running a mixed-integer solver is exact and simple. Our method has an advantage only if the number of flippable edges grows faster than the interaction graph's treewidth as ε increases. That is the central scaling experiment. We will plot certification time against ε for the dynamic program, enumeration, and a mixed-integer formulation of the same quantized network, and correlate the crossover point with the measured treewidth. If the integer solver keeps pace up to 1 Å, the contribution narrows to the threat model and the degree analysis.
Why not just densify neighborhoods with diffusion, or switch to K-nearest-neighbor graphs? Diffusion protects low-degree nodes, but it lowers clean accuracy (Reliable Graph Neural Networks via Robust Aggregation) and blurs the local contacts that define active sites. It also inflates treewidth, which makes every exact method more expensive. A K-nearest-neighbor graph fixes each residue's degree, but on extended surface loops it adds edges spanning long distances with no physical basis. It also still flips edges at neighbor-rank ties. We run diffusion plus Soft Medoid as a baseline. We additionally report how both densifications change the treewidth of the flip-interaction graph, which quantifies the tension between degree-based defenses and tractable certification.
Proposed Experiments
The first decisive check is the treewidth census. It compares the treewidth of full contact graphs with that of flip-interaction graphs, at 8 and 10 Å cutoffs, for ε from 0.25 to 1.5 Å, separately for experimental and AlphaFold2 structures. Small treewidth for the interaction graphs at ε ≤ 0.5 Å is required for everything that follows.
The second check is degree-stratified certified accuracy. The tasks are catalytic-residue prediction on DeepFRI's PDB structures labeled with the Catalytic Site Atlas, and interface-residue prediction on DB5.5, with DIPS used for pretraining. We report certified accuracy at each ε, broken down by degree band and solvent exposure, for all baselines. The expected signature is a steep gradient in which low-degree residues are certified least. It should shrink under exact worst-case training and backbone anchoring, without the clean-accuracy loss that diffusion causes.
The third check asks whether certificates predict real failures. We train on bound DB5.5 structures and evaluate on unbound ones. Among residues whose local backbone moved by less than ε, certified residues should flip their predictions between bound and unbound states markedly less often than uncertified ones. If certificates carry no information about real conformational change, the threat model is mis-specified.
The final check is the runtime-scaling comparison against enumeration and integer programming described above, together with a three-layer variant to measure how quickly treewidth and runtime grow with depth.
References
- Adversarial Attacks on Neural Networks for Graph Data
- Minimum Topology Attacks for Graph Neural Networks
- Reliable Graph Neural Networks via Robust Aggregation
- Towards Stable Representations for Protein Interface Prediction
- Deterministic Certification of Graph Neural Networks against Graph Poisoning Attacks with Arbitrary Perturbations
- Approximate Evaluation of Quantitative Second Order Queries
- Enumerating Minimal Solution Sets for Metric Graph Problems
- Structure-based protein function prediction using graph convolutional networks
- CAPSUL: A Comprehensive Human Protein Benchmark for Subcellular Localization