# Equivariant and Stable Positional Encoding for More Powerful Graph Neural Networks

Graph neural networks (GNN) have shown great advantages in many graph-based learning tasks but often fail to predict accurately for a task-based on sets of nodes such as link/motif prediction and so on. Many works have recently proposed to address this problem by using random node features or node distance features. However, they suffer from either slow convergence, inaccurate prediction, or high complexity. In this work, we revisit GNNs that allow using positional features of nodes given by positional encoding (PE) techniques such as Laplacian Eigenmap, Deepwalk, etc. GNNs with PE often get criticized because they are not generalizable to unseen graphs (inductive) or stable. Here, we study these issues in a principled way and propose a provable solution, a class of GNN layers termed PEG with rigorous mathematical analysis. PEG uses separate channels to update the original node features and positional features. PEG imposes permutation equivariance w.r.t. the original node features and rotation equivariance w.r.t. the positional features simultaneously. Extensive link prediction experiments over 8 real-world networks demonstrate the advantages of PEG in generalization and scalability.

• 1 publication
• 7 publications
• 19 publications
• 63 publications
06/11/2019

### Position-aware Graph Neural Networks

Learning node embeddings that capture a node's position within the broad...
08/20/2020

### A comparative study of similarity-based and GNN-based link prediction approaches

The task of inferring the missing links in a graph based on its current ...
11/22/2020

### Revisiting graph neural networks and distance encoding in a practical view

Graph neural networks (GNNs) are widely used in the applications based o...
08/23/2021

### Integrating Transductive And Inductive Embeddings Improves Link Prediction Accuracy

In recent years, inductive graph embedding models, viz., graph neural ne...
12/26/2020

### Graph neural network based approximation of Node Resiliency in complex networks

The emphasis on optimal operations and efficiency has led to increased c...
06/11/2021

### Breaking the Limit of Graph Neural Networks by Improving the Assortativity of Graphs with Local Mixing Patterns

Graph neural networks (GNNs) have achieved tremendous success on multipl...
02/22/2021

### MagNet: A Magnetic Neural Network for Directed Graphs

The prevalence of graph-based data has spurred the rapid development of ...

## 1 Introduction

Graph neural networks (GNN), inheriting from the power of neural networks (hornik1989multilayer)

, have recently become the de facto standard for machine learning with graph-structured data

(scarselli2008graph). While GNNs can easily outperform traditional algorithms for single-node tasks (such as node classification) and whole graph tasks (such as graph classification), GNNs predicting over a set of nodes often achieve subpar performance. For example, for link prediction, GNN models, such as GCN (kipf2016semi), GAE (kipf2016variational)

may perform even worse than some simple heuristics such as common neighbors and Adamic Adar

(liben2007link) (see the performance comparison over the networks Collab and PPA in Open Graph Benchmark (OGB) (hu2020open)). Similar issues widely appear in node-set-based tasks such as network motif prediction (liu2022neural; besta2021motif), motif counting (zhengdao2020can), relation prediction (wang2021relational; teru2020inductive) and temporal interaction prediction (wang2021inductive), which posts a big concern for applying GNNs to these relevant real-world applications.

The above failure is essentially induced by the loss of node identities during the intrinsic computation of GNNs. Nodes that get matched under graph automorphism will be associated with the same representation by GNNs and thus are indistinguishable (see Fig. 1

(i)). A naive way to solve this problem is to pair GNNs with one-hot encoding as the extra node feature. However, it violates the fundamental inductive bias, i.e., permutation equivariance which GNNs are designed for, and thus may lead to poor generalization capability: The obtained GNNs are not transferable (inductive) across different node sets and different graphs or stable to network perturbation.

Many works have been recently proposed to address such an issue. The key idea is to use augmented node features, where either random features (RF) or deterministic distance encoding (DE) can be adopted. Interested readers may refer to the book chapter (GNNBook-ch5-li) for detailed discussion. Here we give a brief review. RF by nature distinguishes nodes and guarantees permutation equivariance if the distribution to generate RF keep invariant across the nodes. Although GNNs paired with RF have been proved to be more expressive (murphy2019relational; sato2021random), the training procedure is often hard to converge and the prediction is noisy and inaccurate due to the injected randomness (abboud2020surprising). On the other hand, DE defines extra features by using the distance from a node to the node set where the prediction is to be made (li2020distance). This technique is theoretically sound and empirically performs well (zhang2018link; li2020distance; zhang2020revisiting). But it introduces huge memory and time consumption. This is because DE is specific to each node set sample and no intermediate computational results, e.g., node representations in the canonical GNN pipeline can be shared across different samples.

