How Expressive are Graph Neural Networks in Recommendation?
Graph Neural Networks (GNNs) have demonstrated superior performance on
various graph learning tasks, including recommendation, where they leverage
user-item collaborative filtering signals in graphs. However, theoretical
formulations of their capability are scarce, despite their empirical
effectiveness in state-of-the-art recommender models. Recently, research has
explored the expressiveness of GNNs in general, demonstrating that message
passing GNNs are at most as powerful as the Weisfeiler-Lehman test, and that
GNNs combined with random node initialization are universal. Nevertheless, the
concept of "expressiveness" for GNNs remains vaguely defined. Most existing
works adopt the graph isomorphism test as the metric of expressiveness, but
this graph-level task may not effectively assess a model's ability in
recommendation, where the objective is to distinguish nodes of different
closeness. In this paper, we provide a comprehensive theoretical analysis of
the expressiveness of GNNs in recommendation, considering three levels of
expressiveness metrics: graph isomorphism (graph-level), node automorphism
(node-level), and topological closeness (link-level). We propose the
topological closeness metric to evaluate GNNs' ability to capture the
structural distance between nodes, which aligns closely with the objective of
recommendation. To validate the effectiveness of this new metric in evaluating
recommendation performance, we introduce a learning-less GNN algorithm that is
optimal on the new metric and can be optimal on the node-level metric with
suitable modification. We conduct extensive experiments comparing the proposed
algorithm against various types of state-of-the-art GNN models to explore the
explainability of the new metric in the recommendation task. For
reproducibility, implementation codes are available at
https://github.com/HKUDS/GTE.
Xuheng Cai, Lianghao Xia, Xubin Ren, Chao Huang
# How Expressive are Graph Neural Networks in Recommendation?

###### Abstract.

Graph Neural Networks (GNNs) have demonstrated superior performance in various graph learning tasks, including recommendation, where they explore user-item collaborative filtering signals within graphs. However, despite their empirical effectiveness in state-of-the-art recommender models, theoretical formulations of their capability are scarce. Recently, researchers have explored the expressiveness of GNNs, demonstrating that message passing GNNs are at most as powerful as the Weisfeiler-Lehman test, and that GNNs combined with random node initialization are universal. Nevertheless, the concept of "expressiveness" for GNNs remains vaguely defined. Most existing works adopt the graph isomorphism test as the metric of expressiveness, but this graph-level task may not effectively assess a model's ability in recommendation, where the objective is to distinguish nodes of different closeness. In this paper, we provide a comprehensive theoretical analysis of the expressiveness of GNNs in recommendation, considering three levels of expressiveness metrics: graph isomorphism (graph-level), node automorphism (node-level), and topological closeness (link-level). We propose the topological closeness metric to evaluate GNNs' ability to capture the structural distance between nodes, which closely aligns with the recommendation objective. To validate the effectiveness of this new metric in evaluating recommendation performance, we introduce a learning-less GNN algorithm that is optimal on the new metric and can be optimal on the node-level metric with suitable modification. We conduct extensive experiments comparing the proposed algorithm against various types of state-of-the-art GNN models to explore the effectiveness of the new metric in the recommendation task. For the sake of reproducibility, implementation codes are available at [https://github.com/HKUDS/GTE](https://github.com/HKUDS/GTE).

2023

Graph Neural Networks, Recommender Systems +
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.

+
Footnote †: ccs: Information systems Recommender systems.
which primarily focuses on node similarity rather than graph-level properties. In their study on link prediction with subgraph sketching, Chamberlain et al. (Chamberlain et al., 2017) emphasize the importance of distinguishing automorphic nodes (symmetric nodes in the same orbit induced by the graph automorphism group) for link prediction, highlighting that the message passing mechanism of GNNs with equivalent power to the WL test lacks this ability. Although node automorphism is more relevant to link prediction and recommendation than graph isomorphism, it still does not fully align with the objective of recommendation, as it only requires distinguishing different nodes without considering their relative proximity. Secondly, existing works primarily focus on general graphs, while recommendation systems typically involve bipartite user-item interaction graphs, allowing for stronger conclusions regarding the expressiveness of GNNs (as we will demonstrate in Section 3). Figure 0(a) provides an overview of the current progress in formulating the expressiveness of GNNs, depicted by the light orange and green boxes.

In this paper, we propose a comprehensive theoretical framework for analyzing the expressiveness of GNNs in recommendation, encompassing three levels of expressiveness metrics: i) Graph-level: The ability to distinguish isomorphic graphs, while less directly relevant to recommendation tasks, is included in our framework to ensure coherence and consistency with previous works (Beng et al., 2017; Chen et al., 2018; Chen et al., 2018). ii) Node-level: The ability to distinguish automorphic nodes, as mentioned in Chamberlain et al. (Chamberlain et al., 2017), is particularly relevant to recommendation systems as it assesses the model's capability to identify different users and items. At this level, we investigate the impact of equipping message passing GNNs with distinct (yet non-random) initial embeddings. Our research demonstrates that GNNs with distinct initial embeddings can successfully differentiate some of the automorphic nodes, although not all of them. Notably, we establish that when the graph is constrained to a bipartite structure, GNNs with distinct initial embeddings are capable of distinguishing all automorphic nodes. iii) Link-level: The ability to discriminate nodes of different topological closeness to a given node. We define topological closeness in Section 4 and propose it as a new metric of expressiveness that directly aligns with the recommendation objective. Our theoretical analysis shows that the popular paradigm adopted in most GNN-based recommender systems (message passing GNN with random initial embeddings, using the inner product between embeddings as the prediction score) cannot fully discriminate nodes based on topological closeness. The relations between the three levels of metrics to different graph tasks are illustrated in Figure 0(b).

