Exponentially Improving the Complexity of Simulating the Weisfeiler-Lehman Test with Graph Neural Networks
Anders Aamand, Justin Y. Chen, Piotr Indyk, Shyam Narayanan, Ronitt Rubinfeld, Nicholas Schiefer, Sandeep Silwal, Tal Wagner
Introduction
Graph Neural Networks (GNNs) have become a popular tool for machine learning on graph-structured data, with applications in social network prediction [HYL17], traffic prediction [YYZ18], recommender systems [YHC+18], drug discovery [WKK+20], computer vision [LGD+19, FLM+19, MBM+17, QSMG17], and combinatorial optimization [CCK+21]. Standard message passing GNNs use the topology of the input graph to define the network structure: in each step , a node aggregates messages from each of its neighbors and combines them using a function , computed by a neural network, to determine its message for the next round. Crucially, the aggregation function must be symmetric, to ensure that the output of GNNs is invariant under node permutation. This restriction raised questions about how expressive such network architectures are, and in particular what classes of graphs are distinguishable using GNNs.
The seminal works of Xu et al. [XHLJ19] and Morris et al. [MRF+19] (see also [Gro21]) showed that GNNs are exactly as powerful in distinguishing graphs as the Weisfeiler-Lehman (WL) test [WL68], also known as color refinement. This combinatorial procedure is a necessary but not sufficient test for graph isomorphism. It proceeds in repeated rounds: in each round, a node labels itself with the “hash” of the multiset of labels of its neighbors. The aforementioned papers show that (i) GNNs can simulate the WL test and (ii) GNNs can only distinguish those graphs that the WL test determines to be different. This provides a complete characterization of the expressive power of GNN architectures.
The connection between GNNs and the WL test has spawned a wave of new results studying GNN variants that either match the distinguishing power of the WL test or adopt new methods beyond message passing on the edges of the input graph to overcome this barrier (see the excellent surveys [MFK21, MLM+21, Gro21] for an overview of this area). However, the results in the original as well the follow up works mostly focus on qualitative questions (how expressive GNNs are) as opposed to quantitative questions such as the network complexity. In particular, while Xu et al. [XHLJ19] show that there exist GNN architectures that can simulate the WL coloring procedure as long as the aggregation step is injective, they rely on the universal approximation theorem to show that there exists a neural network that can simulate the hash function used in WL. As a result, the size of the network could be exponential in the number of nodes . In contrast, the construction of Morris et al. [MFK21] uses networks of size polynomial in . However, the weights of the network implementing in their construction depend on the structure of the underlying graph, which suffices for node classification, but is not sufficient for the context of graph classification.
Overall, the quantitative understanding of the complexity of simulating WL remains an open problem. Indeed, the survey [Gro21] states “The size of the GNNs and related parameters like depth and width, which directly affect the complexity of inference and learning, definitely require close attention.”
The main question addressed in this work is: what is the simplest (in terms of the number of neural network units and message length) GNN capable of simulating the WL test? Equivalently, at what point does a GNN become so small that it loses its expressive power?
Our main result is a highly efficient construction of a GNN architecture that is capable of simulating the WL test. For graphs with nodes, it can simulate steps of the WL test, such that the neural network implementing in each round has parameters, and the messages exchanged by the nodes of the GNN in each round consist of bits. This offers at least an exponential improvement over the prior bounds obtained in [XHLJ19, MRF+19] (see Table 1), extending the equivalence between the WL test and the expressive power of GNNs to neural networks of reasonable (in fact, quite small) size. Furthermore, our architecture is simple, using vector sum for aggregation and ReLU units for the combine function . Finally, our construction can be generalized to yield a depth-size tradeoff: for any integer , we can can construct a neural network of depth and size .
To achieve this result, our construction is randomized, i.e., some weights of the neural networks are selected at random, and the simulation of the WL test is correct with high probability . Thus, our construction can be viewed as creating a distribution over neural networks computing the function .Note that selecting at random is quite different from random node initialization, e.g., as investigated in [ACGL21]. In particular, in our model all nodes use the same function (with the same parameters), without breaking the permutation invariance property of GNNs, as in the standard GNN model. In particular, this implies that, for each graph, there exists a single neural network implementing that accurately simulates WL on that graph. The size of the network is exponentially smaller than in [MRF+19], although the construction is probabilistic.
We complement this results with two lower bounds for executing a WL iteration. Our first lower bound addresses the communication complexity of this problem, and demonstrates that to solve it, each node must communicate labels that are at least bits long, matching the upper bound achieved by our construction. Our second lower bound addresses the computational complexity, namely the parameters of the neural network. It shows that if the messages sent between nodes are vectors with entries in , then the network implementing must use ReLU units.
The equivalence between the discriminative power of GNNs and the WL test has been shown in the aforementioned works [XHLJ19, MRF+19]. A strengthened version of the theorem of [XHLJ19], where the same combine function is used in all iterations (i.e., for all ) appeared in the survey [Gro21]. Many works since have studied various representational issues in GNNs; we refer the reader to excellent surveys [Gro21, HV21, MLM+21, Jeg22]. In particular, [Lou19] established connections between GNNs and distributed computing models such as LOCAL and CONGEST, and derived lower bounds for several computational tasks based on this connection. [CVCB19] drew a connection between the expressiveness of GNNs in graph isomorphism testing and in function approximation. [BKM+20] studied the expressiveness of GNNs in computing Boolean node classifiers, and [GMP21] studied the expressiveness of graph convolutional networks (GCNs).
The emergence of WL as a barrier in GNN expressivity has also led to a flurry of work on enhancing their expressivity by means of more general architectures. These include higher-order GNNs inspired by higher-dimensional analogs of WL [MRF+19, MBHSL19], unique node identifiers [Lou19, VLF20], random node initializations [ACGL21, SYK21], relational pooling [MSRR19], incorporating additional information on the graph structure [NM20, BGRR21, BFZB22, CMR21, TRWG21], and more. We refer to [MLM+21] for a comprehensive survey of this line of work.
1 Preliminaries
For the rest of the paper, we use to denote the neighborhood of in a graph including itself, and we use to denote multisets rather than sets.
Let be a graph with nodes. GNNs use the graph structure of to learn node embeddings for all the nodes across multiple iterations. Let denote the embedding vector of node in the th iteration. The vectors represent the initial node embeddings. In every iteration , each node sends its current embedding to all its neighbors, and then computes its new embedding by the equation
where is implemented by a neural network with ReLU activations (note that may differ across different iterations ). The function is called the ‘aggregate’ function, and is called the ‘combine’ function. The embeddings at the final iteration can be used for node classification. For graph classification, they can be aggregated into a graph embedding with a ‘readout’ function,
The WL test [WL68] is a popular heuristic for the graph isomorphism problem. While the exact complexity of this problem remains unknown [Bab16], the WL test is a powerful heuristic capable of distinguishing a large family of graphs [BK79].
A WL iteration gets existing labels for all nodes, and outputs new labels given by
for an aggregate function and neural network with random weights. We say the iteration is successful if for all , the following holds:
If then with probability 1, and
If then with probability ,
where the probability is over the choices of the random weights of .
2 Overview of Our Techniques
In this section we give an overview of our GNN architectures for simulating WL. To explain our ideas in stages, we begin with a simpler construction of a polynomial size GNN. It is far larger than the ultimate polylogarithmic size we are aiming for, but forms a useful intermediate step toward our second and final construction.
Recall that the th WL iteration, for a node , aggregates the labels of its neighbors from the previous iteration, , and hashes them into a new label for . Our GNNs aggregate by summing, i.e., they sum into , and then hash the sum into using a ReLU neural network of our choice.
We now proceed to describe our polylogarithmic size construction. The weak point in the previous construction was the wasteful use of one-hot encoding vectors, which caused the width to be . In the current construction, we still wish to hash into bins — that is, to have distinct possible labels in each iteration — but we aim to represent them using bitstrings of length , thus exponentially improving the width of the network. That is, for every node and iteration , the label would now be a vector in . The challenge is again to avoid the two failure modes above, ensuring that the failure probability does not exceed . Since we cannot use one-hot encoding, we need to devise another method to avoid the first failure mode, i.e., ensure that with high probability if .
To this end, suppose for a moment that we had access to a truly random vector . Then each node , instead of sending the one-hot encoding of its label , we could instead send the dot product , which is the single bit . Each node thus receives the bits from its neighbors and aggregates them into the sum , which, by linearity, is equal to (using the notation from Construction 1). It is easy to observe that if then with probability at least . Repeating this process independent times decreases the collision probability to the requisite . Thus, we can define a new labeling scheme that concatenates dot products with independent random vectors as just described, failing at the summing operation with probability at most . The second failure mode (hashing) can again be handled as before.
That catch is that, since has length , the overall number of parameters in the GNN would again be at least . To avoid this, we appeal to the computational theory of pseudorandomness. The idea is to replace the random vector with an efficient pseudorandom analog. Note that the above approach goes through even if the probability that is slightly larger than , say for a small constant . It is well-known in complexity theory that there exist pseudo-random generators, called -biased spaces, that generate vectors satisfying this property given only truly random bits.Technically, they guarantee this property only when are binary vectors, but Lemma 3.2 shows how to extend this property to general integer vectors as well. Crucially, each bit of can be computed using a threshold circuit with size polynomial in and constant depth (Theorem C.1), which translates to a ReLU neural network with the same parameters (Lemma C.2). Using these generators in our GNN to implement a pseudorandom (-biased) analog of yields our final construction.
First Construction: Polynomial-size GNN
Our first construction towards Definition 1.1 is exponentially larger compared to our final optimized construction of Section 3. Nevertheless, it is instructive and motivates our optimized construction.
Let denote the label of a vertex in the th iteration. For our first construction, we will always maintain the invariant that will be a one-hot encoded vector in for all and all iterations . will be a prime which also satisfies . As stated previously, the aggregate function will just be the sum function. Our construction for the neural network used in the th iteration, , will take in the sum of the neighbors labels according to Equation (1.1) and output a one-hot encoded vector in .
Our construction for is the following: First recall the notation from (simplified) Equation 1.1:
then computes .
Altogether, can be summarized as: .
Note that we set the initial labels to be the same starting vector for all vertices (any one-hot vector). This matches the WL test which also initializes all nodes with the same initial label. Furthermore, the weights of are independent: the random vector is sampled independently for each iteration.
The following lemma proves that the above construction satisfies the requirement of Definition 1.1. Its proof is given in Appendix B.
Let and denote the multiset of neighborhood labels for vertices and respectively. If the multisets are distinct then the labels computed for and in the th iteration are the same with probability at most . If the multisets are the same then the labels are the same, i.e., the th iteration is successful according to Definition 1.1.
We now evaluate the size complexity of implementing our construction via a neural network . Note that Step of the construction can be done with layer as it simply involves taking an inner product. The main challenge is to implement the modulo function. We give the following construction in Section B.1 of the appendix.
Suppose . There exists an explicit construction of a network which computes modulo in the domain using a ReLU network with hidden units and depth. More generally, given an integer parameter , the function can be computed with hidden units and depth.
Directly appealing to the theorem above, we can implement modulo required in Step of the construction using a neural network with units, depth . In addition, we need only bits to represent the weights.
Finally, Step of our construction requires outputting a one hot encoding. We can do this by inputting (the output of Step of the construction) into indicator functions, each of which detect if is equal to a particular integer in . Each indicator function can be implemented via ReLU nodes as follows. Let
which can be easily implemented as a ReLU network. (Note and .) It can be checked that and for all other integers and that can be implemented with ReLU function compositions. Thus, Step of the construction requires hidden layers and total hidden units. Altogether we have proven the following result.
There exists a construction of a neural network which performs a successful iteration according to Definition 1.1 with failure probability . has depth , hidden units, and requires bits of precision. Furthermore, all labels in all iterations are vectors in . More generally, given an integer parameter , the function can be computed with hidden units and depth.
In the standard WL test, the number of iterations is chosen to be . Thus the right setting of in Theorem 2.3 is which gives us depth , hidden units, and requires bits of precision in addition to labels in dimension .
Second Construction: Polylogarithmic-size GNN via Pseudo-randomness
We now present a more efficient construction of a GNN which simulates the WL test with an exponential improvement in the number of hidden units and label size. To motivate the improvement, we consider Step of the prior construction which outputs a one-hot encoding. The one-hot encoding was useful as it allowed us to index into a uniformly random vector (which we then sum over mod in order to hash the neighborhood’s labels). However, this limited us to use feature vectors of a large dimension and required many hidden units to create one-hot vectors. Instead of working with one-hot encodings as an intermediary, we will directly compute the entries of the random vector as needed. This has two advantages: we can significantly reduce the dimension of the feature vectors as well as reduce the total size of the neural networks used. We accomplish this via using pseudo-random vectors whose entries can be generated as needed with a small ReLU neural network (see Corollary 3.3). This allows us to use node labels in dimension as opposed to .
The random vectors we employ have their entries generated from an -biased sample space. These are random vectors which are approximately uniform and they have been well-studied in the complexity-theory literature. We recall some definitions below.
A probability distribution over is called an -biased sample space if holds for all non-empty subsets .
Note that the uniform distribution has bias . We now state our construction for the neural network used in the th iteration, . We recall that denotes the label of a vertex in the th iteration.
Our construction for is the following:
Let be a prime of size which is at least .
For each node , computes where every entry of is uniformly random in . Note is the output of the aggregation .
Let for be vectors which are independently drawn from an -biased sample space for a sufficiently small constant .
The output will be a dimensional binary vector where the -th coordinate is equal to the -th coordinate of the vector . In other words, where denotes the -th coordinate of .
We now prove the correctness of our construction. We will refer to computed in Step of the construction as the index of for the th iteration. To prove the correctness of the above construction, it suffices to prove the lemma below which shows our construction satisfies Definition 1.1.
Let and denote the multiset of neighborhood labels for vertices and respectively. If the multisets are distinct then the labels computed for and in the th iteration are distinct with probability . If the multisets are the same then the labels are the same, i.e., the th iteration is successful according to Definition 1.1.
We first need the following auxiliary lemma about -biased sample spaces, proven in Section C.
Note that this lemma is necessary, as we will be computing dot products of with integer vectors (over integers), not with binary vectors modulo .
Let denote the input for and analogously, define to be the input for . We first show that if is not equal to (as multisets) then with sufficiently large probability. We further consider the case that since for (the first iteration), the statement follows since all node labels are initialized to be the same. Let be the indices computed in Step of iteration (which are used to construct the node labels in iteration ). Note that there is a one to one mapping between and . Thus we can assume without loss of generality.
We now condition on . Without loss of generality, suppose that their first coordinates, and , differ. We know since , they are both non-negative and bounded by , and whereas is a prime at least . It follows that the probability of the event is at most . To see this, condition on all the entries of except . Then must be equal to a specific value modulo for to hold, as desired. We now condition on this event which equivalently means we condition on (see Step of the construction).
We now analyze the overall complexity of representing as a ReLU neural network. First we state guarantees on generating -based vectors using a ReLU network. The following corollary is proven in Appendix C.
Let . For every and , there exists an explicit ReLU network which takes as input uniform random bits and an index and outputs the th coordinate of an -biased vector in . uses bits of precision and has hidden units. More generally, given an integer parameter , the function can be computed with hidden units and depth.
We can now analyze the complexity of our construction. The complexity can be computed by analyzing each step of the construction separately as follows:
For every node , the sum of feature vectors of neighbors from the prior iteration, , is returned by the aggregate function .
The inner product with the random vector in Step of the construction can be computed using one layer of the network. Then computing modulo can be constructed via Theorem 2.2.
Given the inner product value which is the output of Step of the construction, we compute all of the coordinates of in parallel. We recall that each coordinate of is indexing onto -biased random vectors and we use the same index for all vectors, namely the -th index. This can be done as follows. We first have edges fanning-out from the node which computes . For all , the other endpoint of the -th fan-out edge computes the value where is the -th -biased vector as stated in Steps 4 and 5 of the construction. This can be done by appealing to the construction guaranteed by Corollary 3.3. The result of this computation is exactly .
Altogether, we have proven the following theorem.
There exists a construction of which performs a successful WL iteration according to Definition 1.1 with . has depth , hidden units, and requires bits of precision. All labels in all iterations are binary vectors in . More generally, given an integer parameter , the function can be computed with hidden units and depth.
Lower Bounds
We complement our construction with lower bounds on the label size and number of ReLU units required to simulate the WL test. We outline these two lower bounds below and defer the full details to Appendix D.
Recall that in our construction, the message (label) size was bits. Via communication complexity, we give a corresponding lower bound. In particular, we construct a graph on which any (randomized) communication protocol which simulates WL as in Definition 1.1 must send at least bits along one edge of the graph. As message-passing GNNs are a specific class of communication protocols, this immediately implies that the message sizes must have bits, so our construction is optimal in that respect.
The hard instance is formed by a graph which is a collection of disjoint star subgraphs of sizes ranging from to . In order to perform a valid WL coloring, each node must essentially learn the size of its subgraph, requiring bits of communication. In addition, this must be done in only iterations as the depth of each subgraph is , so some node must send bits to its neighbors in a single round. See Appendix D.1 for the full details and proof.
In order to show a lower bound on the number of units needed to implement a successful WL iteration, we rely on prior work lower bounding the number of linear regions induced by a ReLU network (for instance [MPCB14]). In particular, these works show that ReLU networks induce a partition of the input space into convex regions (where is a function of the size of the network) such that the network acts as a linear function restricted to any given region. Using these results, we describe a fixed graph and a distribution over inputs to the neural network for all (sums of the labels from the previous round) which includes potential special pairs of nodes (where is defined such that inputs for some ). For each such pair , their neighborhoods have different multisets of inputs, but both multisets of inputs sum to the same value. We show that if the number of linear regions is small, , then it is relatively likely that will be in the same linear region and thus their sums will collide: even while their neighborhoods had distinct inputs in the st round.
This immediately gives a lower bound on the number of ReLU units (and thus number of parameters) with more refined depth/width tradeoffs given in Section D.2.1. Note that is the size of each coordinate in the sum of labels. Even if the labels are binary, can be as large as , depending on the max degree in the graph, which implies a lower bound on the number of ReLU units. See Section D.2 for full details and proof.
Experiments
To demonstrate the expressivity of our construction, i.e., that our small-sized GNN reliably simulates the WL test, we perform experiments on both synthetic and real world data sets. Common to all of our experiments is that we start with some graph (either real world or generated with respect to some probability distribution). We then simulate a perfect run of the WL test on where any two nodes which receive different multisets of labels in iteration get distinct labels in iteration with probability as well as a run of our construction fromSince our goal is to test whether our protocol correctly simulates WL test with small messages, we are not implementing the actual GNNs but instead we are simulating their computation. Further, for simplicity, we replaced the -biased sample space with a random string, which guarantees . Section 3. At any point in time, the node labels induce partitions of where two nodes are in the same class if they have the same labels. Denote the partitions after -iterations using the perfect simulation and our construction respectively by and . Letting be minimal such that (at which point the WL labels have converged), we consider the implementation using our GNN successful if for all , i.e., if the the simulation using our implementation induced the same partitions as a perfect runs. For all of our experiments it turned out that (see [BK22] for a discussion of this fast convergence).
We generated Erdős-Rényi random graphs with for a varying number of vertices . For each value of , we generated five such graphs and for each of these five graphs, we ran 10 independent trials of our GNN implementation with message sizes . Averaging over the five graphs, we report the minimal such that at least of the 10 iterations successfully simulated the WL test. See Figure 2(a). The average message size needed to achieve this is approximately where the logarithmic dependence on is as predicted theoretically and significantly improves on the linear message size required for prior constructions.
We generated samples of the scale free graphs from [BBCR03] with a varying number of vertices using the implementation from [HSS08]. Our experiment design was the same as for Erdős-Rényi random graphs. See Figure 2(b).
We finally ran experiments on the real world graph Corahttps://graphsandnetworks.com/the-cora-dataset/ which is the citation network of scientific publications. We simulated our GNN with varying message lengths, for each message length reporting the fraction of successful runs of independent trials. See Figure 2(c) for a plot of the results. We see that with message length , all of the trials successfully simulated the WL test.
Anders Aamand is supported by DFF-International Postdoc Grant 0164-00022B from the Independent Research Fund Denmark. This research was also supported by the NSF TRIPODS program (award DMS-2022448), NSF award CCF-2006664, Simons Investigator Award, MIT-IBM Watson AI Lab, GIST- MIT Research Collaboration grant, NSF Graduate Research Fellowship under Grant No. 1745302, and MathWorks Engineering Fellowship.
References
Appendix A Omitted Proofs of Section 1
Consider some iteration . Suppose we have the following guarantee on the node label inputs for the th iteration (note the inputs are the output labels of the previous iteration):
Appendix B Omitted Proofs of Section 2
We now reduce the modulo case to the construction of the triangular wave function.
Appendix C Omitted Proofs for Section 3
We first need to define the circuit class TC0.
For inputs the output of a threshold gate, TH, is
TC0 is the class of boolean functions computed by constant-depth -size circuits with threshold gates.
It is known that -biased vectors can be generated using an efficient circuit in TC0.
Let . For every and , there exists an explicit TC0 circuit which takes as input uniform random bits and an index and outputs the th coordinate of an -biased vector in . uses threshold gates.
Note that the guarantees of Theorem C.1 are not directly applicable since we need to use a ReLU network instead of threshold gates. Nevertheless, since the circuit guaranteed by Theorem C.1 has integer inputs in all gates, we can easily approximate each threshold gates using an appropriately scaled ReLU. This is a straightforward and known reduction but we briefly outline a procedure in Lemma C.2.
Consider the threshold gate TH: which computes the threshold . Assume that are all integers bounded by . TH can be computed by a ReLU network using bits of precision and a constant number of parameters.
It is for all integers and for all integers , i.e., it computes the threshold . By shifting and scaling , we can now compute the threshold for any integer . Finally, the sum can be computed using one additional layer. Since all parameters are integers, we only require bits of precision to store the shifting and scaling factors. ∎
Lastly, we remark that as per the definition of a threshold gate in Definition C.1, Theorem C.1 requires the index to be inputted as a binary string with its bits given on individual nodes. However, this presents a slight inconsistency with the statement of Theorem C.1 and its corollary, Corollary 3.3 which is used in the construction of Section 3. Specifically, Step of the construction of Section 3 outputs the actual integer which we use as the index for our -biased vector, which does not match the format required by Theorem C.1. This inconsistency is straightforward to fix without having any impact whatsoever in the asymptotic size complexity of the neural network. We simply take the integer outputted by Step of the construction and compute the th bit of for all in parallel. The th bit is exactly equal to if and only if and otherwise. Note that for all and we can easily compute each by appealing to Theorem 2.2. This only requires extra depth and an additional hidden units and bits of precision. The more general trade-off of Theorem 3.4 also readily holds.
Appendix D Lower bounds
In this appendix we provide lower bounds on the complexity of graph neural networks that are able to simulate the WL test. We present both a communication complexity lower bound and a lower bound on the number of ReLU units of the GNN. More concretely, in Section D.1, we prove that in order to maintain the invariant that with at least some constant probability, nodes with isomorphic neighborhoods get the same label while nodes with non-isomorphic neighborhoods get different labels, some message sent between nodes must be of length at least . This bound matches the upper bound of Theorem 3.4. Second, in Section D.2, we consider a more specific although still fairly general lower bound model which captures the implementation of the WL test using neural networks. We suppose that the messages sent between nodes are -dimensional vectors with integral entries. We moreover suppose that each node combines its received messages by summing them to get a vector in (here, ) and applying a collectively agreed upon neural network with at most ReLU units to this sum. We show that if the combination of summing neighborhoods and applying the neural network maps distinct multisets to distinct elements with at least some constant probability, then . Moreover, parametrizing in terms of the depth and width of the neural network, we obtain a more fine-grained lower bound, demonstrating that for shallow neural networks, we need even more ReLU units. In Remark D.5, we point out that our lower bound holds even if the aggregation function is itself a neural network with a bounded number of ReLU units. As a node in an -node graph could have up to neighbours, we need at least in order to store the sum of the messages from the neighbors of the nodes. With this assumption, the lower bound thus becomes which matches our upper bound up to factors. It remains an interesting open problem to bridge the gap between the upper and lower bound.
For both our lower bounds we assume that the nodes have access to an infinite public string of random bits. In Section D.2, this is the string which the nodes use to collectively agree on some neural network network with respect to some distribution on such networks with at most ReLU units.
We consider a forest graph composed of pieces , for . Each piece consists of a “top” node , which is only connected to a “middle” node , which in turn is connected to “bottom” nodes , and is simply a duplicate of (with vertices , and for ). See Figure 3 for a depiction of . We note that after two rounds, each (and ) should know the respective value of , because the local graph of depth around is distinct for each .
Suppose there exists a public random string that every node of has access to, and each node additionally has some independent private randomness. Suppose there is a communication protocol where by the end, with probability at least , the following hold.
For every , the top nodes and output the same value.
Then, there must be some such that the edge or the edge has at least total bits of communication. Hence, if there are only rounds of communication, one of those rounds must have sent bits of communication across the edge.
First, we note that we may assume the communication is one-way from to . This is because the node can simulate all communication from , as has no information about neighbors apart from . So, we just need to show the one-way communication complexity is . Next, we will assume there is no public randomness - we will remove this assumption at the end. So, each (resp., ) receives at most bits of information from (resp., ). If sends a randomized message of length to and uses this message to produce some output , with probability at least the outputs must all be distinct. In addition, for each , the outputs of the duplicate copies of must be the same with probability at least . Our goal is to show that
To finish, we revisit the fact that we assumed there was no public randomness. Let us reintroduce the random string that every node of is given. We assume that with probability at least , the top nodes have the same output for all and that the nodes output pairwise distinct values. But as this event happens with probability at least over a random string , there must exist a choice of for which it happens with probability at least conditioned on . But then we are back to the case where there is no public randomness, as desired. ∎
D.2 Lower Bound: ReLU Units
We would like our GNN to satisfy that for any -node graph , and arbitrary inputs to the nodes, it holds with probability at least over the randomness of that for all such that the multisets and are different. The following theorem provides a lower bound on the number of ReLU units needed for this property to hold.
Suppose that the neural networks in have at most ReLU units. Then there exists a graph on nodes and inputs such that if are the neighborhoods of the nodes of , then with probability at least , there exists such that even though the multisets and are different. Thus, to simulate the WL test with neural networks from , we need ReLU units.
Before proving the theorem, we first explain how to interpret it as a lower bound for the computational complexity of implementing a WL iteration as in Definition 1.1 as a neural network. As an initial observation, note that in any iteration , if for two nodes and , the sums and are distinct (recall that ), then for the WL iteration to be successful, we must also have that . This is because, implies that the multisets and are also distinct. But then Definition 1.1 yields that we need (at least with some probability ). Now, consider two nodes and such that in some iteration of the WL test, the multisets of sums and are different. This corresponds to the multisets and being different. We would like to argue that for the WL iteration to be successful according to Definition 1.1, for each such pair of nodes , we must have that also with some good probability (the sums of labels in the next iteration differ). Theorem D.4 tells us that the probability of this happening is very low if we use too few ReLU units. Now why do we require that for such a pair of nodes ?
Since the multisets and are different, by the initial observation, the multisets and must also be distinct for the WL test to be successful. But since the multisets of labels and are distinct it follows by another application of Definition 1.1, that we must also have that . However, the only way this can happen is if as otherwise these two sums will be mapped to the same label by .
We remark that this lower bound applies to an isolated WL iteration rather than a full sequence of iterations. In particular, the inputs (corresponding to the sums ) are adversarially chosen while in reality these inputs are not arbitrary but are the result of a prior WL iteration. Our construction in Section 3 indeed works against such adversarially chosen sums in the sense that different multisets of sums are mapped (via applying and summing the outputs for each multisets) to different sums with high probability, and as such our lower bound is exactly a lower bound for this harder problem. However, in general the sums are not adversarially chosen, and it would very be interesting to find a lower bound that does not require this assumption but works all the way from a graph and its initial labels.
in spite of the multisets, and being different. Now, is a neural network, so this identity does not need to hold. The idea is however, that if has only few ReLU units, then we obtain a good upper bound on the number of linear regions by Theorem D.3 and since and are random, the set is likely to be fully contained in one of these regions. And since restricted to this region in linear, (D.1) holds in this case.
In other words, if for a fixed , is chosen such that is fully contained in one of the convex regions, then (D.1) is satisfied. It follows that for any given ,
Since the event are independent (as we choose independent for each pair of paths ), it follows that
If in particular, , we obtain that
As the multisets and are different, this completes the proof. ∎
In analogue with our construction in Section 2 and Section 3, we assumed in the above proof that the aggregate function is the summation function. As such, is just another neural network but without a single ReLU unit. We can therefore think of the combined computation performed by and (illustrated in Figure 5) as the result of applying a single neural network. It follows from this observation (and the proof of Theorem D.4) that in the more general setting where is a function in and where the neural network , then we must have that in order to successfully simulate the WL test.
The proof of Theorem D.4 used that the number of convex linear regions of any neural network with at most ReLU’s is at most . However, in many cases one can obtain better upper bounds on the number of such regions, and this directly translates to a better lower bound than the one given in Theorem D.4. Indeed, if the family of neural networks satisfies that the domain of any can be partitioned into at most convex regions such that restricted to each of these regions is linear, then the lower bound in (D.2) instead becomes
In particular, when using independence of the events , we just need , say, to get that an error occur with probability at least . Plugging in the bound of Theorem D.3 gave the desired bound of Theorem D.4 which led to the lower bound. If we instead use the more fine grained theorem below, we obtain better bounds for shallow neural networks with low input dimension as stated in Corollary D.7.
Any ReLU neural network with input dimension , width , and depth has at most linear regions.
Let consist of all ReLU neural networks with input dimension , depth , and width . Suppose that we are in the setting of Theorem D.4, except that the neural network is picked from . Then the conclusion of the theorem holds as long as for a small enough constant . In particular, to simulate the WL test with neural networks from , we need ReLU units.
As an example, for shallow neural networks with low input dimension, say with , this lower bound becomes , i.e. polynomial rather than logarithmic in the size of the underlying field.
For certain architectures of the neural networks one can obtain even stronger bounds on the number of linear regions (see e.g., Proposition 3 in [Mon17] and Theorem 1 in [STR18]). These bounds are parametrized in the number of ReLU units in each of the layers of the neural networks. One can therefore obtain even more fine grained lower bounds on the number of ReLU units if one makes more assumptions on the family of neural networks but the bounds are more opaque and we refrain from stating them here.
D.2.2 Description complexity
In this subsection, we consider more general function classes that do not necessarily have to consist of neural networks. We prove that for any aggregation function , if for any two distinct multisets of labels each of size at most , there exists a function such that the multisets are mapped to different labels by , then . It follows that the description complexity of must be . Our bound is combinatorial, and does not employ the linear structure of . Hence we may just put and think of as a set rather than a vector space.
Let and be natural numbers and let be the number of multisets of of size at most . Suppose that is any aggregation function mapping multisets of to some range . Let be any set of functions from to and assume that . Then there exists distinct multisets and each with at most elements from such that for all .
Note that each function induces a partition on the set of these multisets induced by the equivalence relation defined by . By repeated application of the pidgeonhole principle, there must exists a collection of multisets each containing at most elements from such that (1) for all and all , and (2) . If in particular , we must have that . Letting and be distinct elements of , we have that for all . ∎
Note that number of distinct degrees of the vertices of a simple -node graph could be as large as , so it is a natural assumption that also . Indeed, if is smaller, then for such a graph, the simulation of the WL test will fail with probability since it must inevitably assign two nodes of distinct degrees the same label in . With this assumption, it follows that
using the inequality . Thus,
In particular, the description complexity of has to be in order to separate any two distinct multisets each consisting of at most elements. We note that the description complexity of the construction in Section 3 is .