We Cannot Guarantee Safety: The Undecidability of Graph Neural Network Verification

Marco Sälzer, Martin Lange

Abstract

Output reachability and adversarial robustness are among the most relevant safety properties of neural networks. We show that in the context of Message Passing Neural Networks (MPNN), a common Graph Neural Network (GNN) model, formal verification is impossible. In particular, we show that output reachability of graph-classifier MPNN, working over graphs of unbounded size, non-trivial degree and sufficiently expressive node labels, cannot be verified formally: there is no algorithm that answers correctly (with yes or no), given an MPNN, whether there exists some valid input to the MPNN such that the corresponding output satisfies a given specification. However, we also show that output reachability and adversarial robustness of node-classifier MPNN can be verified formally when a limit on the degree of input graphs is given a priori. We discuss the implications of these results, for the purpose of obtaining a complete picture of the principle possibility to formally verify GNN, depending on the expressiveness of the involved GNN models and input-output specifications.

Introduction

As neural networks are increasingly deployed in safety-critical systems—from medical diagnosis to autonomous traffic management—we need more than just high "test accuracy." We need formal verification: a mathematical guarantee that a model will never produce a dangerous output for a given set of valid inputs.

While verification techniques for standard "grid-like" data (like images) are well-studied, Graph Neural Networks (GNNs) present a unique challenge. Unlike an image with a fixed number of pixels, a graph can have any number of nodes and edges. This "unbounded" nature of graph data makes it unclear whether we can ever build an algorithm that reliably checks a GNN's safety properties, such as its robustness against adversarial attacks.

Theoretical Framework

The researchers focus on Message-Passing Neural Networks (MPNNs), the most common framework for GNNs. They investigate two primary safety properties:

  1. Output Reachability (ORP): Can the model ever produce an output within a specific "forbidden" range given valid inputs?
  2. Adversarial Robustness (ARP): Does the model consistently classify similar graphs into the same category?

To find the limits of verification, the authors use two distinct mathematical approaches. For the "Impossible" results, they use a technique called reduction. They show that if we could verify a graph-classifier MPNN, we could also solve "Post’s Correspondence Problem"—a classic puzzle in computer science known to be undecidable (impossible for any computer to solve).

A visual representation of the reduction to Post's Correspondence Problem, used to prove the undecidability of graph-level classification.

For the "Possible" results, they exploit the tree-model property. Since an MPNN with $k$ layers only looks at a node's $k$-hop neighborhood, the "view" from any single node looks like a tree. If the graph's degree is bounded, there are only a finite number of these tree structures to check.

The Decidability Landscape

The core contribution of this work is the mapping of the "decidability landscape." The complexity of aggregation is the primary hurdle; graph-level classification is fundamentally harder to verify than node-level classification. Because graph classifiers aggregate information from the entire graph into a single output, an adversary can hide complex, "unsolvable" logic patterns within the structure of a very large graph.

The decidability landscape of GNN verification, showing the transition from verifiable (green/gray) to non-verifiable (red) properties as input and output specifications become more complex.

The results show that graph classification is undecidable for graphs of any size with expressive labels. Conversely, node-level classification is formally verifiable, provided the maximum degree of the input graphs is known in advance. This "Bounded Degree" escape hatch suggests that the "infinite" nature of graphs isn't the only problem; it's how nodes branch out. If we can promise that no node has more than d neighbors, the local world of the GNN becomes small enough to be mathematically exhaustible.

Discussion and Future Work

This research establishes a unified theoretical framework, showing that many existing "robustness certificates" in the literature are actually special cases of these positive results. However, several open questions remain:

  • The "Unknown" Zone: There is still a "gray area" in the landscape between bounded-degree graphs and totally unbounded graphs where the possibility of verification remains an open question.
  • Model Expressivity: These results apply to standard MPNNs. More powerful GNN variants (like those that can detect cycles or use "global" nodes) might be even harder—or perhaps impossible—to verify even in the node-classification case.
  • Logical Specifications: The impossibility results depend on having "sufficiently expressive" node labels. If the labels are extremely restricted, verification might become possible again, which is a potential avenue for future research.

Summary updated

BibTeX
@inproceedings{salzer2023we,
  author = {Marco Sälzer and Martin Lange},
  title = {{We Cannot Guarantee Safety: The Undecidability of Graph Neural Network Verification}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=WlbG820mRH-},
}
Figure