It is worth noting that no single expressiveness metric can fully explain recommendation, as user preferences involve much more complicated factors than what can be encoded in a user-item interaction graph. Even if a metric directly aligns with the recommendation objective, achieving optimality on that metric does not guarantee flawless recommendation performance. Therefore, in Section 5, we analyze the effectiveness of topological closeness, the newly proposed metric, in explaining recommendation performance. Specifically, we propose a lightweight Graph Topology Encoder (GTE) that adopts the message passing framework, but does not have learnable parameters. The learning-less characteristic of GTE makes it much more efficient than learning-based GNN recommends. We prove that GTE is optimal on the new topological closeness metric and can achieve optimality on the node automorphism metric and the expressive power equivalent to the WL test on the graph isomorphism metric with suitable modification of the mapping function. Since GTE is optimal in discriminating nodes by topological closeness, we conduct various experiments with GTE and state-of-the-art GNN and GCL models to evaluate the effectiveness of the new metric in the recommendation task. The theories we prove in this paper and their relations to previous works are presented in Figure 0(a) (highlighted blue boxes).

In summary, our contributions are highlighted as follows:

* We perform a comprehensive theoretical analysis on the expressiveness of GNNs in recommendation under a three-level framework designed specifically for the recommendation task.
* We introduce a new link-level metric of GNN expressiveness, topological closeness, that directly aligns with the recommendation objective and is more suitable for evaluating recommendation expressiveness.
* We propose a learning-less GNN algorithm GTE that is optimal on the link-level metric, whose learning-less feature enables it to be much more efficient than learning-based GNN recommenders.
* We conduct extensive experiments on six real-world datasets of different sparsity levels with GTE and various baselines to explore the effectiveness of topological closeness in recommendation.

## 2. Preliminaries and Related Work

### GNNs for Recommendation

The ability to extract multi-hop collaborative signals by aggregating neighborhood representation makes graph neural networks a prominent direction of research in recommender systems (Kang et al., 2017; Wang et al., 2018). Most GNN-based recommender models adopt the message passing

Figure 1. Theoretical framework of GNN expressiveness.
type of GNNs, or more specifically, the graph convolutional networks (GCN) (GCN) (GCN and GCN, 2017), as the backbone, such as NGCF (Zhou et al., 2018) and PinSage (2018). GCCF (GCN and GCN, 2017) incorporates the residual structure into this paradigm. LightGCN (GCN and GCN, 2017) further adapts to the recommendation task by removing the non-linear embedding transformation. There are also attempts to enhance the GCN framework with supplementary tasks, such as masked node embedding reconstruction in (Zhou et al., 2018).

Recently, the self-supervised learning (SSL) paradigm has been incorporated into GNN-based recommenders to address the data sparsity issue (Zhou et al., 2018; PinSage and GCN, 2018; Zhou et al., 2018; GCN and GCN, 2017). The graph contrastive learning (GCL) is one of the most prominent lines of research that leverages the self-supervision signals produced by aligning embeddings learned from different views. Various GCL approaches have been proposed to produce augmented views, such as random feature dropout (Zhou et al., 2018), hypergraph global learning (Zhou et al., 2018), adaptive dropping based on node centrality (Zhou et al., 2018), embeddings noisy perturbation (Zhou et al., 2018), and SVD-reconstruction (Beng et al., 2018). Despite their promising performance on real data, these models are often validated by experiments, with little theoretical formulation and guarantee on their capability.

### The Graph-Level Expressive Power of GNNs

In recent years, there has been significant research investigating the expressiveness of GNNs using graph-level metrics, such as the graph isomorphism test. In particular, Xu et al. (2018) demonstrate that the expressive power of message passing GNNs is at most equivalent to the Weisfeiler-Lehman (WL) test, a popular graph isomorphism algorithm. Additionally, they establish that this equivalence can be achieved by ensuring that both the aggregation function and the readout function are injective. In our analysis, we adopt and adapt their conclusions, introducing relevant concepts and notations that will be utilized throughout our study.

**Theorem 1** (from Xu et al. (2018)).: _Let \(h_{v}^{(k)}\) be the feature of node \(v\) in the \(k\)-th iteration, and \(\mathcal{N}(v)\) be the set of neighboring nodes of \(v\). With sufficient layers, a GNN can map any two graphs \(G_{1}\) and \(G_{2}\) that the WL-test decides as non-isomorphic to two different multisets of node features \(\{h_{v}^{(k)}\}_{1}\) and \(\{h_{v}^{(k)}\}_{2}\), if the aggregation function \(h_{v}^{(k)}=g((h_{u}^{(k-1)}:u\in\mathcal{N}(v)\cup\{v\}))\) is injective. Here, a multiset is defined as a set that allows multiple instances from its elements._

It is noteworthy that the aforementioned theorem solely focuses on the message passing mechanism of GNNs and assumes that nodes possess identical constant initial features, similar to the WL test. However, recent studies by Abboud et al (2018) and Sato et al (2018) highlight that the capacity of GNNs can be significantly enhanced when nodes are equipped with randomly initialized features. Remarkably, random node initialization empowers GNNs with universality, enabling them to approximate any function on a graph and potentially solve the graph isomorphism problem (Beng et al., 2018). It is important to emphasize that this conclusion does not come with a complexity guarantee since the computational complexity of the graph isomorphism problem remains unknown. Random initialization represents a stronger assumption and presents greater challenges for analysis. In our paper, we specifically investigate the impact of a weaker assumption, distinct initialization, on the expressiveness of GNNs.

However, when evaluating the expressiveness of GNNs in recommendation systems, it is important to use metrics that align with the specific task of recommendation itself. Graph isomorphism tests and graph-level metrics, such as graph classification, may not directly capture the ability of GNNs to distinguish between different item nodes and accurately discriminate their closeness to a user node. In the context of link prediction, Chamberlain et al. (2018) suggest that the performance of message passing GNNs is hindered by their inability to differentiate automorphic nodes. Automorphic nodes refer to symmetric nodes within the same orbit induced by the graph automorphism group (e.g., nodes \(a\) and \(b\), \(c\) and \(d\), \(e\) and \(f\)). The issue arises because automorphic nodes are assigned the same final features during the Weisfeiler-Lehman (WL) test, leading to indistinguishable effects in message passing GNNs. However, it is worth noting that this limitation assumes that all nodes have identical initial features. As a node-level metric, the ability to distinguish automorphic nodes becomes more relevant as it reflects the model's capability to differentiate between users and items. Therefore, it serves as a more appropriate metric for assessing GNN expressiveness in recommendation systems. Subsequent sections of our paper will demonstrate how GNNs, with distinct initial embeddings, can effectively address the issue of distinguishing automorphic nodes in user-item bipartite graphs.

