Abstract
The expressivity of Graph Neural Networks (GNNs) can be described via appropriate fragments of first-order logic. While it is established that GNNs using Rectified Linear Unit (ReLU) activations can express any query of the two-variable fragment of graded modal logic (GC2) uniformly across all graph sizes, the power of other activation functions has remained an open question. In this work, we demonstrate that GNNs with rational activation functions are strictly less expressive than their ReLU counterparts. Specifically, we prove that certain GC2 queries of depth 3 cannot be expressed by rational GNNs, answering an open question posed by Grohe (2021). We further introduce a rational subfragment of first-order logic (RGC2) and prove that rational GNNs can express these queries uniformly.
Introduction
In the study of Graph Neural Networks (GNNs), "expressivity" refers to the model's ability to distinguish between different graph structures or to compute specific logical properties. A common benchmark for this capability is the GC2 logic (two-variable graded modal logic). GC2 allows for the description of local graph properties, such as "does this node have at least $k$ neighbors with property $P$?"
Previous research by Barceló et al. (2020) demonstrated a remarkable alignment between GNNs and logic: GNNs using ReLU activations can express any GC2 query uniformly. This means the network's parameters do not need to scale with the size of the input graph to maintain logical correctness. However, a fundamental question remained: is this expressive power a result of the non-polynomial nature of ReLU, or would any non-polynomial activation function—such as rational functions—suffice? This paper investigates the logical limits of rational activation functions (ratios of polynomials) in GNN architectures.
The Limitation of Rational Activations
Rational functions are often considered highly powerful in standard feedforward neural networks, frequently offering better approximation properties than ReLUs. However, this research reveals a divergence in the context of GNNs. The core finding is that rational GNNs cannot compute certain complex logical queries that ReLU GNNs handle with ease.
The Role of the "Kink"
The success of ReLU in representing logic stems from its non-smoothness—specifically, the "kink" at zero. This allows the ReLU function to act as a hard mathematical switch, which is essential for representing the discrete transitions required by logical quantifiers and negations. Rational functions, by contrast, are smooth. While they can approximate switches, they cannot maintain a perfect logical "0" or "1" across all possible graph sizes when the network parameters are fixed.
Theoretical Framework: Rooted Trees and Symmetry
To prove these limitations, the study employs tools from algebraic geometry and mathematical logic. The author constructs specific test cases using rooted unicolored trees ($T[k_1, \dots, k_m]$), where a root node has $m$ neighbors, each of which is the root of a subtree with $k_i$ leaves.
By analyzing the messages passed within the GNN, the author proves that for these structures, the message a node receives is a symmetric rational function of its neighbors' degrees. Because the mathematical degree of these rational functions is fixed and independent of the number of neighbors, the GNN cannot "flip" its output correctly to match the logical negation required by certain GC2 queries as the number of neighbors tends toward infinity.
Key Results
1. The Failure to Express GC2 (Theorem 3.7)
The paper identifies a specific logical query ($Q_p$)—which asks if all neighbors of a node have a degree of at least $p$—and proves that no GNN with rational activations can express it uniformly. This confirms that not all non-polynomial activations confer maximal expressivity, answering Grohe’s 2021 challenge.
2. The Problem with Nested Negation (Corollary 3.8)
The research shows that rational GNNs struggle specifically with logical negation when it is nested within neighbor-counting quantifiers. The smoothness of the rational function prevents it from effectively simulating the sharp boundaries required by nested logical operations.
3. Defining RGC2 (Theorem 5.2)
Despite these limitations, rational GNNs are not without logical power. The author defines a new fragment of logic called RGC2 (Rational GC2). In this fragment, existential quantifiers are aligned in a way that avoids the nested negations that trap rational functions. The paper proves that rational GNNs can indeed express any query in the RGC2 fragment uniformly over all graphs.
Conclusion and Future Directions
This research highlights a critical distinction between function approximation in standard networks and logical expressivity in GNNs. While rational functions are excellent approximators, the recursive and structured nature of GNNs makes the non-smoothness of ReLU a distinct advantage for logical reasoning.
Future work remains to explore whether other common activations, such as sigmoidal functions (tanh or sigmoid), suffer from similar logical blind spots. Additionally, the question of non-uniform expressivity—where the GNN is allowed to grow in size relative to the graph—remains open. Finally, while this paper addresses what a GNN can represent, the question of how easily these logical functions can be learned via gradient descent remains a vital area for future empirical study.
Summary updated