To alleviate the computational cost of DE, absolute positions of nodes in the graph may be used as the extra features. We call this technique as positional encoding (PE). PE may approximate DE by measuring the distance between positional features and can be shared across different node set samples. However, the fundamental challenge is how to guarantee the GNNs trained with PE keep permutation equivariant and stable. Using the idea of RF, previous works randomize PE to guarantee permutation equivariance. Specifically, you2019position designs PE as the distances from a node to some randomly selected anchor nodes. However, the approach suffers from slow convergence and achieves merely subpar performance. srinivasan2020equivalence states that PE using the eigenvectors of the randomly permuted graph Laplacian matrix keeps permutation equivariant. dwivedi2020generalization; kreuzer2021rethinking argue that such eigenvectors are unique up to their signs and thus propose PE that randomly perturbs the signs of those eigenvectors. Unfortunately, these methods are problematic. They fail to provide permutation equivariant GNNs when the matrix has multiple eigenvalues, which thus are dangerous when applying to many practical networks. For example, large social networks, when not connected, have multiple 0 eigenvalues; small molecule networks often have non-trivial automorphism that may give multiple eigenvalues. Even if the eigenvalues are distinct, these methods are unstable. We prove that the sensitivity of node representations to the graph perturbation depends on the inverse of the smallest gap between two consecutive eigenvalues, which could be actually large when two eigenvalues are close (Lemma 3.4).

In this work, we propose a principled way of using PE to build more powerful GNNs. The key idea is to use separate channels to update the original node features and positional features. The GNN architecture keeps not only permutation equivariant w.r.t. node features but also rotation equivariant w.r.t. positional features. This idea applies to a broad range of PE techniques that can be formulated as matrix factorization (qiu2018network) such as Laplacian Eigenmap (LE) (belkin2003laplacian) and Deepwalk (perozzi2014deepwalk). We design a GNN layer PEG that satisfies such requirements. PEG is provably stable: In particular, we prove that the sensitivity of node representations learnt by PEG only depends on the gap between the th and th eigenvalues of the graph Laplacian if -dim LE is adopted as PE, instead of the smallest gap between any two consecutive eigenvalues that previous works have achieved.

PEG gets evaluated in the most important node-set-based task, link prediction, over 8 real-world networks. PEG achieves comparable performance with strong baselines based on DE while having much lower training and inference complexity. PEG achieves significantly better performance than other baselines without using DE. Such performance gaps get enlarged when we conduct domain-shift link prediction, where the networks used for training and testing are from different domains, which effectively demonstrates the strong generalization and transferability of PEG.

### 1.1 Other related works

As long as GNNs can be explained by a node-feature-refinement procedure (hamilton2017inductive; gilmer2017neural; morris2019weisfeiler; velivckovic2018graph; klicpera2019predict; chien2021adaptive), they suffer from the aforementioned node ambiguity issue. Some GNNs cannot be explained as node-feature refinement as they directly track node-set representations (maron2018invariant; morris2019weisfeiler; chen2019equivalence; maron2019provably). However, their complexity is high, as they need to compute the representation of each node set of certain size. Moreover, they were only studied for graph-level tasks. EGNN (satorras2021n) seems to be a relevant work as it studies when the nodes have physical coordinates given in prior. However, no analysis of PE has been provided.

A few works studied the stability of GNNs by using tools like graph scattering transform (for graph-level representation) (gama2019diffusion; gama2019stability) and graph signal filtering (for node-level representations) (levie2021transferability; ruiz2020graphon; ruiz2021graph; gama2020stability; nilsson2020experimental). They all focus on justifying the stability of the canonical GNN pipeline, graph convolution layers in particular. None of them consider positional features let alone the stability of GNNs using PE.

## 2 Notations and Preliminaries

In this section, we prepare the notations and preliminaries that are useful later. First, we define graphs.

###### Definition 2.1 (Graph).

