The expressive power of pooling in Graph Neural Networks
In Graph Neural Networks (GNNs), hierarchical pooling operators generate
local summaries of the data by coarsening the graph structure and the vertex
features. While considerable attention has been devoted to analyzing the
expressive power of message-passing (MP) layers in GNNs, a study on how graph
pooling affects the expressiveness of a GNN is still lacking. Additionally,
despite the recent advances in the design of pooling operators, there is not a
principled criterion to compare them. In this work, we derive sufficient
conditions for a pooling operator to fully preserve the expressive power of the
MP layers before it. These conditions serve as a universal and theoretically
grounded criterion for choosing among existing pooling operators or designing
new ones. Based on our theoretical findings, we analyze several existing
pooling operators and identify those that fail to satisfy the expressiveness
conditions. Finally, we introduce an experimental setup to verify empirically
the expressive power of a GNN equipped with pooling layers, in terms of its
capability to perform a graph isomorphism test.
Filippo Maria Bianchi, Veronica Lachi
# The expressive power of pooling in Graph Neural Networks

###### Abstract

In Graph Neural Networks (GNNs), hierarchical pooling operators generate local summaries of the data by coarsening the graph structure and the vertex features. Considerable attention has been devoted to analyzing the expressive power of message-passing (MP) layers in GNNs, while a study on how graph pooling affects the expressiveness of a GNN is still lacking. Additionally, despite the recent advances in the design of pooling operators, there is not a principled criterion to compare them. In this work, we derive sufficient conditions for a pooling operator to fully preserve the expressive power of the MP layers before it. These conditions serve as a universal and theoretically-grounded criterion for choosing among existing pooling operators or designing new ones. Based on our theoretical findings, we analyze several existing pooling operators and identify those that fail to satisfy the expressiveness conditions. Finally, we introduce an experimental setup to verify empirically the expressive power of a GNN equipped with pooling layers, in terms of its capability to perform a graph isomorphism test.

## 1 Introduction

Significant effort has been devoted to characterizing the expressive power of Graph Neural Networks (GNNs) in terms of their capabilities for testing graph isomorphism [32]. This has led to a better understanding of the strengths and weaknesses of GNNs and opened up new avenues for developing advanced GNN models that go beyond the limitations of such algorithms [30]. The more powerful a GNN, the larger the set of non-isomorphic graphs that it can distinguish by generating distinct representations for them. GNNs with appropriately formulated message-passing (MP) layers are as effective as the Weisfeiler-Lehman isomorphism test (WL test) in distinguish graphs [36], while higher-order GNN architectures can match the expressiveness of the \(k\)-WL test [27]. Several approaches have been developed to enhance the expressive power of GNNs by incorporating random features into the nodes [31; 1], by using randomized weights in the network architecture [40], or by using compositions of invariant and equivariant functions [25]. Despite the progress made in understanding the expressive power of GNNs, the results are still limited to _flat_ GNNs consisting of a stack of MP layers followed by a final readout [10; 38; 21].

Inspired by pooling in convolutional neural networks, recent works introduced hierarchical pooling operators that enable GNNs to learn increasingly abstract and coarser representations of the input graphs [37; 8]. By interleaving MP with pooling layers that gradually distill global graph properties through the computation of local graph summaries, it is possible to build deep GNNs that improve the accuracy in graph classification [7; 4] and node classification tasks [18; 24].
It is not straightforward to evaluate the power of a graph pooling operator and the quality of the coarsened graphs it produces. The most common approach is to simply measure the performance of a GNN with pooling layers on a downstream task, such as graph classification. However, such an approach is highly empirical and provides a rather indirect evaluation that is affected by external factors. One factor is the overall GNN architecture: the pooling layers are combined with different MP layers, activation functions, normalization or dropout layers, and specific optimization algorithms, which makes it difficult to disentangle the contribution of the individual components. Another factor is the dataset at hand: some classification tasks only require isolating a specific motif in the graph [22; 6], while others require considering global properties that depend on the whole graph structure [15]. Two new criteria were recently proposed to evaluate a graph pooling operator in terms of the spectral similarity between the original and the coarsened graph topology and its capability of reconstructing the features of the original graph from the coarsened one [20]. While providing valuable insights, these criteria give results that are, to some extent, contrasting and in disagreement with the traditional evaluation based on the performance of the downstream task.

To address this issue, we introduce a universal and principled criterion that quantifies the power of a pooling operator as its capability to retain the information in the graph from an expressiveness perspective. In particular, we investigate how graph pooling affects the expressive power of GNNs and derive sufficient conditions under which the pooling operator preserves the highest degree of expressiveness. Our contributions are summarized as follows.