## 3. Expressing Node-Level

Distinguishability of GNNs

This section explores how distinct initial embeddings (DIE) enhance GNNs' ability to distinguish automorphic nodes. It's important to note that distinct initialization is a more relaxed assumption than random initialization in (Beng et al., 2018; GCN and GCN, 2017), as it accepts any set of predefined unique initial embeddings, including the simplest one-hot encoding by node ID. We classify the automorphic nodes into three types:

* **Type I**: a pair of automorphic nodes \(u\) and \(v\) such that \(\mathcal{N}(u)=\mathcal{N}(v)\) (i.e., they share the same set of neighboring nodes). For example, \(c\) and \(d\) in Figure 2.
* **Type II**: a pair of automorphic nodes \(u\) and \(v\) such that \(u\in\mathcal{N}(v)\), \(v\in\mathcal{N}(u)\), and \(\mathcal{N}(u)-\{v\}=\mathcal{N}(v)-\{u\}\) (i.e., they are neighbors to each other, and share the same set of other neighboring nodes). For example, \(a\) and \(b\) in Figure 2.
* **Type III**: a pair of automorphic nodes \(u\) and \(v\) such that \(\mathcal{N}(u)-\{v\}\neq\mathcal{N}(v)-\{u\}\) (i.e., no matter if they are neighbors to each other, their neighborhoods differ by at least a pair of automorphic nodes \(w\) and \(w^{\prime}\), such that \(w\in N(u)\) but \(w^{\prime}\notin N(u)\)1). For example, \(e\) and \(f\) in Figure 2.

Figure 2. Illustrated examples of three types of automorphic nodes.(\(a\) and \(b\) belong to Type II, \(c\) and \(d\) belong to Type I, \(e\) and \(f\) belong to Type III.)
### DIE Does Not Fully Solve Node Automorphism on General Graphs

In this section, we show that GNNs with distinct initial embeddings can only distinguish two of the three types of automorphic nodes.

**Theorem 2**.: _Assuming that the aggregation function \(g\) of the graph neural networks is injective, and every node receives a distinct initial embedding, for a pair of automorphic nodes \(u\) and \(v\), in every iteration, they will be assigned different embeddings if and only if one of the two conditions is satisfied: (i) The GNN implements residual connections, and \(u\) and \(v\) belong to Type I or Type III. (ii) The GNN does not implement residual connections, and \(u\) and \(v\) belong to Type II or Type III. In other words, regardless of whether the GNN implements residual connections or not, it can only distinguish two out of the three types of automorphic nodes._

**Proof**. We first prove case (i), i.e, with residual connections:

We prove that for a pair of automorphic nodes \(u\) and \(v\) of Type I or III, they will be assigned different embeddings in any iteration \(k\). This is obviously true when \(k=0\), because the nodes are initialized with distinct embeddings. If it holds for iteration \(k=i-1\), then in iteration \(k=i\), the embeddings for \(u\) and \(v\) are:

\[h_{u}^{(i)}=g(\{h_{u}^{(i-1)}\}\cup\{h_{w}^{(i-1)}:w\in\mathcal{N}(u)\}) \tag{1}\]

\[h_{v}^{(i)}=g(\{h_{v}^{(i-1)}\}\cup\{h_{w^{\prime}}^{(i-1)}:w^{\prime}\in \mathcal{N}(v)\}) \tag{2}\]

If \(u\) and \(v\) are of Type I, then \(\{h_{u}^{(i-1)}\}\cup\{h_{w}^{(i-1)}:w\in\mathcal{N}(u)\}\) and \(\{h_{v}^{(i-1)}\}\cup\{h_{w^{\prime}}^{(i-1)}:w^{\prime}\in\mathcal{N}(v)\}\) are two distinct multisets, one exclusively containing \(h_{u}^{(i-1)}\) and the other exclusively containing \(h_{v}^{(i-1)}\), and \(h_{u}^{(i-1)}\neq h_{v}^{(i-1)}\). If \(u\) and \(v\) are of Type III, the above-mentioned two multisets are also distinct, because there exists at least a pair of automorphic nodes \(w\) and \(w^{\prime}\) (distinct from \(u\), \(v\)), such that \(w\in N(u)\) but \(w\notin N(v)\), \(w^{\prime}\in N(v)\) but \(w^{\prime}\notin N(u)\). Thus, \(h_{u}^{(i-1)}\) and \(h_{w^{\prime}}^{(i-1)}\) are exclusively in one of the two multisets, respectively. Moreover, \(w,w^{\prime}\) must be Type III automorphic nodes, because their neighborhoods differ by nodes other than each other (\(u\) and \(v\)). By induction assumption, \(h_{w}^{(i-1)}\neq h_{w^{\prime}}^{(i-1)}\). In summary, the input multisets of \(u\) and \(v\) to \(g\) must be different if they are Type I or III. Then, since \(g\) is injective, \(h_{u}^{(i)}\neq h_{v}^{(i)}\). By induction, this holds for all iterations. If \(u\) and \(v\) are of Type II, the inputs to the two multisets are the same, and the above result does not hold.

Next, we prove case (ii), i.e, without residual connection:

Similarly, we can demonstrate that for a pair of automorphic nodes \(u\) and \(v\) of Type II or III, they will be assigned different embeddings in any iteration \(k\). This is evident when \(k=0\) because the nodes are initially initialized with distinct embeddings. Assuming it holds true for iteration \(k=i-1\), we can show that when \(k=i\), the embeddings for nodes \(u\) and \(v\) are as follows:

\[h_{u}^{(i)}=g(\{h_{w}^{(i-1)}:w\in\mathcal{N}(u)\}) \tag{3}\]

\[h_{v}^{(i)}=g(\{h_{w^{\prime}}^{(i-1)}:w^{\prime}\in\mathcal{N}(v)\}) \tag{4}\]

