The logic of rational graph neural networks
Sammy Khalife
TL;DR
The paper analyzes how activation functions shape the uniform expressivity of graph neural networks within the GC2 logic framework. It proves that ReLU GNNs uniformly express all GC2 queries, while rational-activation GNNs cannot uniformly express all GC2 queries, even under favorable assumptions; it introduces the RGC2 fragment and shows rational (and polynomial) GNNs can express it uniformly. The results highlight a nuanced separation between rational and piecewise-linear activations, contradicting the notion that rational activations universally maximize expressivity, and open pathways to identify rationally-expressible logical fragments that GNNs can reliably implement. Overall, the work connects logical expressivity, network activations, and color-refinement dynamics to map the capabilities and limits of modern GNN architectures.
Abstract
The expressivity of Graph Neural Networks (GNNs) can be described via appropriate fragments of the first order logic. Any query of the two variable fragment of graded modal logic (GC2) interpreted over labeled graphs can be expressed using a Rectified Linear Unit (ReLU) GNN whose size does not grow with graph input sizes [Barcelo & Al., 2020]. Conversely, a GNN expresses at most a query of GC2, for any choice of activation function. In this article, we prove that some GC2 queries of depth $3$ cannot be expressed by GNNs with any rational activation function. This shows that not all non-polynomial activation functions confer GNNs maximal expressivity, answering a open question formulated by [Grohe, 2021]. This result is also in contrast with the efficient universal approximation properties of rational feedforward neural networks investigated by [Boullé & Al., 2020]. We also present a rational subfragment of the first order logic (RGC2), and prove that rational GNNs can express RGC2 queries uniformly over all graphs.