* We show that when certain conditions are met in the MP layers and in the pooling operator, their combination produces an injective function between graphs. This implies that the GNN can effectively coarsen the graph to learn high-level data descriptors, without compromising its expressive power.
* Based on our theoretical analysis, we identify commonly used pooling operators that do not satisfy these conditions and may lead to failures in certain scenarios.
* We introduce a simple yet effective experimental setup for measuring, empirically, the expressive power of any GNN in terms of its capability to perform a graph isomorphism test.

Besides providing a criterion for choosing among existing pooling operators and for designing new ones, our findings allow us to debunk criticism and misconceptions about graph pooling.

## 2 Background

### Graph neural networks

Let \(\mathcal{G}=\left(\mathcal{V},\mathcal{E}\right)\) be a graph with node features \(\mathcal{X}^{0}=\left\{\mathbf{x}_{i}^{0}\right\}_{i=1}^{N}\), where \(\left\{\cdot\right\}\) denotes a multiset and \(\left|\mathcal{V}\right|=N\). The principal operations performed by GNNs are those of the MP layers [19], which implement a local computational mechanism to process graphs. Specifically, the information related to a node \(v\) that is stored in a feature vector \(\mathbf{h}_{v}\), is updated by combining the features of neighboring nodes. After \(l\) iterations, the vector \(\mathbf{h}_{v}^{l}\) embeds both the structural information and the node content of the \(l\)-hop neighborhood of \(v\). With enough iterations, the node feature vectors can be used to classify the nodes or the entire graph. More rigorously, the output of the \(l\)-th layer of a MP-GNN is:

\[\mathbf{x}_{v}^{l}=\texttt{COMBINE}^{(l)}(\mathbf{x}_{v}^{l-1},\texttt{AGGREGATE}^{(l )}(\mathbf{x}_{u}^{l-1},\,u\in\mathcal{N}[v])) \tag{1}\]

where \(\texttt{AGGREGATE}^{(l)}\) is a function that aggregates the node features from the neighborhood \(\mathcal{N}[v]\) at the (\(l-1\))-th iteration, and \(\texttt{COMBINE}^{(l)}\) is a function that combines the own features with those of the neighbors. This type of MP-GNN implements permutation-invariant feature aggregation functions and the information propagation is isotropic [33]. In graph classification/regression tasks, a READOUT function typically transforms the feature vectors from the last layer \(L\) to produce the final output:

\[\mathbf{o}\ =\ \texttt{READOUT}(\mathbf{x}_{v}^{L},\,v\in\mathcal{V})). \tag{2}\]

### Expressive power of graph neural networks

When analyzing the expressive power of GNNs, the primary objective is to evaluate their capacity to produce different outputs for non-isomorphic graphs. While an exact test for graph isomorphism
has a combinatorial complexity [2], the WL test for graph isomorphism [35] is an effective and computationally efficient test that can distinguish a broad range of graphs, with some exceptions, such as strongly regular graphs [11]. The algorithm assigns to each graph vertex a color that depends on the multiset of labels of its neighbors and on its own color. At each iteration, the colors of the vertices are updated until convergence is reached.

There is a strong analogy between an iteration of the WL-test and the aggregation scheme implemented by MP in GNNs. In fact, it has been proved that MP-GNNs are at most as powerful as the WL test in distinguishing different graph-structured features [36; 27]. Moreover, if the MP operation is injective, then the resulting MP-GNN is as powerful as the WL test [36]. The Graph Isomorphism Network (GIN) implements such injective multiset function as follows:

\[\mathbf{x}_{v}^{l}=\texttt{MLP}^{(l)}\left((1+\epsilon^{l})\mathbf{x}_{v}^{l-1}+\sum_ {u\in\mathcal{N}[v]}\mathbf{x}_{u}^{l-1}\right). \tag{3}\]

Under the condition that the nodes' features are a countable multiset, the representational power of GIN equals that of the WL test. Some GNNs can surpass the discriminative power of the WL test by using higher-order generalizations of MP operation [27], or by using a composition of invariant and equivariant functions [25], at the price of higher computational complexity. In this work, we focus on the standard MP-GNN, which remains the most widely adopted due to its computational efficiency.

### Graph pooling operators