If nodes \(u\) and \(v\) are of Type II, we can observe that the multisets \(h_{w}^{(i-1)}:w\in\mathcal{N}(u)\) and \(h_{w^{\prime}}^{(i-1)}:w^{\prime}\in\mathcal{N}(v)\) are two distinct multisets. Specifically, one exclusively contains the embedding \(h_{v}^{(i-1)}\), while the other exclusively contains the embedding \(h_{u}^{(i-1)}\). It is also established that \(h_{u}^{(i-1)}\neq h_{v}^{(i-1)}\). if nodes \(u\) and \(v\) are of Type III, the arguments presented in the case of Type II still apply. Thus, the input multisets of nodes \(u\) and \(v\) to the aggregation function \(g\) must be different if they are of Type I or II. Then, since the aggregation function \(g\) is injective, we can conclude that \(h_{u}^{(i)}\neq h_{v}^{(i)}\). By induction, we can assert that this holds for all iterations.

However, if \(u\) and \(v\) are of Type I, the inputs to the two multisets are the same, and the above result does not hold. 

This theorem suggests that on a general graph, using distinct embedding initialization can only provide partial differentiation between automorphic nodes for GNNs. However, it is important to note that user-item interaction graphs in recommendation systems are bipartite graphs, where a user node cannot be connected to another user node, and an item node cannot be connected to another item node. This bipartite structure allows us to leverage this inherent feature and demonstrate that with distinct initial embeddings, GNNs can fully address the node automorphism problem on user-item bipartite graphs.

### DIE Solves Node Automorphism on Bipartite Graphs

We start by proving that Type II automorphic nodes cannot exist in a connected bipartite graph with more than two nodes.

**Lemma 3**.: _In a connected bipartite graph with more than 2 nodes, if a pair of nodes \(u\) and \(v\) are automorphic, they cannot be Type II automorphic nodes._

**Proof**. If \(u\) and \(v\) are both user nodes or both item nodes, there cannot be an edge between them, so the condition for Type II, \(u\in\mathcal{N}(v)\) and \(v\in\mathcal{N}(u)\), cannot hold. If one of \(u\), \(v\) is a user node and another one is an item node, and they are neighbors to each other, then since all neighbors of a user node must be item nodes, and all neighbors of an item node must be user nodes, \(\mathcal{N}(u)-\{v\}\) cannot be equal to \(\mathcal{N}(v)-\{u\}\), unless \(\mathcal{N}(u)-\{v\}=\emptyset\) and \(\mathcal{N}(v)-\{u\}=\emptyset\). If \(\mathcal{N}(u)-\{v\}=\emptyset\) and \(\mathcal{N}(v)-\{u\}=\emptyset\), then \(u\) and \(v\) must form a connected component that is isolated from the rest of the graph. However, since the graph is a connected bipartite graph with more than 2 nodes, the above scenario cannot occur. 

With Lemma 3 and Theorem 2, we prove the following theorem.

**Theorem 4**.: _Assume that the graph is a connected bipartite graph with more than 2 nodes. Assume that the aggregation function \(g\) of the GNN is injective, and residual connections are implemented. Assume that every node receives a distinct initial embedding. For a pair of automorphic nodes \(u\) and \(v\), in every iteration, they will be assigned different embeddings._

**Proof**. By Lemma 3, \(u\) and \(v\) must be either Type I or III automorphic nodes. By Theorem 2, as long as the GNN implements residual connections, \(u\) and \(v\) will be assigned different embeddings in every iteration due to the injectivity of the aggregation function. 

This conclusion indicates that a GNN is capable of distinguishing automorphic nodes on a connected user-item bipartite graph with the following three design choices: i) distinct initial embeddings; ii) residual connections; iii) injective aggregation function. These design choices provide a useful guideline for developing powerful
GNN-based recommender systems that aim to achieve optimal expressiveness on the node-level metric.

## 4. Encoding Node Topological Closeness with GNNs

While the capability of node automorphism provides a better metric for recommendation expressiveness, it is not directly aligned with the intended task. This is because it only focuses on distinguishing between different nodes, without considering their structural closeness to one another. In recommendation systems, models should not only differentiate between two items but also determine which one is closer to the target user's profile. Therefore, it is important to focus on a link-level metric that captures the closeness between nodes in the graph's structural space.

The traditional metric for evaluating the closeness between two nodes is the geodesic distance, which is defined as the length of the shortest path between the two nodes (Beng et al., 2017; Chen et al., 2018). However, this metric may not accurately reflect the true similarity between nodes as encoded in the graph structure. This is especially true in tasks where clusters and community structures are important, such as recommendation systems. For instance, in Figure 2(b), nodes \(v_{1}\) and \(v_{2}\) have the same geodesic distance to node \(u\). However, it is evident that \(v_{2}\) should be considered "closer" to \(u\) than \(v_{1}\) because they reside together in a denser cluster.

In light of this limitation, we propose a new link-level metric _topological closeness_ that evaluates the closeness between two nodes by considering not only the length of the shortest path but also the number of possible paths between them.

### Topological Closeness

Here, we define the k-hop topological closeness between two nodes \(u\) and \(v\), denoted as \(k\)-\(TC(u,v)\), as follows.

**Definition 5** (k-Hop Topological Closeness).: _Given two nodes \(u\) and \(v\) in an undirected graph, the \(k\)-hop topological closeness between \(u\) and \(v\) in this graph is defined as:_

\[k\text{-}TC(u,v)=\left|\mathcal{P}^{k}_{u,v}\right|\]

_where \(\mathcal{P}^{k}_{u,v}\) is the set of all possible paths of length \(k\) between \(u\) and \(v\). Note that the paths here allow repeated vertices, repeated edges, and self-loops. We further define the 0-hop topological distance between \(a\) node \(u\) and itself as 0-\(TC(u,u)=1\)._

The capability of topological closeness (TC) to intuitively capture both the distance and clustering information between two nodes is illustrated in Figure 3. In Figure 2(a), both \(v_{1}\) and \(v_{2}\) have only one simple path2 to \(u\), representing the minimum clustering structure they can have when connected to \(u\). Additionally, \(v_{1}\) has a shorter distance to \(u\) compared to \(v_{2}\). Consequently, \(v_{1}\) exhibits a higher TC value to \(u\) than \(v_{2}\). This occurs because TC takes into account self-loops and repeated vertices, and a shorter simple path allows more possible paths of length \(k\) with self-loops and repeated vertices. In Figure 2(b), both \(v_{1}\) and \(v_{2}\) are equidistant from \(u\). However, \(v_{2}\) resides within a denser cluster alongside \(u\). Thus, \(v_{2}\) demonstrates a higher TC value to \(u\) compared to \(v_{1}\), due to the larger number of paths connecting \(v_{2}\) and \(u\) than those connecting \(v_{1}\) and \(u\).