Unless specified, we always consider undirected graphs of nodes and let . One such graph can be denoted as , where is the adjacency matrix. denotes the node features, where the th row, , is the feature vector of node . A graph may have self loops, i.e., has nonzero diagonals. Denote as the diagonal degree matrix where for . Let . Denote the normalized adjacency matrix as and the normalized Laplacian matrix as .

###### Definition 2.2 (Permutation).

An -dim permutation matrix is a matrix in where each row and each column has only one single 1. All such matrices are collected in , simplified as .

We denote the vector -norm as , the Frobenius norm as and the operator norm as .

###### Definition 2.3 (Graph-matching).

Given two graphs and their normalized Laplacian matrices for , their matching can be denoted by a permutation matrix that best aligns the graph structures and the node features.

 P∗(G(1),G(2))≜argminP∈Π∥L(1)−PL(2)PT∥F+∥X(1)−PX(2)∥F

Using instead of to represent graph structures is for notational simplicity. Actually for an unweighted graph, there is a bijective mapping between and . One can rewrite the first term with . Later, we use by not specifying and if there is no confusion. The distance between the two graphs can be defined as .

Next, we review eigenvalue decomposition and summarize arguments on its uniqueness in Lemma 2.6.

###### Definition 2.4 (Eigenvalue Decomposition (EVD)).

For a positive semidefinite (PSD) matrix , it has eigenvalue decomposition where is a real diagonal matrix with the eigenvalues of , as its diagonal components.

is an orthogonal matrix where

is the th eigenvector, i.e. .

###### Definition 2.5 (Orthogonal Group in the Euclidean space).

includes all -by- orthogonal matrices. A subgroup of includes all diagonal matrices with as the diagonal components, .

###### Lemma 2.6.

EVD is not unique. If all the eigenvalues are distinct, i.e., , is unique up to the signs of its columns, i.e., replacing by also gives EVD. If there are multiple eigenvalues, say , then lie in an orbit induced by the orthogonal group , i.e., replacing by for any while keeping eigenvalues and other eigenvectors unchanged also gives EVD.

Next, we define Positional Encoding (PE), which associates each node with a vector in a metric space where the distance between two vectors can represent the distance between the nodes in the graph.

###### Definition 2.7 (Positional Encoding).

Given a graph , PE works on and gives where each row gives the positional feature of node .

The absolute values given by PE may not be useful while the distances between the positional features are more relevant. So, we define PE-matching that allows rotation to best match positional features, which further defines the distance between two collections of positional features.

###### Definition 2.8 (PE-matching).

Consider two groups of positional features . Their matching is given by . Later, is used if it causes no confusion. Define the distance between them as .

## 3 Equivariant and Stable Positional Encoding for GNN

In this section, we will study the equivariance and stability of a GNN layer using PE .

### 3.1 Our Goal: Building Permutation Equivariant and Stable GNN layers

A GNN layer is expected to be permutation equivariant and stable. These two properties, if satisfied, guarantee that the GNN layer is transferable and has better generalization performance. Permutation equivariance implies that model predictions should be irrelevant to how one indexes the nodes, which captures the fundamental inductive bias of many graph learning problems: A permutation equivariant layer can make the same prediction over a new testing graph as that over a training graph if the two graphs match each other perfectly, i.e. the distance between them is 0. Stability is actually an even stronger condition than permutation equivariance because it characterizes how much gap between the predictions of the two graphs is expected when they do not perfectly match each other.

Specifically, given a graph with node features , we consider a GNN layer updating the node features, denoted as . We define permutation equivariance and stability as follows.

###### Definition 3.1 (Permutation Equivariance).

A GNN layer is permutation equivariant, if for any and any graph , .

###### Definition 3.2 (Stability).

A GNN layer is claimed to be stable, if there exists a constant , for any two graphs and , letting denote their matching, satisfies . By setting and for some , the RHS becomes zero, so a stable makes the LHS zero too. So, stability is a stronger condition than permutation equivariance.

Our goal is to guarantee that the GNN layer that utilizes PE is permutation equivariant and stable. To distinguish from the GNN layer that does not use PE, we use to denote a GNN layer that uses PE, which takes the positional features as one input and may update both node features and , i.e., . Now, we may define PE-equivariance and PE-stability for the GNN layer .

###### Definition 3.3 (PE-stability & PE-equivariance).