A graph pooling operator implements a function \(\texttt{POOL}:\mathcal{G}\mapsto\mathcal{G}_{P}=(\mathcal{V}_{P},\mathcal{E }_{P})\) such that \(|\mathcal{V}_{P}|=K\), with \(K\leq N\) and \(\mathcal{X}_{P}=\{\mathbf{x}_{P}\}_{i=1}^{K}\) is the multiset of the pooled nodes features. To formally describe the \(\texttt{POOL}\) function, we adopt the Select-Reduce-Connect (SRC) framework [20], that expresses a graph pooling operator through the combination of three functions: _selection_, _reduction_, and _connection_. The selection function (\(\mathtt{SEL}\)) clusters the nodes of the input graph into subsets called _supernodes_, namely \(\mathtt{SEL}:\mathcal{G}\mapsto\mathcal{S}=\{\mathcal{S}_{1},\dots,\mathcal{S} _{K}\}\) with \(\mathcal{S}_{j}=\left\{s_{i}^{j}\right\}_{i=1}^{N}\) where \(s_{i}^{j}\) is a membership score that measures how much node \(i\) contributes to supernode \(j\). Typically, a node can be assigned to zero, one, or several supernodes, each with different scores. The reduction function (\(\mathtt{RED}\)) creates the pooled vertex features multiset by aggregating the features of the vertices assigned to the same supernode, that is, \(\mathtt{RED}:(\mathcal{G},\mathcal{S})\mapsto\mathcal{X}_{P}\). Finally, the connect function (\(\mathtt{CON}\)) generates the edges (and, potentially, the edge features) by connecting the supernodes \(\mathcal{E}_{P}=\{\mathtt{CON}(\mathcal{G},\mathcal{S}_{m},\mathcal{S}_{l})\}_ {m,l=1}^{K}\).

Most of the existing graph pooling operators can be specified by a particular implementation of the SRC functions. It is worth noting that the input and output of the SRC functions can be represented as both multisets and matrices. In Section 3.1 we use the multisets representation as it facilitates presenting our main result, while in the rest of the paper, we adopt the matrix representation.

## 3 Expressive power of graph pooling operators

We define the expressive power of a graph pooling operator as its capability of preserving the expressive power of the MP layers that came before it. We first present our main result, which is a formal criterion to verify the expressive power of a pooling operator. In particular, we provide three sufficient (though not necessary) conditions ensuring that if the MP and the pooling layers meet certain criteria, then the latter retains the same level of expressive power as the former. Then, we analyze several existing pooling operators and analyze their expressive power based on those criteria.

### Conditions for expressiveness

**Theorem 1**.: _Let \(\mathcal{G}_{1}=(\mathcal{V}_{1},\mathcal{E}_{1})\) with \(|\mathcal{V}_{1}|=N\) and \(\mathcal{G}_{2}=(\mathcal{V}_{2},\mathcal{E}_{2})\) with \(|\mathcal{V}_{2}|=M\) with node features \(\mathcal{X}_{1}\) and \(\mathcal{X}_{2}\) respectively, such that \(\mathcal{G}_{1}\neq_{WL}\mathcal{G}_{2}\). Let \(\mathcal{G}_{1}^{L}\) and \(\mathcal{G}_{2}^{L}\) be the graph obtained after applying a block of \(L\) MP layers such that \(\mathcal{X}_{1}^{L}=\{\mathbf{x}_{i}^{L}\}_{i=1}^{N}\) and \(\mathcal{X}_{2}^{L}=\{\mathbf{y}_{i}^{L}\}_{i=1}^{M}\) are the new multisets of nodes features. Let \(\mathtt{POOL}\) be a pooling operator expressed by the functions \(\mathtt{SEL}\), \(\mathtt{RED}\), \(\mathtt{CON}\), which is placed after the MP layers. Let \(\mathcal{G}_{1_{P}}=\mathtt{POOL}(\mathcal{G}_{1})\) and \(\mathcal{G}_{2_{P}}=\mathtt{POOL}(\mathcal{G}_{2})\) with \(|\mathcal{V}_{1_{P}}|=|\mathcal{V}_{2_{P}}|=K\). Let
\(\mathcal{X}_{1_{P}}=\{\mathbf{x}_{P_{i}}\}_{j=1}^{K}\) and \(\mathcal{X}_{2_{P}}=\left\{\mathbf{y}_{P_{j}}\right\}_{j=1}^{K}\) be the nodes features of the pooled graphs. If the following conditions hold:_

1. \(\sum_{i}^{N}\mathbf{x}_{i}^{L}\neq\sum_{i}^{M}\mathbf{y}_{i}^{L}\)_;_
2. _For each node_ \(i\)_, the memberships generated by_ SEL _satisfy_ \(\sum_{j=1}^{K}s_{i}^{j}=\lambda\)_, with_ \(\lambda>0\)_;_
3. _The function_ RED _is of type_ RED_ \(:\left\{\left(\mathbf{x}_{i}^{L},s_{i}^{j}\right)_{i=1}^{N}\right\}_{j=1}^{K} \mapsto\mathcal{X}_{P}=\left\{\sum_{i=1}^{N}\mathbf{x}_{i}^{L}\cdot s_{i}^{j} \right\}_{j=1}^{K}\)_;_

_then \(\mathcal{X}_{1_{P}}\neq\mathcal{X}_{2_{P}}\)._

The proof can be found in Appendix A and a schematic summary is in Fig. 1.

