Predict then Propagate: Graph Neural Networks meet Personalized PageRank

Johannes Gasteiger, Aleksandar Bojchevski, Stephan Günnemann

Introduction

Graphs are ubiquitous in the real world and its description through scientific models. They are used to study the spread of information, to optimize delivery, to recommend new books, to suggest friends, or to find a party’s potential voters. Deep learning approaches have achieved great success on many important graph problems such as link prediction (Grover & Leskovec, 2016; Bojchevski et al., 2018), graph classification (Duvenaud et al., 2015; Niepert et al., 2016; Gilmer et al., 2017) and semi-supervised node classification (Yang et al., 2016; Kipf & Welling, 2017).

There are many approaches for leveraging deep learning algorithms on graphs. Node embedding methods use random walks or matrix factorization to directly train individual node embeddings, often without using node features and usually in an unsupervised manner, i.e. without leveraging node classes (Perozzi et al., 2014; Tang et al., 2015; Nandanwar & Murty, 2016; Grover & Leskovec, 2016; Qiu et al., 2018). Many other approaches use both graph structure and node features in a supervised setting. Examples for these include spectral graph convolutional neural networks (Bruna et al., 2014; Defferrard et al., 2016), message passing (or neighbor aggregation) algorithms (Kearnes et al., 2016; Kipf & Welling, 2017; Hamilton et al., 2017; Pham et al., 2017; Monti et al., 2017; Gilmer et al., 2017), and neighbor aggregation via recurrent neural networks (Scarselli et al., 2009; Li et al., 2016; Dai et al., 2018). Among these categories, the class of message passing algorithms has garnered particular attention recently due to its flexibility and good performance.

Several works have been aimed at improving the basic neighborhood aggregation scheme by using attention mechanisms (Kearnes et al., 2016; Hamilton et al., 2017; Veličković et al., 2018), random walks (Abu-El-Haija et al., 2018a; Ying et al., 2018; Li et al., 2018), edge features (Kearnes et al., 2016; Gilmer et al., 2017; Schlichtkrull et al., 2018) and making it more scalable on large graphs (Chen et al., 2018; Ying et al., 2018). However, all of these methods only use the information of a very limited neighborhood for each node. A larger neighborhood would be desirable to provide the model with more information, especially for nodes in the periphery or in a sparsely labelled setting.

Increasing the size of the neighborhood used by these algorithms, i.e. their range, is not trivial since neighborhood aggregation in this scheme is essentially a type of Laplacian smoothing and too many layers lead to oversmoothing (Li et al., 2018). Xu et al. (2018) highlighted the same problem by establishing a relationship between the message passing algorithm termed Graph Convolutional Network (GCN) by Kipf & Welling (2017) and a random walk. Using this relationship we see that GCN converges to this random walk’s limit distribution as the number of layers increases. The limit distribution is a property of the graph as a whole and does not take the random walk’s starting (root) node into account. As such it is unsuited to describe the root node’s neighborhood. Hence, GCN’s performance necessarily deteriorates for a high number of layers (or aggregation/propagation steps).

To solve this issue, in this paper, we first highlight the inherent connection between the limit distribution and PageRank (Page et al., 1998). We then propose an algorithm that utilizes a propagation scheme derived from personalized PageRank instead. This algorithm adds a chance of teleporting back to the root node, which ensures that the PageRank score encodes the local neighborhood for every root node (Page et al., 1998). The teleport probability allows us to balance the needs of preserving locality (i.e. staying close to the root node to avoid oversmoothing) and leveraging the information from a large neighborhood. We show that this propagation scheme permits the use of far more (in fact, infinitely many) propagation steps without leading to oversmoothing.

Moreover, while propagation and classification are inherently intertwined in message passing, our proposed algorithm separates the neural network from the propagation scheme. This allows us to achieve a much higher range without changing the neural network, whereas in the message passing scheme every additional propagation step would require an additional layer. It also permits the independent development of the propagation algorithm and the neural network generating predictions from node features. That is, we can combine any state-of-the-art prediction method with our propagation scheme. We even found that adding our propagation scheme during inference significantly improves the accuracy of networks that were trained without using any graph information.

Our model achieves state-of-the-art results while requiring fewer parameters and less training time compared to most competing models, with a computational complexity that is linear in the number of edges. We show these results in the most thorough study (including significance testing) of message passing models using graphs with text-based features that has been done so far.