Consider a GNN layer that uses PE. When it works on any two graphs , and gives , let be the matching between the two graphs. is PE-stable, if for some constant we have

 ∥^X(1)−P∗^X(2)∥F+η(^Z(1),P∗^Z(2))≤Cd(G(1),G(2)). (1)

Recall measures the distance between two sets of positional features as defined in Def. 2.8. Similar as above, a weaker condition of PE-stability is PE-equivariance: If and for some , we expect a perfect match between the updated node features and positional features, and .

Note that previous works also consider that updates only node features, i.e., . In this case, PE-stability can be measured by removing the second term on from Eq.1.

### 3.2 PE-stable GNN layers based on Laplacian Eigenmap as Positional Encoding

To study the requirement of the GNN layer that achieves PE-stability, let us start from a particular PE technique, i.e., Laplacian eigenmap (LE) (belkin2003laplacian) to show the key insight behind. Later, we generalize the concept to some other PE. Let denote LE, which includes the eigenvectors that correspond to the smallest eigenvalues of the normalized Laplacian matrix .

Previous works failed to design PE-equivariant or PE-stable GNN layers. srinivasan2020equivalence claims that if a GNN layer that does not rely on PE is permutation equivariant, PE-equivariance may be kept by adding to node features, i.e., , where MLP

is a multilayer perceptron that adjusts the dimension properly. This statement is problematic when

is not unique given the graph structure . Specifically, though sharing graph structure , if different implementations lead to different LEs , then , which violates PE-equivariance. srinivasan2020equivalence suggests using graph permutation augmentation to address the issue, which makes assumptions on an invariant distribution of and empirically does not work well.

dwivedi2020generalization; kreuzer2021rethinking claim the uniqueness of up to the signs and suggest building a GNN layer that uses random as where is uniformly at random sampled from . They expect PE-equivariance in the sense of expectation. However, this statement is generally wrong because it depends on the condition that all eigenvalues have to be distinct as stated in Lemma 2.6. Actually, for multiple eigenvalues, there are infinitely many eigenvectors that lie in the orbit induced by the orthogonal group. Although many real graphs have multiple eigenvalues such as disconnected graphs or graphs with some non-trivial automophism, one may argue that the methods work when the eigenvalues are all distinct. However, the above failure may further yield PE-instability even when the eigenvalues are distinct but have small gaps due to the following lemma.

###### Lemma 3.4.

For any PSD matrix without multiple eigenvalues, set positional encoding as the eigenvectors given by the smallest eigenvalues sorted as of . For any sufficiently small , there exists a perturbation , such that

 minS∈SN(p)∥PE(B)−PE(B+△B)S∥F≥0.99max1≤i≤p|λi+1−λi|−1∥△B∥F+o(ϵ). (2)

Lemma 3.4 implies that small perturbation of graph structures may yield a big change of eigenvectors if there is a small eigengap. Consider two graphs and , where and is with a small perturbation . The perturbation is small enough so that the matching . However, the change of PE even after removing the effect of changing signs could be dominated by the largest inverse eigengap among the first eigenvalues . In practice, it is hard to guarantee all these eigenpairs have large gaps, especially when a large is used to locate each node more accurately. Plugging this PE into a GNN layer gives the updated node features a large change and thus violates PE-stability.

PE-stable GNN layers.

Although a particular eigenvector may be not stable, the eigenspace, i.e., the space spanned by the columns of

could be much more stable. This motivates our following design of the PE-stable GNN layers. Formally, we use the following lemma that can characterize the distance between the eigenspaces spanned by LEs of two graph Laplacians. The error is controlled by the inverse eigengap between the th and th eigenvalues , which by properly setting is typically much smaller than in Lemma 3.4. We compute the ratio between these two values over some real-world graphs as shown in Fig. 2.

###### Lemma 3.5.

For two PSD matrices , set as the eigenvectors given by the smallest eigenvalues of . Suppose has eigenvalues and . Then, for any permutation matrix ,

 η(PE(B(1)),PPE(B(2)))≤232δmin{√p∥B(1)−PB(2)PT∥op,∥B(1)−PB(2)PT∥F} (3)