When the three conditions are satisfied, the combination of the MP layers and pooling operator results in an injective function between graphs. When using a powerful MP layer such as GIN [36], there are theorems for functions defined on sets that guarantee condition 1 to be met. In particular, the sum over a multiset that is countable is an injective function [39]. When \(\mathcal{G}_{1}\neq_{\text{WL}}\mathcal{G}_{2}\) a GNN block with enough GIN layers produces different multisets of node features \(\mathcal{X}_{1}^{L}\neq\mathcal{X}_{2}^{L}\). Note that this is true also when \(\mathcal{G}_{1}\) and \(\mathcal{G}_{2}\) have the same number of nodes, i.e., Th. 1 holds for \(|\mathcal{V}_{1}|=|\mathcal{V}_{2}|=N\).

If the pooling operator satisfies conditions 2 and 3, it will also produce multisets of node features so that \(\mathcal{X}_{1_{P}}\neq\mathcal{X}_{2_{P}}\). Due to the injectiveness of the coloring function of the WL algorithm, two graphs with different multisets of node features will be classified as non-isomorphic by the WL test and, therefore, \(\mathcal{G}_{1_{P}}\neq_{\text{WL}}\mathcal{G}_{2_{P}}\). This means that the pooling operator effectively coarsens the graphs while retaining all the information necessary to differentiate between them and that the composition of GIN layers and appropriate pooling operator maps non-WL equivalent graphs \(\mathcal{G}_{1}\neq_{\text{WL}}\mathcal{G}_{2}\) into non-WL equivalent graphs \(\mathcal{G}_{1_{P}}\neq_{\text{WL}}\mathcal{G}_{2_{P}}\).

Condition 2 implies that all nodes in the original graph must contribute to the supernodes. Moreover, letting the sum of the memberships \(s_{i}^{j}\) to be a constant \(\lambda\) (usually, \(\lambda=1\)), places a restriction on the formation of the super-nodes. Condition 3 requires that the features of the supernodes \(\mathcal{X}_{P}\) are a convex combination of the node features \(\mathcal{X}^{L}\). It is important to note that the conditions for the expressiveness only involve SEL and RED, but not the CON function. Indeed, both the graph's topology and the nodes' features are embedded in the features of the supernodes by MP and pooling layers satisfying the conditions of Th. 1. Nevertheless, even if a badly-behaved CON function does not affect the expressiveness of the pooling operator, it can still compromise the effectiveness of the MP layers that come afterward. This will be discussed further in Sections 3.3 and 4.

### Expressiveness of existing pooling operators

The SRC framework allows building a comprehensive taxonomy of the existing pooling operators, based on the density of supernodes, the trainability of the SEL, RED, and CON functions, and the

Figure 1: A GNN with expressive MP layers (condition 1) extracts different features \(\mathcal{X}_{1}^{L}\) and \(\mathcal{X}_{2}^{L}\) for two graphs \(\mathcal{G}_{1}\), \(\mathcal{G}_{2}\) that are WL-distinguishable. A pooling layer satisfying the conditions 2 and 3 generates coarsened graphs \(\mathcal{G}_{1_{P}}\) and \(\mathcal{G}_{2_{P}}\) that are still WL-distinguishable.
adaptability of the number of supernodes \(K\)[20]. The density of a pooling operator is defined as the expected value \(\mathbb{E}[|\mathcal{S}_{k}|/N]\), which is the ratio between the cardinality of a supernode \(\mathcal{S}_{k}\) and the number of nodes in the graph \(\mathcal{G}\). A method is referred to as _dense_ if the supernodes have cardinality \(O(N)\), whereas a pooling operator is considered _sparse_ if the supernodes generated have constant cardinality \(O(1)\)[20].

Pooling methods can also be distinguished according to the number of nodes \(K\) of the pooled graph. If \(K\) is constant and independent of the input graph size, the pooling method is _fixed_. On the other hand, if the number of supernodes is a function of the input graph, the method is _adaptive_. Finally, the in some pooling operators the SEL, RED, and CON functions can be learned end-to-end along with the other components of the GNN architecture. In this case, the method is said to be _trainable_, meaning that the operator has parameters that are learned by optimizing a task-driven loss function. Otherwise, the methods are _non-trainable_.

Dense pooling operatorsProminent methods in this class of pooling operators are DiffPool [37], MinCutPool [7], and DMoN [34]. Besides being dense, all these operators are also trainable and fixed. DiffPool, MinCutPool, and DMoN compute a cluster assignment matrix \(\mathbf{S}\in\mathbb{R}^{N\times K}\) either with an MLP or an MP-layer, which are fed with the node features \(\mathbf{X}^{L}\) and end with a softmax. The main difference among these methods is in how they define unsupervised auxiliary loss functions, which are used to inject a bias in how the clusters are formed. Thanks to the softmax normalization, the cluster assignments sum up to one, ensuring condition 2 of Th. 1 to be satisfied. Moreover, the pooled node features are computed as \(\mathbf{X}_{p}=\mathbf{S}^{\mathsf{T}}\mathbf{X}^{L}\), making also condition 3 satisfied.

