At the heart of most Graph Neural Networks lies the principle of message passing. This mechanism allows nodes in a graph to iteratively aggregate information from their local neighborhoods, effectively enabling the network to learn representations that capture both node features and the graph's topology. While you may be familiar with the basics from introductory material, we will now examine the generalized message passing framework more formally and discuss its inherent limitations, particularly concerning expressive power.
Many popular GNN architectures can be unified under a common framework. In this framework, each node v updates its hidden state hv at layer k based on its own state and the states of its neighboring nodes N(v) from the previous layer k−1. The update process for a single node v at layer k is typically defined by two functions: AGGREGATE
and UPDATE
:
Let's break down the components:
AGGREGATE
is permutation invariance. Since nodes in a neighborhood do not have a natural order, the aggregation function must produce the same output regardless of the order in which neighbor features are processed. Common choices include element-wise sum, mean, or maximum operations.
SUM
: AGGREGATE=∑u∈N(v)hu(k−1)MEAN
: AGGREGATE=∣N(v)∣1∑u∈N(v)hu(k−1)MAX
: AGGREGATE=maxu∈N(v){hu(k−1)} (element-wise max)Different GNN models instantiate this framework with specific choices for AGGREGATE
and UPDATE
. For example:
While flexible, this message passing framework has fundamental limitations in its ability to distinguish between different graph structures. The expressive power of a GNN refers to its capacity to map non-isomorphic graphs (graphs with different structures) to different representations or outputs. Ideally, a powerful GNN should be able to distinguish between any two graphs that are not structurally identical.
How can we measure this? A common benchmark is the Weisfeiler-Lehman (WL) test of graph isomorphism. Specifically, the 1-WL test (the simplest variant) provides an upper bound on the discriminative power of standard message-passing GNNs.
The 1-WL test is an iterative algorithm that aims to determine if two graphs are non-isomorphic. It works by assigning an initial "color" (or label) to each node (often based on node degrees or initial features) and then iteratively refining these colors based on the colors of their neighbors:
The connection between the message passing framework and the 1-WL test becomes apparent when comparing their update steps. The AGGREGATE
function in a GNN effectively computes a representation of the multiset of neighbor features {hu(k−1):u∈N(v)}. The UPDATE
function then combines this aggregated information with the node's own previous state hv(k−1) to produce the new state hv(k).
This process directly parallels the 1-WL test's aggregation of neighbor colors (multiset Mv(k−1)) and subsequent hashing with the node's current color cv(k−1) to generate the new color cv(k).
The critical insight, proven formally by Morris et al. (2019) and Xu et al. (2019), is that standard message-passing GNNs (using permutation-invariant aggregators like sum, mean, max) cannot be more powerful than the 1-WL test. If the AGGREGATE
and UPDATE
functions are injective (meaning they map distinct inputs to distinct outputs, like a perfect hash function in 1-WL), the GNN achieves the maximum expressive power equivalent to the 1-WL test (as GIN does). However, they cannot surpass it.
This theoretical upper bound means that any two graph structures that the 1-WL test cannot distinguish, a standard message-passing GNN also cannot distinguish. The 1-WL test is known to fail on certain classes of graphs, such as distinguishing some regular graphs (where all nodes have the same degree).
Example of two non-isomorphic graphs (a 6-cycle and two disjoint 3-cycles) that the 1-WL test, and thus standard message-passing GNNs, cannot distinguish if initial node features are uniform. Both are 2-regular graphs.
If all nodes start with the same initial feature vector h(0), after one layer of message passing, all nodes in both graphs will have identical representations (since every node has two neighbors with feature h(0)). This identity persists through subsequent layers. Consequently, a GNN based purely on this framework cannot differentiate between these structures for tasks like graph classification.
Understanding this limitation is important. It motivates the development of more powerful GNN architectures, often referred to as "higher-order" GNNs or models incorporating subgraph information, which aim to overcome the constraints of the basic message passing paradigm and the 1-WL test. We will explore some of these advanced architectures and techniques in subsequent chapters. For now, recognizing the power and the boundaries of the standard message passing framework provides a solid foundation for appreciating these more complex models.
© 2025 ApX Machine Learning