Inspired by the stability of the eigenspace, the idea to achieve PE-stability is to make the GNN layer invariant to the selection of bases of the eigenspace for the positional features. So, our proposed PE-stable GNN layer that uses PE should satisfy two necessary conditions: 1) Permutation equivariance w.r.t. all features; 2) Rotation equivariance w.r.t. positional features, i.e.,

 PE-stable layer cond. 1: (P^X,P^Z) =g(PAPT,PX,PZ),∀P∈Π(N), (4) PE-stable layer cond. 2: (^X,^ZQ) =g(A,X,ZQ),∀Q∈SO(p). (5)

Rotation equivariance reflects the eigenspace instead of a particular selection of eigenvectors and thus achieves much better stability. Interestingly, these requirements can be satisfied by EGNN recently proposed (satorras2021n) as one can view the physical coordinates of objects considered by EGNN as the positional features. EGNN gets briefly reviewed in Appendix F. Thm. 3.6 proves PE-equivariance under the conditions Eqs. 4 and 5.

###### Theorem 3.6.

A GNN layer that uses and satisfies Eqs. 4,5 is PE-equivariant if the th and th eigenvalues of the normalized Laplacian matrix are different, i.e., .

Note that satisfying Eqs. 4,5 is insufficient to guarantee PE-stability that depends on the form of .

We implement in our model PEGN with further simplification which has already achieved good empirical performance: Use a GCN layer with edge weights according to the distance between the end nodes of the edge and keep the positional features unchanged. This gives the PEG layer,

 PEG:gPEG(A,X,Z)=(ψ[(^A⊙Ξ)XW],Z),where Ξuv=ϕ(∥Zu−Zv∥), ∀u,v∈[N]. (6)

Here

is an element-wise activation function,

is an MLP mapping from and is the Hadamard product. Note that if is sparse, only for an edge needs to be computed.

We may also prove that the PEG layer satisfies the even stronger condition PE-stability.

###### Theorem 3.7.

Consider two graphs , . Denote their normalized Laplacian matrices’ th eigenvalue as and th eigenvalue as . Assume that . Also, assume that and in the PEG layer in Eq. 6 are , -Lipschitz continuous respectively. Then, the PEG layer that uses satisfies PE-stability with the constant in Eq. 1 as .

Note that to achieve PE-stability, we need to normalize the node initial features to keep bounded, and control and . In practice is typically satisfied, e.g. setting

as ReLU. Here, the most important term is

. PE-stability may only be achieved when there is an eigengap between and and the larger eigengap, the more stable. This observation may be also instructive to select the in practice. As previous works may encounter a smaller eigengap (Lemma 3.4), their models will be generally more unstable.

Also, the simplified form of is not necessary to achieve PE-stability. However, as it has already given consistently better empirical performance than baselines, we choose to keep using .

### 3.3 Generalized to Other PE techniques: DeepWalk and LINE

It is well known that LE, as to compute the smallest eigenvalues, can be written as a low-rank matrix optimization form , s.t. . Other PE techniques, such as Deepwalk (perozzi2014deepwalk), Node2vec (grover2016node2vec) and LINE (tang2015line) can be unified into a similar optimization form, where the positional features are given by matrix factorization ( may be asymmetric so may not be ) and satisfies

 M∗=argminM∈RN×NℓPE(A,M)≜tr(f+(A)g(M)+f−(D)g(−M)),s.t% .rank(M)≤p (7)

Here typically revises by combining degree normalization and a power series of , corresponds to edge negative sampling that may be related to node degrees, and

is a component-wise log-sigmoid function

. E.g., in LINE, , , for some positive constant , where is the all-one vector. More discussion on Eq.7 and the forms of and for other PE techniques are given in Appendix G.

According to the above optimization formulation of PE, all the PE techniques generate positional features based on matrix factorization, thus are not unique. always lies in the orbit induced by , i.e., if solves Eq.7, for solves it too. A GNN layer still needs to satisfy Eqs. 4,5 to guarantee PE-equivariance. PE-stability actually asks even more.

###### Theorem 3.8.

Consider a general PE technique that has an optimization objective as Eq.7, computes its optimal solution and decomposes , s.t. to get positional features . Essentially, consists of the right-singular vectors of . If Eq.7 has a unique solution , and therein satisfy and , then a GNN layer that satisfies Eqs. 4,5 is PE-equivariant.