There are dense pooling operators that use algorithms such as non-negative matrix factorization [3] to obtain a cluster assignment matrix \(\mathbf{S}\), which may not satisfy condition 2. Nonetheless, it is always possible to apply a suitable normalization to \(\mathbf{S}\) to ensure that its rows sum up to one. Therefore, we claim that all dense methods preserve the expressive power of the preceding MP layers.

Non-expressive sparse pooling operatorsMembers of this category are Top-\(k\)[18, 22] ASAPool [29], SAGPool [23] and PanPool [24], which are also trainable and adaptive. These methods reduce the graph by selecting a subset of its nodes based on a ranking score and they mainly differ in how their SEL function computes such a score. Specifically, the Top-\(k\) method ranks nodes based on a score obtained by multiplying the node features with a trainable projection vector. A node \(i\) is kept (\(s_{i}=1\)) if its among the top-\(K\) in the ranking and is discarded (\(s_{i}=0\)) otherwise. SAGPool simply replaces the projection vector Top-\(k\) with an MP layer to account for the graph's structure when scoring nodes. ASAPool, instead, examines all potential local clusters within the input graph given a fixed receptive field and it employs an attention mechanism to compute the cluster membership of the nodes. The clusters are subsequently scored using a GNN. Finally, in PanPool the scores are obtained from the diagonal entries of a maximal entropy transition matrix, which is a transition matrix that generalizes the graph Laplacian.

Regardless of how the score is computed, all these methods generate a cluster assignment matrix \(\mathbf{S}\) where not all the rows sum to one. Indeed, if a node is not selected, it is not assigned to any supernode in the coarsened graph. Therefore, these methods fail to meet condition 2 of Theorem 1. Additionally, all these methods share the same RED, which involves multiplying the features of each selected node by its ranking score, making condition 3 also unsatisfied.

Intuitively, these operators produce a pooled graph that is a subgraph of the original graph and discard the content of the remaining parts. This hinders the ability to retain all the necessary information for preserving the expressiveness of the preceding MP layers. The limitation of Top-\(k\) is exemplified in Fig. 2: regardless of the projector \(p\), Top-\(k\) maps two WL-distinguishable graphs into two isomorphic graphs, meaning that it cannot preserve the partition on graphs induced by the WL test.

Expressive sparse pooling operatorsNot all sparse pooling operators coarsen the graph by selecting a subgraph. In fact, some of them assign each node in the original graph to exactly one supernode and, thus, satisfy condition 2 of Th. 1. In matrix form, the cluster assignment would be represented by a sparse matrix \(\mathbf{S}\) that satisfies \(\mathbf{S}\mathbf{1}_{K}=\mathbf{1}_{N}\) and where every row has one entry equal to one and the others equal to zero. Within this category of sparse pooling operators, notable examples include Graclus [13], ECPool [14], and \(k\)-MISPool [4].
Graclus is a non-trainable, greedy bottom-up spectral clustering algorithm, which matches each vertex with the neighbor that is closest according to the graph connectivity [13]. When Graclus is used to perform graph pooling, the RED function is usually implemented as a max_pool operation between the vertices assigned to the same cluster [12]. In this work, to ensure condition 3 of Th. 1 to be satisfied, we use a sum_pool operation instead. Contrarily from Gralcus, ECPool and \(k\)-MISPool are trainable. ECPool first assigns to each edge \(e_{i\to j}\) a score \(r_{ij}=f(\mathbf{x}_{i},\mathbf{x}_{j};\mathbf{\Theta})\). Then, iterates over each edge \(e_{i\to j}\), starting from those with higher scores, and contracts it if neither nodes \(i\) and \(j\) are attached to an already contracted edge. The endpoints of a contracted edge are merged into a new supermode \(\mathcal{S}_{k}=r_{ij}(\mathbf{x}_{i}+\mathbf{x}_{j})\), while the remaining nodes become supernodes themselves. Since each supermode either contains the nodes of a contracted edge or is a node from the original graph, all columns of \(\mathbf{S}\) have either one or two entries equal to one, while each row sums up to one. The RED function can be expressed as \(\mathbf{r}\odot\mathbf{S}^{T}\mathbf{X}^{L}\), where \(\mathbf{r}[k]=r_{ij}\) if \(k\) is the contraction of two nodes \(i\)\(j\), otherwise \(\mathbf{r}[k]=1\). As a result, ECPool met the expressiveness conditions of Th. 1. Finally, \(k\)-MISPool identifies the supernodes with the centroids of the maximal \(k\)-independent sets of a graph [5]. To speed up computation, the centroids are selected with a greedy approach based on a ranking vector \(\pi\). Since \(\pi\) can be obtained from a trainable projector \(\mathbf{p}\) applied to the vertex features, \(\pi=\mathbf{X}^{L}\mathbf{p}^{T}\), \(k\)-MISPool is a trainable pooling operator. \(k\)-MISPool assigns each graph vertex to one of the centroids and aggregates the features of the vertex assigned to the same centroid with a sum_pool operation to create the features of the supernodes. Therefore, \(k\)-MISPool satisfies the expressiveness conditions of Th. 1.