Footnote 2: A simple path is defined as a path in which all the internal vertices are distinct.

It is important to note that there are multiple methods available for combining clustering density information and the shortest distance between two nodes. For instance, one approach involves calculating a weighted sum of all simple paths connecting the two nodes, where the weight is determined by the inverse of the path length. In our case, we define topological closeness in this manner because this definition aligns naturally with the structure of GNNs and can be efficiently computed using a message-passing GNN. The subsequent two subsections will provide further clarity on this concept and its relevance within our framework.

### Popular GNN Recommender Paradigm Does Not Fully Capture Topological Closeness

In recent years, most GNN-based recommender systems (Chen et al., 2018; Chen et al., 2018; Chen et al., 2018; Wang et al., 2018; Wang et al., 2018) adopt the following paradigm. Initially, each user \(u\) and item \(v\) are assigned random initial embedding vectors \(\mathbf{e}^{(0)}_{u}\in\mathbb{R}^{d}\) and \(\mathbf{e}^{(0)}_{u}\in\mathbb{R}^{d}\) respectively, where \(d\) represents the dimensionality of the embeddings. In the \(k\)-th GNN layer, the embeddings are updated using the following rule, which incorporates residual connections:

\[\mathbf{e}^{(k)}_{u} =\sigma(\sum_{v\in\mathcal{N}(u)}\!\!\phi(\mathbf{e}^{(k-1)}_{u})) +\mathbf{e}^{(k-1)}_{u} \tag{5}\] \[\mathbf{e}^{(k)}_{v} =\sigma(\sum_{u\in\mathcal{N}(v)}\!\!\phi(\mathbf{e}^{(k-1)}_{u})) +\mathbf{e}^{(k-1)}_{v} \tag{6}\]

where \(\sigma\) denoting an activation function and \(\phi\) generally representing the element-wise multiplication with the coefficients in the normalized adjacency matrix, the final embeddings of the nodes can be computed as follows:

\[\mathbf{e}_{u}=\theta(\{\mathbf{e}^{(k)}_{u}\}_{k=0}^{L}),\quad\mathbf{e}_{v}= \theta(\{\mathbf{e}^{(k)}_{v}\}_{k=0}^{L}) \tag{7}\]

where \(L\) represents the number of GNN layers, and \(\theta\) denotes an aggregation function applied to the embeddings from all layers,

Figure 3. Illustrations of Topological Closeness with k=3.
typically implemented as a sum or mean operation. Finally, the predicted score of a user \(u\)'s preference for an item \(v\) is computed by taking the inner product of their final embeddings:

\[\hat{y}_{u,v}=\mathbf{e}_{u}\cdot\mathbf{e}_{v} \tag{8}\]

This section provides a proof demonstrating that the message passing GNN and inner product prediction mechanism employed in this paradigm are unable to completely discriminate between two item nodes based solely on their topological distance from a user node. To further substantiate this claim, we conduct experiments on real-world datasets, which are presented in Section 5.3.

For the sake of simplicity in calculations and clearer presentation, we consider a simplified version of the aforementioned paradigm. Specifically, we assume that \(\sigma\) and \(\phi\) are identity functions. Hence, the embedding updating rule is simplified as:

\[\mathbf{e}_{u}^{(k)}=\sum_{v\in\mathcal{N}(u)}\!\!\!\!\!\!\!\!\!\!\!\!\!\!\! \mathbf{e}_{u}^{(k-1)}+\mathbf{e}_{u}^{(k-1)},\ \ \mathbf{e}_{v}^{(k)}=\sum_{u\in\mathcal{N}(v)}\!\!\!\!\!\!\!\!\!\!\!\!\!\! \!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\! \!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\! \!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\! \!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\! \!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\! \!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\! \!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\! \!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\! \!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\! \!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\! \!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\! \!\!
only study the model structure of message passing and prediction in the above analysis, without considering the learning process. It is possible that the models could fit the task better with learnable embeddings that are widely adopted in GNN recommenders, but theoretical analysis involving learning would require complicated case-by-case analysis that we cannot include here.

### Graph Topology Encoder (GTE)

Indeed, it is evident that no single metric can fully capture a model's capability in recommendation, even if the metric aligns with the recommendation objective. User behavior is considerably more intricate than what is encompassed within the user-item graph's interaction history. As a result, it is crucial to investigate the level of interpretability of the proposed metric in the context of recommendation. To address this concern, we introduce a learning-less GNN algorithm termed GTE. GTE is proven to be optimal in terms of the link-level metric of topological closeness.

At the beginning, each item \(v_{i}\) is assigned a one-hot initial feature \(\mathbf{h}_{u}^{(0)}\in\mathbb{R}^{I}\), where \(I\) is the total number of items. For \(j\in[0,I)\), the \(j\)-th entry of the initial feature is \(\mathbf{h}_{u_{j}}^{(0)}\left[j\right]=\begin{cases}1&i=j\\ 0&i\neq j\end{cases}.\)

Each user \(u_{i}\) is assigned an initial feature vector \(\mathbf{h}_{u_{i}}^{(0)}\in\mathbb{R}^{I}\), where all entries are initialized to \(0\). It is important to note that, unlike traditional GNN-based recommenders where the embeddings are learnable, the features in GTE are fixed. In fact, the entire algorithm does not involve any learning process. In the \(k\)-th GNN layer, the features are propagated on the graph using a simple rule:

\[\mathbf{h}_{u}^{(k)}=\phi\left(\sum_{u\in\mathcal{N}(u)}\mathbf{h}_{o}^{(k-1 )}+\mathbf{h}_{u}^{(k-1)}\right)\text{, }\mathbf{h}_{o}^{(k)}=\phi\left(\sum_{u\in\mathcal{N}(u)}\mathbf{h}_{u}^{(k-1 )}+\mathbf{h}_{o}^{(k-1)}\right)\]

where \(\phi\) is a mapping function, and in our case we simply use the identity function as \(\phi\). The message propagation is performed \(L\) times, where \(L\) is the number of GNN layers. Finally, for user \(u_{i}\), the predicted preference score for item \(v_{j}\) is \(\hat{y}_{i,j}=\mathbf{h}_{u_{i}}^{(L)}\left[j\right]\). Note that unlike most GNN-based recommenders that use inner product for prediction, GTE directly uses a specific dimension in the feature space to represent the score for an item.

The procedure of GTE is formally presented in Algorithm 1. GTE exploits the graph collaborative filtering signals via a fixed GNN structure without any learnable components, which makes the execution of the algorithm fast and reliable. We prove that GTE is optimal on the proposed topological closeness metric by showing that for a user node \(u_{i}\) and two item nodes \(v_{j}\) and \(v_{k}\), if \(L\)-\(TC(u_{i},v_{j})>L\)-\(TC(u_{i},v_{k})\), it is certain that \(\hat{y}_{i,j}>\hat{y}_{i,k}\).

**Lemma 7**.: _In the \(k\)-th layer of GTE, the \(j\)-th dimension of the feature of a node \(w\) (it could be user or item node) can be written as follows, where \(v_{j}\) is the \(j\)-th item node:_

\[\mathbf{h}_{w}^{(k)}\left[j\right]=k\text{-}TC(w,v_{j})\]

**Proof**. This is true when \(k=0\), because if \(w\neq v_{j}\), \(\mathbf{h}_{w}^{(0)}\left[j\right]=0\), and \(0\)-\(TC(w,v_{j})=0\); if \(w=v_{j}\), \(\mathbf{h}_{w}^{(0)}\left[j\right]=\mathbf{h}_{v_{j}}^{(0)}\left[j\right]=1\), and \(0\)-\(TC(w,v_{j})=0\)-\(TC(v_{j},v_{j})=1\).

If it holds for \(k=l-1\), then in layer \(k=l\), the \(j\)-th entry of the feature of \(w\) is:

\[\mathbf{h}_{w}^{(l)}\left[j\right] =\sum_{x\in\mathcal{N}(w)}\mathbf{h}_{x}^{(l-1)}\left[j\right]+ \mathbf{h}_{w}^{(l-1)}\left[j\right] \tag{18}\] \[=\sum_{x\in\mathcal{N}(w)\cup\{w\}}(l-1)\text{-}TC(x,v_{j})\] (19) \[=\sum_{x\in\mathcal{N}(w)\cup\{w\}}\left[\mathcal{P}_{x,v_{j}}^{ (l-1)}\right]\] (20) \[=\sum_{x\in\mathcal{N}(w)\cup\{w\}}\left[\mathcal{P}_{x,v_{j},x }^{(l)}\right]\] (21) \[=\left|\mathcal{P}_{w,v_{j}}^{(l)}\right|=l\text{-}TC(w,v_{j}) \tag{22}\]

By induction, the expression holds for every iteration k. 

**Theorem 8**.: _In GTE, after \(L\) layers, for a user node \(u_{i}\) and two item nodes \(v_{j}\) and \(v_{k}\), if \(L\)-\(TC(u_{i},v_{j})>L\)-\(TC(u_{i},v_{k})\), then \(\hat{y}_{i,j}>\hat{y}_{i,k}\)._

**Proof**. We have shown in Lemma 7 that \(\hat{y}_{i,j}=\mathbf{h}_{u_{i}}^{(L)}\left[j\right]=L\)-\(TC(u_{i},v_{j})\), and \(\hat{y}_{i,k}=\mathbf{h}_{u_{i}}^{(L)}\left[k\right]=L\)-\(TC(u_{i},v_{k})\). Thus, if it holds that \(L\)-\(TC(u_{i},v_{j})>L\)-\(TC(u_{i},v_{k})\), then \(\hat{y}_{i,j}>\hat{y}_{i,k}\). 

The above analysis proves that GTE is optimal on the link-level metric topological closeness, and thus its performance on recommendation datasets can be used to evaluate the effectiveness of the proposed metric.

### The Relations between GTE and the Graph and Node-Level Expressiveness Metrics

As shown in Theorem 1 in Section 2.2, Xu et al. (2019) proved that a GNN can have WL-equivalent power of expressiveness on the graph isomorphism test if the aggregation function \(h_{u}^{(k)}=g(\{h_{u}^{(k-1)}:u\in\mathcal{N}(v)\cup\{o\})\})\) is injective. They further proved that the sum aggregator allows injective functions over multisets. We present an adapted version of the latter conclusion below.

**Theorem 9** (from Xu et al. (2019)).: _Assume the feature space \(\mathcal{X}\) is countable. If the initial features are one-hot encodings, then there exists some function \(\phi\) such that the aggregator \(h_{u}^{(k)}=g(\{h_{u}^{(k-1)}:u\in\mathcal{N}(v)\cup\{o\})\})=\phi\left(h_{o}^{(k-1 )}+\sum_{u\in\mathcal{N}(v)}h_{u}^{(k-1)}\right)\) is injective._

In Section 3.2, we demonstrate the effectiveness of a GNN in distinguishing various automorphic nodes on a connected user-item bipartite graph. This is achieved by proving Theorem 4, which
shows that when residual connections are implemented and the aggregation function \(h_{n}^{(k)}=g(h_{u}^{(k-1)}:u\in\mathcal{N}(v)\cup v)\) is injective

In GTE, residual connections are employed. Consequently, based on the aforementioned conclusions, if the aggregation function is injective, GTE will exhibit equivalent expressiveness to the Weisfeiler-Lehman (WI) algorithm on the graph-level metric and achieve optimal expressiveness on the node-level metric. It is worth noting that in our implementation, the aggregation function of GTE is not injective, as we simply utilize the identity function as \(\phi\). However, according to Theorem 9, it is possible to select \(\phi\) carefully, thereby making the aggregation function injective and enhancing the theoretical capability of GTE on both graph and node-level metrics. It is important to acknowledge that while a suitable choice of \(\phi\) can render the aggregation function injective, it may also compromise the optimality of GTE on the topological closeness metric. Addressing this issue will be a topic for future research endeavors.