Note that the conditions on and are generally satisfied by Deepwalk, Node2vec and LINE. However, solving Eq.7 to get the optimal solution may not be guaranteed in practice because the low-rank constraint is non-convex. One may consider relaxing the low-rank constraint into the nuclear norm for some threshold  (recht2010guaranteed), which reduces the optimization Eq.7 into a convex optimization and thus satisfies the conditions in Thm. 3.8

. Empirically, this step and the step of computing SVD seem unnecessary according to our experiments. The PE-stability is related to the value of the smallest non-zero singular value of

. We leave the full characterization of PE-equivariance and PE-stability for the general PE techniques for the future study.

## 4 Experiments

### 4.1 The Experimental Pipeline of PEG for Link Prediction

We use PEG to build GNNs. The pipeline contains three steps. First, we adopt certain PE techniques to compute positional features . Second, we stack PEG layers according to Eq. 6. Suppose the final node representations are denoted by . Third, for link prediction over , we concatenate denoted as and adopt MLP to make final predictions. In the experiments, we test LE and Deepwalk as PE, and name the models PEG-LE and PEG-DW respectively. To verify the wide applicability of our theory, we also apply PEG to GraphSAGE hamilton2017inductive by similarly using the distance between PEs to control the neighbor aggregation according to Eq. 6 and term the corresponding models PE-SAGE-LE and PE-SAGE-DW respectively.

For some graphs, especially those small ones where the union of link sets for training, validation and testing cover the entire graph, the model may overfit positional features and hold a large generalization gap. This is because the links used as labels to supervise the model training are also used to generate positional features. To avoid this issue, we consider a more elegant way to use the training links. We adopt a 10-fold partition of the training set. For each epoch, we periodically pick one fold of the links to supervise the model while using the rest links to compute positional features. Note that PEs for different folds can be pre-computed by removing every fold of links, which reduces computational overhead. In practice, the testing stage often corresponds to online service and has stricter time constraints. Such partition is not needed so there is no computational overhead for testing. We term the models trained in this way as PEG-LE+ and PEG-DW+ respectively.

Datasets.

We use eight real graphs, including Cora, CiteSeer and Pubmed

(sen2008collective), Twitch (RU), Twitch (PT) and Chameleon (rozemberczki2021multi), DDI and COLLAB (hu2021ogb). Over the first 6 graphs, we utilize 85%, 5%, 10% to partition the link set that gives positive examples for training, validation and testing and pair them with the same numbers of negative examples (missing edges). For the two OGB graphs, we adopt the dataset splits in (hu2020open). The links for validation and test are removed during the training stage and the links for validation are also not used in the test stage. All the models are trained till the loss converges and the models with the best validation performance is used to test.

Baselines. We choose 6 baselines: VGAE (kipf2016variational), P-GNN (you2019position), SEAL (zhang2018link), GNN Trans. (dwivedi2020generalization), LE (belkin2003laplacian) and Deepwalk (DW) (perozzi2014deepwalk). VGAE is a variational version of GAE (kipf2016variational) that utilizes GCN to encode both the structural information and node feature information, and then decode the node embeddings to reconstruct the graph adjacency matrix. SEAL is particularly designed for link prediction by using enclosing subgraph representations of target node-pairs. P-GNN randomly chooses some anchor nodes and aggregates only from these anchor nodes. GNN Trans. adopts LE as PE and merges LE into node features and utilizes attention mechanism to aggregate information from neighbor nodes. For VGAE, P-GNN and GNN Trans., the inner product of two node embeddings is adopted to represent links. LE and DW are two network embedding methods, where the obtained node embeddings are already positional features and directly used to predict links.

Implementation details. For VGAE, we consider six types of features: (1) node feature (N.): original feature of each node. (2) constant feature (C.): node degree. (3) positional feature (P.): PE extracted by Deepwalk. (4) one-hot feature (O.): one-hot encoding of node indices. (5) random feature (R.): random value (6) node feature and positional feature (N. + P.): concatenating the node feature and the positional feature. P-GNN uses node features and the distances from a node to some randomly selected anchor nodes as positional features (N. + P.). GNN Trans. utilizes node features and LE as positional features (N. + P.). SEAL adopt Double-Radius Node Labeling (DRNL) to compute deterministic distance features (N. + D.). For PEG, we consider node features plus positional features (N. + P.) or constant feature plus positional features (C. + P.).