Graph convolutional networks and their limited range

One simple and widely used message passing algorithm for semi-supervised classification is the Graph Convolutional Network (GCN). In the case of two message passing layers its equation is

With two GCN-layers, only neighbors in the two-hop neighborhood are considered. There are essentially two reasons why a message passing algorithm like GCN cannot be trivially expanded to use a larger neighborhood. First, aggregation by averaging causes oversmoothing if too many layers are used. It, therefore, loses its focus on the local neighborhood (Li et al., 2018). Second, most common aggregation schemes use learnable weight matrices in each layer. Therefore, using a larger neighborhood necessarily increases the depth and number of learnable parameters of the neural network (the second aspect can be circumvented by using weight sharing, which is typically not the case, though). However, the required neighborhood size and neural network depth are two completely orthogonal aspects. This fixed relationship is a strong limitation and leads to bad compromises.

Personalized propagation of neural predictions

Personalized propagation of neural predictions (PPNP). To utilize the above influence scores for semi-supervised classification we generate predictions for each node based on its own features and then propagate them via our fully personalized PageRank scheme to generate the final predictions. This is the foundation of personalized propagation of neural predictions. PPNP’s model equation is

As a consequence, PPNP separates the neural network used for generating predictions from the propagation scheme. This separation additionally solves the second issue mentioned above: the depth of the neural network is now fully independent of the propagation algorithm. As we saw when connecting GCN to PageRank, personalized PageRank can effectively use even infinitely many neighborhood aggregation layers, which is clearly not possible in the classical message passing framework. Furthermore, the separation gives us the flexibility to use any method for generating predictions, e.g. deep convolutional neural networks for graphs of images.

While generating predictions and propagating them happen consecutively during inference, it is important to note that the model is trained end-to-end. That is, the gradient flows through the propagation scheme during backpropagation (implicitly considering infinitely many neighborhood aggregation layers). Adding these propagation effects significantly improves the model’s accuracy.

Approximate personalized propagation of neural predictions (APPNP). More precisely, APPNP achieves linear computational complexity by approximating topic-sensitive PageRank via power iteration. While PageRank’s power iteration is connected to the regular random walk, the power iteration of topic-sensitive PageRank is related to a random walk with restarts. Each power iteration (random walk/propagation) step of our topic-sensitive PageRank variant is, thus, calculated via

Note that the propagation scheme of this model does not require any additional parameters to train – as opposed to models like GCN, which typically require more parameters for each additional propagation layer. We can therefore propagate very far with very few parameters. Our experiments show that this ability is indeed very beneficial (see Section 6). A similar model expressed in the message passing framework would therefore not be able to achieve the same level of performance.

The reformulation of PPNP via fixed-point iterations illustrates a connection to the original graph neural network (GNN) model (Scarselli et al., 2009). While the latter uses a learned fixed-point iteration, our approach uses a predetermined iteration (adapted personalized PageRank) and applies a learned feature transformation before propagation.

In both PPNP and APPNP, the size of the neighborhood influencing each node can be adjusted via the teleport probability α\alpha. The freedom to choose α\alpha allows us to adjust the model for different types of networks, since varying graph types require the consideration of different neighborhood sizes, as shown in Section 6 and described by Grover & Leskovec (2016) and Abu-El-Haija et al. (2018b).

Related work

Several works have tried to improve the training of message passing algorithms and increase the neighborhood available at each node by adding skip connections (Li et al., 2016; Pham et al., 2017; Hamilton et al., 2017; Ying et al., 2018). One recent approach combined skip connection with aggregation schemes (Xu et al., 2018). However, the range of these models is still limited, as apparent in the low number of message passing layers used. While it is possible to add skip connections in the neural network used by our algorithm, this would not influence the propagation scheme. Our approach to solving the range problem is therefore unrelated to these models.

Li et al. (2018) facilitated training by combining message passing with co- and self-training. The improvements achieved by this combination are similar to results reported with other semi-supervised classification models (Buchnik & Cohen, 2018). Note that most algorithms, including ours, can be improved using self- and co-training. However, each additional step used by these methods corresponds to a full training cycle and therefore significantly increases the training time.