## 5. Experiments

To evaluate the explainability of topological closeness in recommendation, we perform experiments on real-world datasets to compare GTE, which is optimal on the metric, against various baselines.

### Experimental Settings

1.1. **Datasets. Yelp**: a widely used dataset containing users' ratings on venues from the Yelp platform. **Douban**: consisting of book reviews and ratings collected by Douban. **Tmall**: an e-commerce dataset recording online purchase history of users on Tmall. **Gowalla**: collected by Gowalla with users' check-in records in different locations. **Amazon-beauty**: a dataset containing Amazon users' reviews and ratings of beauty products. **Sparser-Tmall**: a sparser version of the _Tmall_ dataset by sampling users and items with less interactions. The statistics are summarized in Table 2.

#### 5.1.2. **Evaluation Protocols and Metrics.**

The all-rank protocol is commonly adopted to mitigate sampling bias (Gowalla et al., 2018; Gowalla et al., 2019). For the evaluation metrics, we adopt the widely used Recall@N and Normalized Discounted Cumulative Gain (NDCG)@N, where N = {20, 40}.[3; 15; 26; 32]. The p-values are calculated with T test.

#### 5.1.3. **Baseline Models.**

We adopt the following 8 baselines. We tune the hyperparameters of all the baselines with the ranges suggested in the original papers, except that the size of learnable embeddings is fixed as 32 for all the baselines to ensure fairness.

\begin{table}
\begin{tabular}{c c c c c c c c c c c c c} \hline \hline Dataset & Density & Metric & BiasMF & NGCF & GCCF & LightGCN & SimGRACE & SAIL & HCCF & LightGCL & GTE & _p-val_ & _impr._ \\ \hline \multicolumn{12}{l}{_Denser datasets_} \\ \hline \multirow{3}{*}{Yelp} & & R@20 & 0.0190 & 0.0294 & 0.0462 & 0.0482 & 0.0603 & 0.0471 & 0.0626 & **0.0793** & 0.0647 & 3e\({}^{-13}\) & -18\% \\  & & N@20 & 0.0161 & 0.0243 & 0.0398 & 0.0409 & 0.0435 & 0.0405 & 0.0527 & **0.0668** & 0.0556 & 3e\({}^{-14}\) & -16\% \\  & & R@40 & 0.0371 & 0.0522 & 0.0760 & 0.0803 & 0.0989 & 0.0733 & 0.1040 & **0.1292** & 0.0556 & 2e\({}^{-14}\) & -18\% \\  & & N@40 & 0.0227 & 0.0330 & 0.0508 & 0.0527 & 0.0656 & 0.0516 & 0.081 & **0.0852** & 0.0704 & 4e\({}^{-15}\) & -17\% \\ \hline \multirow{3}{*}{Douban} & & R@20 & 0.0926 & 0.0999 & 0.0986 & 0.1006 & 0.0827 & 0.1211 & 0.1083 & 0.1216 & **0.1269** & 3e\({}^{-7}\) & 4\% \\  & & N@20 & 0.0687 & 0.0739 & 0.0730 & 0.0759 & 0.0603 & 0.0910 & 0.0828 & 0.0927 & **0.1029** & 3e\({}^{-9}\) & 11\% \\  & & R@40 & 0.1424 & 0.1505 & 0.1482 & 0.1530 & 0.1251 & 0.1778 & 0.1593 & 0.1708 & **0.1777** & 3e\({}^{-6}\) & 4\% \\  & & N@40 & 0.0845 & 0.0897 & 0.0887 & 0.0923 & 0.0735 & 0.1090 & 0.0988 & 0.1077 & **0.1182** & 3e\({}^{-9}\) & 10\% \\ \hline \multirow{3}{*}{Tmall} & & R@20 & 0.0103 & 0.0180 & 0.0209 & 0.0225 & 0.0222 & 0.0254 & 0.0314 & 0.0528 & **0.0578** & 1e\({}^{-11}\) & 9\% \\  & & N@20 & 0.0072 & 0.0123 & 0.0141 & 0.0154 & 0.0152 & 0.0177 & 0.0213 & **0.0361** & 0.0290 & 1e\({}^{-13}\) & -20\% \\  & & R@40 & 0.0170 & 0.0310 & 0.0356 & 0.0378 & 0.0367 & 0.0424 & 0.0519 & **0.0852** & 0.0752 & 5e\({}^{-11}\) & -12\% \\  & & N@40 & 0.0095 & 0.0168 & 0.0196 & 0.0208 & 0.0203 & 0.0236 & 0.0284 & **0.0473** & 0.0326 & 5e\({}^{-15}\) & -31\% \\ \hline \multicolumn{12}{l}{_Sparser datasets_} \\ \hline \multirow{3}{*}{Amazon-beauty} & & R@20 & 0.0607 & 0.0734 & 0.0782 & 0.0797 & 0.0539 & 0.0834 & 0.0813 & 0.0896 & **0.0976** & 1e\({}^{-8}\) & 9\% \\  & & N@20 & 0.0249 & 0.0290 & 0.0315 & 0.0326 & 0.0212 & 0.0334 & 0.0339 & 0.0369 & **0.0440** & 1e\({}^{-11}\) & 19\% \\  & & R@40 & 0.0898 & 0.1078 & 0.1155 & 0.1161 & 0.0836 & 0.1196 & 0.1178 & 0.1286 & **0.1322** & 1e\({}^{-4}\) & 3\% \\  & & N@40 & 0.0308 & 0.0360 & 0.0391 & 0.0400 & 0.0272 & 0.0408 & 0.0413 & 0.0447 & **0.0511** & 1e\({}^{-11}\) & 14\% \\ \hline \multirow{3}{*}{Gowalla} & & R@20 & 0.0196 & 0.0552 & 0.0951 & 0.0985 & 0.0869 & 0.0999 & 0.1070 & 0.1578 & **0.1706** & 2e\({}^{-10}\) & 8\% \\  & & N@20 & 0.0105 & 0.0298 & 0.0535 & 0.0593 & 0.0528 & 0.0602 & 0.0644 & 0.0935 & **0.1001** & 8e\({}^{-11}\) & 7\% \\  & & R@40 & 0.0346 & 0.0810 & 0.1392 & 0.1431 & 0.1276 & 0.1472 & 0.1535 & 0.2245 & **0.2400** & 5e\({}^{-11}\) & 7\% \\  & & N@40 & 0.0145 & 0.0367 & 0.0684 & 0.0710 & 0.0637 & 0.0725 & 0.0767 & 0.1108 & **0.1181** & 1e\({}^{-10}\) & 7\% \\ \hline \multirow{3}{*}{Sparser-Tmall} & & R@20 & 0.0328 & 0.0395 & 0.0543 & 0.0542 & 0.0174 & 0.0521 & 0.0501 & 0.0518 & **0.0588** & 1e\({}^{-10}\) & 14\% \\  & & N@20 & 0.0169 & 0.0196 & 0.0290 & 0.0288 & 0.0084 & 0.0282 & 0.0270 & 0.0300 & **0.0368** & 2e\({}^{-9}\) & 23\% \\ \cline{1-1}  & & R@40 & 0.0439 & 0.0552 & 0.0717 & 0.0708 & 0.0274 & 0.0685 & 0.0655 & 0.0653 &
* **BiasMF**(Krishna et al., 2017). This model employs matrix factorization to learn latent embeddings for users and items.
* **NGCF**(Krishna et al., 2017). It aggregates feature embeddings with high-order connection information over the user-item interaction graph.
* **GCCF**(Chen et al., 2017). It adopts an improved GNN model that incorporates a residual structure and eliminates non-linear transformations.
* **LightGCN**(Krishna et al., 2017). It implements an effective GNN structure without embedding transformations and non-linear projections.
* **SimGRACE**(Krishna et al., 2017). It creates an augmented view by introducing random perturbations to GNN parameters.
* **SAIL**(Wang et al., 2017). It adopts a self-augmented approach that maximizes the alignment between learned features and initial features.
* **HCCF**(Wang et al., 2017). It contrasts global information encoded with a hypergraph against local signals propagated with GNN.
* **LightGCL**(Chen et al., 2017). It guides the contrastive view augmentation with singular value decomposition and reconstruction.

