Lecture Notes on Verifying Graph Neural Networks
François Schwarzentruber
TL;DR
The notes establish a formal bridge between graph neural networks and logical formalisms by linking GNN computation to WL tests and modal logics with counting. They introduce a counting modal logic K# and its extension K# with global readout to model GNN verification tasks, and provide a PSPACE tableau method for satisfiability. They then show how to encode GNNs as logical expressions and reduce GNN verification to satisfiability problems, including handling of ReLU and quantized activations via truncReLU and existential Presburger arithmetic with star. The work analyzes the expressive limits of color refinement relative to GNNs, details higher-order extensions (k-FWL, k-OWL), and outlines the computational complexity landscape, including NP and PSPACE results, with undecidability results for broad settings. Overall, it offers a rigorous logical toolkit for reasoning about GNN behavior, verification, and equivalence against formal specifications, with practical implications for safety-critical graph-based systems.
Abstract
In these lecture notes, we first recall the connection between graph neural networks, Weisfeiler-Lehman tests and logics such as first-order logic and graded modal logic. We then present a modal logic in which counting modalities appear in linear inequalities in order to solve verification tasks on graph neural networks. We describe an algorithm for the satisfiability problem of that logic. It is inspired from the tableau method of vanilla modal logic, extended with reasoning in quantifier-free fragment Boolean algebra with Presburger arithmetic.