A common characteristic of these methods is that the number of supernodes \(K\) cannot be directly specified. Graclus and ECPool achieve a pooling ratio of approximately 0.5 by roughly reducing each time the graph size by 50%. On the other hand, \(k\)-MISPool can control the coarsening level by computing the maximal independent set from \(\mathcal{G}^{k}\), which is the graph where each node of \(\mathcal{G}\) is connected to its \(k\)-hop neighbours. As the value of \(k\) increases, the pooling ratio decreases.

### Criticism on graph pooling

Recently, the effectiveness of graph pooling has been questioned using as an argument a set of empirical results aimed at exposing the weaknesses of certain pooling operators [26]. The experiments showed that using a randomized cluster assignment matrix \(\mathbf{S}\) (followed by a softmax normalization) gives comparable results to using the assignment matrices learned by Diffpool [37] and MinCutPool [7]. Similarly, applying Graclus [13] on the complementary graph would give a performance similar to using the original graph.

Figure 2: Example of failure of Top-\(k\) pooling operator. Regardless of the value learned for the projector \(p\), two WL-distinguishable graphs are mapped into the same coarsened graph becoming indistinguishable.
We identified potential pitfalls in the proposed evaluation, which considered only pooling operators that are expressive and that, even after being modified, retain their expressive power. Clearly, even if expressiveness ensures that all the information is preserved in the pooled graph, its structure is corrupted when using a randomized \(\mathbf{S}\) or a complementary graph. This hinders the effectiveness of the MP layers that come after pooling, as their inductive biases no longer match the data structure they receive. Notably, this might not affect certain classification tasks, e.g., when the goal is to detect small structures that are already captured by the MP layers before pooling.

To address these limitations, first, we propose to corrupt a pooling operator that is not expressive. In particular, we design a Top-\(k\) pooling operator where the nodes are ranked based on a score that is sampled from a Normal distribution rather than being produced by a trainable layer applied to the vertex features. Second, we evaluate all the modified pooling operators in a setting where the MP layers after pooling are essential for the task and show that the performance drop is significant.

## 4 Experimental Results

To empirically confirm the theoretical results presented in Section 3, we designed a synthetic dataset that is specifically tailored to evaluate the expressive power of a GNN. We considered a GNN with MP layers interleaved with 10 different pooling operators: DiffPool [37], DMoN [34], MinCut [7], ECPool [14], Graclus, \(k\)-MISPool [4], Top-\(k\)[18], PanPool [24], ASAPool [29], and SAGPool [23]. For each pooling method, we used the implementation in Pytorch Geometric [17] with the default configuration. In addition, following the setup used to criticize the effectiveness of graph pooling [26], we considered the following pooling operators: Rand-Dense, a dense pooling operator where the cluster assignment is a normalized random matrix; Rand-Sparse, a sparse operator that ranks nodes based on a score sampled from a Normal distribution; Cmp-Graclus, an operator that applies the Graclus algorithm on the complement graph.

### The EXPWL1 dataset

Our experiments aim at evaluating the expressive power of MP layers when combined with pooling layers. However, existing real-world and synthetic benchmark datasets are unsuitable for this purpose as they are not specifically designed to relate the power of GNNs to that of the WL test. Recently, the EXP dataset was proposed to test the capability of special GNNs to achieve higher expressive power than the WL test [1], which, however, goes beyond the scope of our evaluation. Therefore, we introduce a modified version of EXP called EXPWL1, which comprises a collection of graphs \(\{\mathcal{G}_{1},\dots,\mathcal{G}_{N},\mathcal{H}_{1},\dots,\mathcal{H}_{N}\}\) that represent propositional formulas that can be satisfiable or unsatisfiable. Each pair \((\mathcal{G}_{i},\mathcal{H}_{i})\) in EXPWL1 consists of two non-isomorphic graphs distinguishable by a WL test, which encode formulas with opposite SAT outcomes. Therefore, any GNN that has an expressive power equal to the WL test can distinguish them and achieve approximately 100% classification accuracy on the dataset. Compared to the original EXP dataset, we increased the size of the dataset to a total of 3000 graphs and we also increased the size of each graph from an average of 55 nodes to 76 nodes. This was done to make it possible to apply an aggressive pooling without being left with a trivial graph structure. The EXPWL1 dataset and the code to reproduce the experimental results are publicly available 2.