### Performance Comparison and Analysis

The performance results are presented in Table 1. The number of GNN layers for GTE is set as 3 for all datasets. As shown in the table, GTE can achieve comparable performance to the SOTA GCL models. The mechanism of GTE revolves around effectively discriminating different items based on their topological closeness to a user. Therefore, these results indicate that the proposed topological closeness metric accurately reflects a model's proficiency in performing the recommendation task.

Furthermore, GTE exhibits superior performance on sparse data. Specifically, while GTE consistently outperforms other baselines, it occasionally performs worse than LightGCL on the three denser datasets. However, on the three sparser datasets, GTE consistently outperforms LightGCL. This discrepancy can be attributed to the reliance of learning-based methods on the availability of supervision signals. In scenarios where there is an abundance of user-item collaborative signals, learning-based methods can more effectively capture complex patterns in the data compared to learning-less or heuristic algorithms like GTE. However, in cases where the interaction history is limited, which often occurs in recommendation systems, the performance of learning-based methods deteriorates more rapidly than that of fixed algorithms.

By capturing the topological closeness between nodes with a learning-less structure, GTE achieves satisfactory performance rapidly and reliably. Since GTE is not subject to any random factors, the p-values in Table 1 are of negligible magnitudes. Table 3 presents an intuitive comparison of the running time of GTE and the efficient GCL baseline LightGCL, where GTE is run on CPU only, and LightGCL is run with an NVIDIA GeForce RTX 3090 GPU.

### Topological Closeness Aligns with Real Data

To demonstrate the discriminative ability of the topological closeness metric in real datasets, we randomly sample 400 pairs of positive and negative items and calculate the difference between their topological closeness to the target users. The results are plotted in Figure 4. It is clear from the plot that the majority of the differences are larger than 0, with only negligible exceptions. This indicates that the positive items have a higher topological closeness to the user than the negative items.

### Popular GNN Recommenders Perform Poorly on Topological Closeness

Section 4.2 provides a mathematical demonstration showing that popular GNN recommender models are unable to fully capture the topological closeness between nodes. Specifically, we sort the items based on the prediction scores generated by GTE and the baseline models. We then calculate the Kendall rank correlation coefficient (\(\tau\)), a widely used indicator for measuring the ordinal difference between two rankings (Krishna et al., 2017), between these rankings. Since GTE is optimized for topological closeness, its ranking represents the ideal prediction based on this metric. As depicted in Figure 5, the \(\tau\) values for the baselines cluster around 0.05 to 0.25. This indicates that the predictions made by the baselines exhibit positive correlations with the ideal ranking, but are significantly misaligned with it.

## 6. Conclusion

In this paper, we provide a comprehensive analysis of GNNs' expressiveness in recommendation, using a three-level theoretical framework consisting of graph/node/link-level metrics. We prove that with distinct initial embeddings, injective aggregation function and residual connections, GNN-based recommenders can achieve optimality on the node-level metric on bipartite graphs. We introduce the topological closeness metric that aligns with recommendation, and propose the learning-less GTE algorithm provably optimal on this link-level metric. By comparing GTE with baseline models, we show the effectiveness of the proposed metric. The presented theoretical framework aims to inspire the design of powerful GNN-based recommender systems. While achieving optimality on all three metrics is challenging, the framework serves as a guiding direction for selecting well-justified model structures.

Figure 4. Difference between the topological closeness of users to their positive items and negative items.

\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline  & Yelp & Douban & Tmall & Gowalla & Amazon & s-Tmall \\ LightGCL & 216.12 & 38.54 & 65.03 & 284.12 & 21.06 & 30.24 \\ GTE & 1.85 & 0.64 & 0.84 & 5.11 & 0.26 & 2.10 \\ \hline \hline \end{tabular}
\end{table}
Table 3. Efficiency comparison in terms of total running time between GTE (w/o GPU) and LightGCL (w. GPU), in minutes.

Figure 5. The ordinal difference (measured in Kendall’s \(\tau\) coefficient) between the predictions made by the baselines and the ideal predictions based on topological closeness.