Results are shown in Table 1 and Table 2. Over the small datasets in Table 1, VGAE with node features outperforms other features in Cora, Citeseer and Pubmed because the nodes features therein are mostly informative, while this is not true over the other three datasets. One-hot features and positional features almost achieve the same performance, which implies that that GNNs naively using PE makes positional features behave like one-hot features and may have instability issues. Constant features are not good because of the node ambiguity issues. Random features may introduce heavy noise that causes trouble in model convergence. Concatenating node features and positional features gives better performance than only using positional features but is sometimes worse than only using node features, which is again due to the instability issue by using positional features.

Although PGNN and GNN Trans. utilize positional features, they achieve subpar performance. SEAL outperforms all of the state-of-art methods, which again demonstrates that the effectiveness of distance features (li2020distance; zhang2020revisiting). PEG significantly outperforms all the baselines except SEAL. PEG+ by better using training sets achieves comparable or even better performance than SEAL, which demonstrates the contributions of the stable usage of PE. Moreover, PEG can achieve comparable performance in most cases even only paired with constant features, which benefits from the more expressive power given by PE (avoids node ambiguity). Note that PE without GNNs (LE or DW solo) does not perform well, which justifies the benefit by joining GNN with PE.

Regarding the OGB datasets, PGNN and GNN Trans. do not perform well either. Besides, PGNN cannot scale to large graphs such as collab. The results of DW and LE demonstrate that the original positional features may only provide crude information, so pairing them with GNNs is helpful. PEG achieves the best results on ddi, and performs competitively with SEAL on collab. The complexity of PEG is comparable to canonical GNNs. Note that we do not count the time of PE as it relates to the particular implementation. If PEG is used for online serving when the time complexity is more important, PE can be computed in prior. For a fair comparison, we also do not count the pre-processing time of SEAL, PGNN or GNN Trans.. Most importantly, PEG performs significantly faster than SEAL on test because SEAL needs to compute distance features for every link while PE in PEG is shared by links. Interestingly, DW seems better than LE as a PE technique for large networks.

Datasets & Baselines. Task 2 better evaluates the generalization capability of models. We consider 3 groups, including citation networks (coraciteseer and corapubmed) (sen2008collective), user-interaction networks (Twitch (EN)Twitch (RU) and Twitch (ES)Twitch (PT)) (rozemberczki2021multi) and biological networks (PPI) (hamilton2017inductive). For citation networks and user-interaction networks, we utilize 95%, 5% dataset splitting for training and validation over the training graph, and we use 10% existing links as test positive links in the test graph. For PPI dataset, we randomly select 3 graphs as training, validation and testing datasets and we sample 10% existing links in the validation/testing graphs as validation/test positive links.

Baselines & Implementation details. We use the same baselines as Task 1, while we do not use one-hot features for VGAE, since the training and test graphs have different sizes. As for node features, we randomly project them into the same dimension and then perform row normalization on them. Other settings are the same as Task 1. PE is applied to training and testing graphs separately while PE over testing graphs is computed after removing the testing links.

Results are shown in Table 3. Compared with Table 1, for VGAE, we notice that node features perform much worse (except PPI) than Task 1, which demonstrates the risks of using node features when the domain shifts. Positional features, which is not specified for the same graph, is possibly more generalizable over different graphs. Random features are generalizable while still hard to converge. PGNN and GNN Trans. do not utilize positional features appropriately and perform far from ideal. Both SEAL and PEG outperform other baselines significantly, which implies their good stability and generalization. PEG and SEAL again achieve comparable performance while PEG has much lower training and testing complexity. Our results successfully demonstrate the significance of using permutation equivariant and stable PE.

## 5 Conclusion

In this work, we studied how GNNs should work with PE in principle, and proposed the conditions that keep GNNs permutation equivariant and stable when PE is used to avoid the node ambiguity issue. We follow those conditions and propose the PEG layer. Extensive experiments on link prediction demonstrate the effectiveness of PEG. In the future, we plan to generalize the theory to more general PE techniques and test PEG over other graph learning tasks.

#### Acknowledgments

We greatly thank the actionable suggestions given by reviewers. H. Yin and P. L. are supported by the 2021 JPMorgan Faculty Award and the National Science Foundation (NSF) award HDR-2117997.