Footnote 2: [https://github.com/FilippoMB/The-expressive-power-of-pooling-in-GNNs](https://github.com/FilippoMB/The-expressive-power-of-pooling-in-GNNs)

### Experimental procedure

To empirically evaluate which pooling operator maintains the expressive power of the MP layers preceding it, we first identified a GNN architecture without pooling layers, which achieves approximately 100% accuracy on the EXPWL1. We found that a GNN with three GIN layers followed by a global_sum_pool reaches the desired accuracy. Then, we inserted a pooling layer between the second and third GIN layers, which performs an aggressive pooling by using a pooling ratio of 0.1 that reduces the graph size by 90%. The details of the GNN configuration are in Appendix B.1. To ensure a fair comparison, when testing each method we shuffled the datasets and created 10 different train/validation/test splits using the same random seed. We trained each model on all splits for 500 epochs and reported the average training time and the average test accuracy obtained by the models that achieved the lowest loss on the validation set.
To validate our experimental approach, we also measured the performance of the proposed GNN architecture equipped with the different pooling layers on popular benchmark datasets for graph classification. In particular, we considered six TUD datasets [28] (NC11, Proteins, Mutagenicity, COLLAB, Reddit-B, COLORS-3) and an additional synthetic dataset, B-Hard [9].

### Experimental Results

Table 1 reports the performances of different pooling operators on EXPWL1. These results are consistent with our theoretical findings: pooling operators that satisfy the conditions of Th. 1 achieve the highest average accuracy among all the pooling operators. Despite the aggressive pooling, these operators retain all the necessary information and achieve the same performance as the GNN without a pooling layer. On the other hand, non-expressive pooling operators achieve a significantly lower accuracy as they are not able to correctly distinguish all graphs.

Table 1 also show that employing a pooling operator based on a normalized random cluster assignment matrix (Rand-dense) or the complement graph (Cmp-Graclus) gives a lower performance. First of all, this result disproves the argument that such operators are comparable to the regular ones [26]. Additionally, we notice that the reduction in performance is less significant for Rand-Dense and Cmp-Graclus than for Rand-sparse. This outcome is expected because, in terms of expressiveness, Rand-dense and Cmp-Graclus still satisfy the conditions of Th. 1. Nevertheless, their performance is still lower than the original pooling operators. The reason is that even if a badly-behaved CON function does not compromise the expressiveness of the pooling operator, the structure of the pooled graph is corrupted when utilizing a randomized \(\mathbf{S}\) or a complementary graph. This, in return, reduces the effectiveness of the last GIN layer, which is essential to correctly classify the graphs in EXPWL1.

There are two remarks about the experimental evaluation. As discussed in Section 3.2, it is not possible to explicitly specify the pooling ratio in Graclus, ECPool, and \(k\)-MISPool. For \(k\)-MISPool, setting \(k=5\) gives a pooling ratio of approximately 0.1 on EXPWL1. However, for Graclus and ECPool, the only feasible option is to apply the pooling operator recursively until the desired pooling ratio of 0.1 is reached. Unfortunately, this approach is demanding, both in terms of computing time and memory usage. While it was possible to do this with Graclus in EXPWL1, we encountered an out-of-memory error after a few epochs when using ECPool on an RTX A6000 with 48GB of VRAM. Thus, the results for ECPool on the EXPWL1 are obtained with a single pooling layer that gives a pooling ratio of approximately 0.5 rather than 0.1. Clearly, a pooling ratio of 0.5 retains more information from the original graph, greatly simplifying the training in ECPool with respect to the other methods. Nevertheless, due to its expressiveness, we argue that ECPool would have reached approx 100% accuracy on EXPWL1 if implementing a more aggressive pooling was feasible.

The second remark is that in EXPWL1 when using too many MP layers, at least one node ends up containing enough information to accurately classify the graphs. This was demonstrated by using a model with 3 GIN layers followed by global_max_pool, which achieved an accuracy of \(~{}0.983\pm 0.006\). It should be noted that the baseline model with 3 GIN layers equipped with the more expressive global_sum_pool achieves a slightly higher accuracy of \(~{}0.993\pm 0.003\). In contrast,

\begin{table}
\begin{tabular}{l c c c c c} \hline \hline
**Pooling** & **s/epoch** & **GIN layers** & **Pool Ratio** & **Test Acc** & **Expr.** \\ \hline _No-pool_ & 0.33s & 2+1 & 0.1 & \(99.3\pm 0.3\) & – \\
**DiffPool** & 0.69s & 2+1 & 0.1 & \(97.0\pm 2.4\) & ✓ \\
**DMoN** & 0.75s & 2+1 & 0.1 & \(99.0\pm 0.7\) & ✓ \\
**MinCut** & 0.72s & 2+1 & 0.1 & \(98.8\pm 0.4\) & ✓ \\
**ECPool** & 4.79s & 2+1 & 0.5 & \(99.5\pm 0.5\) & ✓ \\
**Graclus** & 1.00s & 2+1 & 0.1 & \(99.9\pm 0.1\) & ✓ \\ \(k\)**-MIS** & 1.17s & 2+1 & 0.1 & \(99.9\pm 0.1\) & ✓ \\
**Top-\(k\)** & 0.47s & 2+1 & 0.1 & \(67.9\pm 13.9\) & ✗ \\
**PanPool** & 3.82s & 2+1 & 0.1 & \(63.2\pm 7.7\) & ✗ \\
**ASAPool** & 1.11s & 1+1 & 0.1 & \(83.5\pm 2.5\) & ✗ \\
**SAGPool** & 0.59s & 1+1 & 0.1 & \(79.5\pm 9.6\) & ✗ \\ \hline
**Rand-dense** & 0.41s & 2+1 & 0.1 & \(91.7\pm 1.3\) & ✓ \\
**Cmp-Graclus** & 7.42s & 2+1 & 0.5 & \(91.0\pm 1.6\) & ✓ \\
**Rand-sparse** & 0.47s & 2+1 & 0.1 & \(62.8\pm 1.8\) & ✗ \\ \hline \hline \end{tabular}
\end{table}
Table 1: Classification on **EXPWL1** Dataset.
a model with only 2 GIN layers and global_max_pool gives a significantly lower accuracy of \(0.665\pm 0.018\). Therefore, to ensure that our evaluation is meaningful, no more than 2 MP layers should precede the pooling operator. Since ASAPool and SAGPool implement an additional MP operation internally, we used only 1 GIN layer before them, rather than 2 as for the other pooling methods.

Finally, Fig. 3 shows the average accuracy and the average run-time obtained on the seven benchmark datasets (the detailed results are in Appendix B.3). These benchmarks are not designed to test the expressive power and, thus, a GNN equipped with a non-expressive pooling operator could achieve good performance. This happens, for example, in those datasets where all the necessary information is captured by the first two GIN layers that come before pooling or in datasets where only a small part of the graph is what determines the class. Nevertheless, this second experiment serves two purposes. First, it demonstrates the soundness of the GNN architecture used in the first experiment, which achieves results comparable to those of models carefully optimized on the benchmark datasets [16]. Second, and most importantly, it shows that the performances on the benchmark datasets and EXPWL1 are aligned; this underlines the relevance of our theoretical result on the expressiveness in practical applications. It is worth noting that on the benchmark datasets, it was not possible to obtain a pooling ratio of 0.1 for both Graclus and ECPool. Using a pooling ratio of 0.5 gives Graclus and ECPool an advantage over other methods, which makes the comparison not completely fair and shows an important limitation of these two methods.

As a concluding remark, we comment on the training time of the dense and sparse pooling methods. A popular argument in favor of sparse pooling methods is their computational advantage compared to the dense ones. Our results show that this is not the case in modern deep-learning pipelines. In fact, ECPool and PanPool are approximately 10 times slower than dense pooling methods, ASAPool is twice as slow, and the only sparse method with training times lower than the dense ones is \(k\)-MIS. While it is true that the sparse methods save memory by avoiding computing intermediate dense matrices, such an advantage is relevant only for extremely large graphs that are rarely encountered in practical applications.

## 5 Conclusions

In this work, we studied for the first time the expressive power of pooling operators in GNNs. We identified the sufficient conditions that a pooling operator must satisfy to fully preserve the expressive power of the original GNN model. Based on our theoretical results, we proposed a principled approach to evaluate the expressive power of existing graph pooling operators by verifying whether they met the conditions for expressiveness.

To empirically test the expressive power of a GNN, we introduced a new dataset that allows verifying if a GNN architecture achieves the same discriminative power of the WL test. We used such a dataset to evaluate the expressiveness of a GNN equipped with different pooling operators and we found that the experimental results were consistent with our theoretical findings. We believe that the proposed dataset would be a valuable tool as it allows, with minimal effort, to empirically test the expressive power of any MP layers and pooling operators within a GNN.

In our experimental evaluation, we also considered popular benchmark datasets for graph classification and found that the expressive pooling operators achieved the highest performance. This confirmed the relevance of our principled criterion in practical applications to select a pooling operator based on its expressiveness. Finally, we focused on the computational time of the pooling methods and found

Figure 3: Average accuracy and average runtime across the benchmark graph classification datasets.
that most sparse pooling methods not only perform worse due to their weak expressive power but are also not faster than the more expressive pooling methods.

We hope our work will provide novel insights into the relational deep-learning community and help to debunk misconceptions and criticism towards graph pooling.

### Acknowledgements

We gratefully acknowledge the support of Nvidia Corporation with the donation of the RTX A6000 GPUs used in this work. We also thank Daniele Zambon, Caterina Graziani and Antonio Longa for the useful discussions.