Deep GNNs that avoid the oversmoothing issue have been proposed in recent works by combining residual (skip) connections with batch normalization (Kawamoto et al., 2018; Chen et al., 2019). However, our model solves this issue by simplifying the architecture via decoupling prediction and propagation and does not rely on ad-hoc techniques that further complicate the model and introduce additional hyperparameters. Furthermore, since PPNP increases the range without introducing additional layers and parameters it is easier and faster to train compared to a deep GNN.

Experimental setup

Recently, many experimental evaluations have suffered from superficial statistical evaluation and experimental bias from using varying training setups and overfitting. The latter is caused by experiments using a single training/validation/test split, by not distinguishing clearly between the validation and test set, and by finetuning hyperparameters to each dataset or even data split separately. Message-passing algorithms are very sensitive to both data splits and weight initialization (as clearly shown by our evaluation). Thus, a carefully designed evaluation protocol is extremely important. Our work aims to establish such a thorough evaluation protocol. First, we run each experiment 100 times on multiple random splits and initializations. Second, we split the data into a visible and a test set, which do not change. The test set was only used once to report the final performance; and in particular, has never been used to perform hyperparameter and model selection. To further prevent overfitting we use the same number of layers and hidden units, dropout rate dd, L2L_{2} regularization parameter λ\lambda, and learning rate ll across datasets, since all datasets use bag-of-words as features. To prevent experimental bias we optimized the hyperparameters of all models individually using a grid search on Citeseer and Cora-ML and use the same early stopping criterion across models.

Finally, to ensure the statistical robustness of our experimental setup, we calculate confidence intervals via bootstrapping and report the p-values of a paired tt-test for our main claims. To our knowledge, this is the most rigorous study on GCN-like models which has been done so far. More details about the experimental setup are provided in Appendix C.

Datasets. We use four text-classification datasets for evaluation. Citeseer (Sen et al., 2008), Cora-ML (McCallum et al., 2000; Bojchevski & Günnemann, 2018) and PubMed (Namata et al., 2012) are citation graphs, where each node represents a paper and the edges represent citations between them. In the Microsoft Academic graph (Shchur et al., 2018) edges represent co-authorship. We use the largest connected component of each graph. All graphs use a bag-of-words representation of the papers’ abstracts as features. While large graphs do not necessarily have a larger diameter (Leskovec et al., 2005), note that these graphs indeed have average shortest path lengths between 5 and 10 and therefore a regular two-layer GCN cannot cover the entire graph. Table 1 reports the dataset statistics.

Baseline models. We compare to five state-of-the-art models: GCN (Kipf & Welling, 2017), network of GCNs (N-GCN) (Abu-El-Haija et al., 2018a), graph attention networks (GAT) (Veličković et al., 2018), bootstrapped feature propagation (bt. FP) (Buchnik & Cohen, 2018) and jumping knowledge networks with concatenation (JK) (Xu et al., 2018). For GCN we also show the results of the (unoptimized) vanilla version (V. GCN) to demonstrate the strong impact of early stopping and hyperparameter optimization. The hyperparameters of all models are listed in Appendix D.

Model hyperparameters. To ensure a fair model comparison we used a neural network for PPNP that is structurally very similar to GCN and has the same number of parameters. We use two layers with h=64h=64 hidden units. We apply L2L_{2} regularization with λ=0.005\lambda=0.005 on the weights of the first layer and use dropout with dropout rate d=0.5d=0.5 on both layers and the adjacency matrix. For APPNP, adjacency dropout is resampled for each power iteration step. For propagation we use the teleport probability α=0.1\alpha=0.1 and K=10K=10 power iteration steps for APPNP. We use α=0.2\alpha=0.2 on the Microsoft Academic graph due to its structural difference (see Figure 5 and its discussion). The combination of this shallow neural network with a comparatively high number of power iteration steps achieved the best results during hyperparameter optimization (see Appendix G).

Results

Overall accuracy. The results for the accuracy (micro F1-score) are summarized in Table 2. Similar trends are observed for the macro F1-score (see Appendix E). Both models significantly outperform the state-of-the-art baseline models on all datasets. Our rigorous setup might understate the improvements achieved by PPNP and APPNP – this result is statistically significant p<0.05p<0.05, as tested via a paired tt-test (see Appendix F). This thorough setup furthermore shows that the advantages reported by recent works practically vanish when training is harmonized, hyperparameters are properly optimized and multiple data splits are considered. A simple GCN with optimized hyperparameters outperforms several recently proposed models on our setup.