## Appendix A Proof of Lemma 3.4

Recall the eigenvalues of the PSD matrix are . Suppose one EVD of . In , is the eigenvector of so . Without loss of generality, we set .

Suppose . Now, we perturb by slightly perturbing and . We set

 u′k =√1−ϵ2uk+ϵuk+1 u′k+1 =−ϵuk+√1−ϵ2uk+1

Set for . Note that and . Then, the columns of still give a group of orthogonal bases.

Now we denote the above perturbation of as . Then, could be for any . Therefore, for sufficiently small ,

 minS′∈SN(p)∥PE(B+△B)S′−PE(B)∥2F = ∥[(√1−ϵ2−1)uk+ϵuk+1,(√1−ϵ2−1)uk+1−ϵuk]∥2F = ∥(√1−ϵ2−1)uk+ϵuk+1∥2+∥(√1−ϵ2−1)uk+1−ϵuk∥2 = 4(1−√1−ϵ2) = 2ϵ2+o(ϵ2). (8)

Next, we characterize .

 ∥△B∥2F=∥B+△B−B∥2F=∥N∑i=1λiu′iu′Ti−N∑i=1λiuiuTi∥2F = ∥λk(u′ku′Tk−ukuTk)+λk+1(u′k+1u′Tk+1−uk+1uTk+1)∥2F = ∥(λk+1−λk)[−ϵ2(ukuTk−uk+1uTk+1)+ϵ√1−ϵ2(ukuTk+1+uk+1uTk)]∥2F = (λk+1−λk)2(ϵ2∥ukuTk+1+uk+1uTk∥2F+o(ϵ2)) = 2(λk+1−λk)2(ϵ2+o(ϵ2)). (9)

Combining Eqs. 8,9, we have, for sufficiently small ,

 minS′∈SN(p)∥PE(B+△B)S′−PE(B)∥F>0.99|λk+1−λk|−1∥△B∥F+o(ϵ),

which concludes the proof.

## Appendix B Proof of Lemma 3.5

The result of the Lemma 3.5 can be derived from the Davis-Kahan theorem (davis1970rotation) and its variant (yu2015useful) that characterizes the eigenspace perturbation. We apply the Theorem 2 Eq.3 of (yu2015useful) to two PSD matrices.

###### Theorem B.1 (Theorem 2 (yu2015useful)).

Let two PSD matrices , with eigenvalues such that . For , let have orthonormal columns satisfying for . Then, there exists an orthogonal matrix such that

 ∥U(2)Q−U(1)∥F≤23/2min(p1/2∥B(1)−B(2)∥op,∥B(1)−B(2)∥F)λ(1)p+1−λ(1)p

By symmetry, use the above theorem again and we know there exists

 ∥U(1)Q′−U(2)∥F≤23/2min(p1/2∥B(1)−B(2)∥op,∥B(1)−B(2)∥F)λ(2)p+1−λ(2)p

Because , then there exists ,

 ∥U(2)Q−U(1)∥F≤23/2δmin(p1/2∥B(1)−B(2)∥op,∥B(1)−B(2)∥F) (10)

where .

When we apply a permutation matrix to permute the rows and columns of , then for any . Moreover, permuting the rows and columns of a PSD matrix will not change its eigenvalues. This means that can be replaced by in Eq.10 as long as is replaced by . Therefore,

 ∥PU(2)Q−U(1)∥F≤23/2δmin(p1/2∥B(1)−PB(2)PT∥op,∥B(1)−PB(2)PT∥F)

## Appendix C Proof of Theorem 3.6

To prove PE-equivariance, consider two graphs and that have perfect matching . So, , .

Let denote the Laplacian eigenmaps of , . Set , and and use Lemma 3.5. Because and , then there exists .

 Z(1)=P∗Z(2)Q (11)

Now, we consider a GNN layer that satisfies Eqs. 4,5. Also denote the output as and .

 (^X(1),^Z(1)) =g(A(1),X(1),Z(1)) (a)=g(P∗A(2)P∗T,P∗TX(2),P∗Z(2)Q) (b)=P∗g(A(2),X(2),Z(2)Q) (c)=(P∗^X(2),P∗^Z(2)Q)

Here (a) is because the perfect matching between