Figure 2 shows how broad the accuracy distribution of each model is. This is caused by both random initialization and different data splits (train / early stopping / test). This demonstrates how crucial a statistically rigorous evaluation is for a conclusive model comparison. Moreover, it shows the sensitivity (robustness) of each method, e.g. PPNP, APPNP and GAT typically have lower variance.

Training set size. Since the labeling rate is often very small for real world datasets, investigating how the models perform with a small number of training samples is very important. Figure 3 shows how the number of training nodes per class ntrain, per classn_{\text{train, per class}} impacts the accuracy on Cora-ML (for other datasets see Appendix H). The dominance of PPNP and APPNP increases further in this sparsely labelled setting. This can be attributed to their higher range, which allows them to better propagate the information further away from the (few) training nodes. We see further evidence for this when comparing the accuracy of APPNP and GCN depending on the distance between a node and the training set (in terms of shortest path). Appendix I shows that the performance gap between APPNP and GCN tends to increase for nodes that are far away from the training nodes. That is, nodes further away from the training set benefit more from the increase in range.

Number of power iteration steps. Figure 4 shows how the accuracy depends on the number of power iterations for two different propagation schemes. The first mimics the standard propagation as known from GCNs (i.e. α=0\alpha=0 in APPNP). As clearly shown the performance breaks down as we increase the number of power iterations KK (since we approach the global PageRank solution). However, when using personalized propagation (with α=0.1\alpha=0.1) the accuracy increases and converges to exact PPNP with infinitely many propagation steps, thus demonstrating the personalized propagation principle is indeed beneficial. As also shown in the figure, it is enough to use a moderate number of power iterations (e.g. K=10K=10) to effectively approximate exact PPNP. Interestingly, we’ve found that this number coincides with the highest shortest path distance of any node to the training set.

Teleport probability α\alpha. Figure 5 shows the effect of the hyperparameter α\alpha on the accuracy on the validation set. While the optimum differs slightly for every dataset, we consistently found a teleport probability of around α∈[0.05,0.2]\alpha\in[0.05,0.2] to perform best. This probability should be adjusted for the dataset under investigation, since different graphs exhibit different neighborhood structures (Grover & Leskovec, 2016; Abu-El-Haija et al., 2018b). Note that a higher α\alpha improves convergence speed.

Neural network without propagation. PPNP and APPNP are trained end-to-end, with the propagation scheme affecting (i) the neural network fθf_{\theta} during training, and (ii) the classification decision during inference. Investigating how the model performs without propagation shows if and how valuable this addition is. Figure 6 shows how propagation affects both training and inference. ”Never” denotes the case where no propagation is used; essentially we train and apply a standard multilayer perceptron (MLP) fθf_{\theta} using the features only. ”Training” denotes the case where we use APPNP during training to learn fθf_{\theta}; at inference time, however, only fθf_{\theta} is used to predict the class labels. ”Inference”, in contrast, denotes the case where fθf_{\theta} is trained without APPNP (i.e. standard MLP on features). This pretrained network with fixed weights is then used with APPNP’s propagation for inference. Finally, ”Inf. & Training” denotes the regular APPNP, which always uses propagation.

The best results are achieved with regular APPNP, which validates our approach. However, on most datasets the accuracy decreases surprisingly little when propagating only during inference. Skipping propagation during training can significantly reduce training time for large graphs as all nodes can be handled independently. This also shows that our model can be combined with pretrained neural networks that do not incorporate any graph information and still significantly improve their accuracy. Moreover, Figure 6 shows that just propagating during training can also lead to large improvements. This indicates that our model can also be applied to online/inductive learning where only the features and not the neighborhood information of an incoming (previously unobserved) node are available.

Conclusion

In this paper we have introduced personalized propagation of neural predictions (PPNP) and its fast approximation, APPNP. We derived this model by considering the relationship between GCN and PageRank and extending it to personalized PageRank. This simple model decouples prediction and propagation and solves the limited range problem inherent in many message passing models without introducing any additional parameters. It uses the information from a large, adjustable (via the teleport probability α\alpha) neighborhood for classifying each node. The model is computationally efficient and outperforms several state-of-the-art methods for semi-supervised classification on multiple graphs in the most thorough study which has been done for GCN-like models so far.

For future work it would be interesting to combine PPNP with more complex neural networks used e.g. in computer vision or natural language processing. Furthermore, faster or incremental approximations of personalized PageRank (Bahmani et al., 2010; 2011; Lofgren et al., 2014) and more sophisticated propagation schemes would also benefit the method.

Acknowledgements

This research was supported by the German Research Foundation, grant GU 1409/2-1.

References

Appendix B Convergence of APPNP

After the kk-th propagation step, the resulting predictions are

which is the equation for calculating (exact) PPNP.

Appendix C Experimental details

The sampling procedure is illustrated in Figure 7. The data is first split into a visible and a test set. For the visible set 1500 nodes were sampled for the citation graphs and 5000 for Microsoft Academic. The test set contains all remaining nodes. We use three different label sets in each experiment: A training set of 20 nodes per class, an early stopping set of 500 nodes and either a validation or test set. The validation set contains the remaining nodes of the visible set. We use 20 random seeds for determining the splits. These seeds are drawn once and fixed across runs to facilitate comparisons. We use one set of seeds for the validation splits and a different set for the test splits. Each experiment is run with 5 random initializations on each data split, leading to a total of 100 runs per experiment.

The early stopping criterion uses a patience of p=100p=100 and an (unreachably high) maximum of n=n=10\,000$$ epochs. The patience is reset whenever the accuracy increases or the loss decreases on the early stopping set. We choose the parameter set achieving the highest accuracy and break ties by selecting the lowest loss on this set. This criterion was inspired by GAT (Veličković et al., 2018).

We use the Adam optimizer with a learning rate of l=0.01l=0.01 and cross-entropy loss for all models (Kingma & Ba, 2015). Weights are initialized as described in Glorot & Bengio (2010). The feature matrix is L1L_{1} normalized per row.

Appendix D Baseline hyperparameters

Vanilla GCN uses the original settings of two layers with h=16h=16 hidden units, no dropout on the adjacency matrix, L2L_{2} regularization parameter λ=\lambda=5\text{\times}{10}^{-4}$$ and the original early stopping with a maximum of 200 steps and a patience of 10 steps based on the loss.

The optimized GCN uses two layers with h=64h=64 hidden units, dropout on the adjacency matrix with d=0.5d=0.5 and L2L_{2} regularization parameter λ=0.02\lambda=0.02.

N-GCN uses h=16h=16 hidden units, R=4R=4 heads per random walk length and random walks of up to K−1=4K-1=4 steps. It uses L2L_{2} regularization on all layers with λ=\lambda=1\text{\times}{10}^{-5}$andtheattentionvariantformergingthepredictions(Abu−El−Haijaetal.,2018a).Notethatthismodeleffectivelyusesand the attention variant for merging the predictions (Abu-El-Haija et al., 2018a). Note that this model effectively usesRKh=320$ hidden units, which is 5 times as many units compared to GCN, GAT, and PPNP.

For GAT we use the (well optimized) original hyperparameters, except the L2L_{2} regularization parameter λ=0.001\lambda=0.001 and learning rate l=0.01l=0.01. As opposed to the original paper, we do not use different hyperparameters on PubMed, as described in our experimental setup.

Bootstrapped feature propagation uses a return probability of α=0.2\alpha=0.2, 10 propagation steps, 10 bootstrapping (self-training) steps with r=0.1nr=0.1n training nodes added per step. We add the training nodes with the lowest entropy on the predictions. The number of nodes added per class is based on the class proportions estimated using the predictions. Note that this model does not include any stochasticity in its initialization. We therefore only run it once per train/early stopping/test split.

For the jumping knowledge networks we use the concatenation variant with three layers and h=64h=64 hidden units per layer. We apply L2L_{2} regularization with λ=0.001\lambda=0.001 on all layers and perform dropout with d=0.5d=0.5 on all layers but not on the adjacency matrix.

Appendix E F1 score

Appendix F Paired t𝑡t-test

Appendix G Number of neural network layers

Appendix H Training set size

Appendix I Accuracy depending on distance from training nodes