Title: GraphSAINT: GRAPH SAMPLING BASED INDUCTIVE LEARNING METHOD

Abstract: Graph Convolutional Networks (GCNs) are powerful models for learning representations of attributed graphs. To scale GCNs to large graphs, state-of-the-art methods use various layer sampling techniques to alleviate the "neighbor explosion" problem during minibatch training. We propose GraphSAINT, a graph sampling based inductive learning method that improves training efficiency and accuracy in a fundamentally different way. By changing perspective, GraphSAINT constructs minibatches by sampling the training graph, rather than the nodes or edges across GCN layers. Each iteration, a complete GCN is built from the properly sampled subgraph. Thus, we ensure fixed number of well-connected nodes in all layers. We further propose normalization technique to eliminate bias, and sampling algorithms for variance reduction. Importantly, we can decouple the sampling from the forward and backward propagation, and extend GraphSAINT with many architecture variants (e.g., graph attention, jumping connection). GraphSAINT demonstrates superior performance in both accuracy and training time on five large graphs, and achieves new state-of-the-art F1 scores for PPI (0.995) and Reddit (0.970). * Equal contribution * The skip-connection design proposed by Huang et al. (2018) does not have such "subset" requirement, and thus is compatible with both graph sampling and layer sampling based methods.

1. INTRODUCTION:

Recently, representation learning on graphs has attracted much attention, since it greatly facilitates tasks such as classification and clustering (Wu et al., 2019; Cai et al., 2017) . Current works on Graph Convolutional Networks (GCNs) (Hamilton et al., 2017; Chen et al., 2018b; Gao et al., 2018; Huang et al., 2018; Chen et al., 2018a) mostly focus on shallow models (2 layers) on relatively small graphs. Scaling GCNs to larger datasets and deeper layers still requires fast alternate training methods.

In a GCN, data to be gathered for one output node comes from its neighbors in the previous layer. Each of these neighbors in turn, gathers its output from the previous layer, and so on. Clearly, the deeper we back track, the more multi-hop neighbors to support the computation of the root. The number of support nodes (and thus the training time) potentially grows exponentially with the GCN depth. To mitigate such "neighbor explosion", state-of-the-art methods use various layer sampling techniques. The works by Hamilton et al. (2017) ; Ying et al. (2018a) ; Chen et al. (2018a) ensure that only a small number of neighbors (typically from 2 to 50) are selected by one node in the next layer. Chen et al. (2018b) and Huang et al. (2018) further propose samplers to restrict the neighbor expansion factor to 1, by ensuring a fixed sample size in all layers. While these methods significantly speed up training, they face challenges in scalability, accuracy or computation complexity.

Present work We present GraphSAINT (Graph SAmpling based INductive learning meThod) to efficiently train deep GCNs. GraphSAINT is developed from a fundamentally different way of minibatch construction. Instead of building a GCN on the full training graph and then sampling across the layers, we sample the training graph first and then build a full GCN on the subgraph. Our method is thus graph sampling based. Naturally, GraphSAINT resolves "neighbor explosion", since every GCN of the minibatches is a small yet complete one. On the other hand, graph sampling based method also brings new challenges in training. Intuitively, nodes of higher influence on each other should have higher probability to form a subgraph. This enables the sampled nodes to "support" each other without going outside the minibatch. Unfortunately, such strategy results in non-identical node sampling probability, and introduces bias in the minibatch estimator. To address this issue, we develop normalization techniques so that the feature learning does not give preference to nodes more frequently sampled. To further improve training quality, we perform variance reduction analysis, and design light-weight sampling algorithms by quantifying "influence" of neighbors. Experiments on GraphSAINT using five large datasets show significant performance gain in both training accuracy and time. We also demonstrate the flexibility of GraphSAINT by integrating our minibatch method with popular GCN architectures such as JK-net (Xu et al., 2018) and GAT (Veličković et al., 2017) . The resulting deep models achieve new state-of-the-art F1 scores on PPI (0.995) and Reddit (0.970).

2. RELATED WORK:

A neural network model that extends convolution operation to the graph domain is first proposed by Bruna et al. (2013) . Further, Kipf & Welling (2016) ; Defferrard et al. (2016) speed up graph convolution computation with localized filters based on Chebyshev expansion. They target relatively small datasets and thus the training proceeds in full batch. In order to scale GCNs to large graphs, layer sampling techniques (Hamilton et al., 2017; Chen et al., 2018b; Ying et al., 2018a; Chen et al., 2018a; Gao et al., 2018; Huang et al., 2018) have been proposed for efficient minibatch training. All of them follow the three meta steps: 1. Construct a complete GCN on the full training graph. 2. Sample nodes or edges of each layer to form minibatches. 3. Propagate forward and backward among the sampled GCN. Steps (2) and (3) proceed iteratively to update the weights via stochastic gradient descent. The layer sampling algorithm of GraphSAGE (Hamilton et al., 2017) performs uniform node sampling on the previous layer neighbors. It enforces a pre-defined budget on the sample size, so as to bound the minibatch computation complexity. Ying et al. (2018a) enhances the layer sampler of Hamilton et al. (2017) by introducing an importance score to each neighbor. The algorithm presumably leads to less information loss due to weighted aggregation. S-GCN (Chen et al., 2018a) further restricts neighborhood size by requiring only two support nodes in the previous layer. The idea is to use the historical activations in the previous layer to avoid redundant re-evaluation. FastGCN (Chen et al., 2018b) performs sampling from another perspective. Instead of tracking down the inter-layer connections, node sampling is performed independently for each layer. It applies importance sampling to reduce variance, and results in constant sample size in all layers. However, the minibatches potentially become too sparse to achieve high accuracy. Huang et al. (2018) improves FastGCN by an additional sampling neural network. It ensures high accuracy, since sampling is conditioned on the selected nodes in the next layer. Significant overhead may be incurred due to the expensive sampling algorithm and the extra sampler parameters to be learned.

Instead of sampling layers, the works of Zeng et al. (2018) and Chiang et al. (2019) build minibatches from subgraphs. Zeng et al. (2018) proposes a specific graph sampling algorithm to ensure connectivity among minibatch nodes. They further present techniques to scale such training on shared-memory multi-core platforms. More recently, ClusterGCN (Chiang et al., 2019) proposes graph clustering based minibatch training. During pre-processing, the training graph is partitioned into densely connected clusters. During training, clusters are randomly selected to form minibatches, and intra-cluster edge connections remain unchanged. Similar to GraphSAINT, the works of Zeng et al. (2018) and Chiang et al. (2019) do not sample the layers and thus "neighbor explosion" is avoided. Unlike GraphSAINT, both works are heuristic based, and do not account for bias due to the unequal probability of each node / edge appearing in a minibatch.

Another line of research focuses on improving model capacity. Applying attention on graphs, the architectures of Veličković et al. (2017) ; Zhang et al. (2018) ; Lu et al. (2019) better capture neighbor features by dynamically adjusting edge weights. Klicpera et al. (2018) combines PageRank with GCNs to enable efficient information propagation from many hops away. To develop deeper models, "skip-connection" is borrowed from CNNs (He et al., 2015; Huang et al., 2017) into the GCN context. In particular, JK-net Xu et al. (2018) demonstrates significant accuracy improvement on GCNs with more than two layers. Note, however, that JK-net (Xu et al., 2018) follows the same sampling strategy as GraphSAGE (Hamilton et al., 2017) . Thus, its training cost is high due to neighbor explosion. In addition, high order graph convolutional layers (Zhou, 2017; Lee et al., 2018; Abu-El-Haija et al., 2019) also help propagate long-distance features. With the numerous architectural variants developed, the question of how to train them efficiently via minibatches still remains to be answered.

3. PROPOSED METHOD: GraphSAINT:

Graph sampling based method is motivated by the challenges in scalability (in terms of model depth and graph size). We analyze the bias (Section 3.2) and variance (Section 3.3) introduced by graph sampling, and thus, propose feasible sampling algorithms (Section 3.4). We show the applicability of GraphSAINT to other architectures, both conceptually (Section 4) and experimentally (Section 5.2).

In the following, we define the problem of interest and the corresponding notations. A GCN learns representation of an un-directed, attributed graph G (V, E), where each node v ∈ V has a length-f attribute x v . Let A be the adjacency matrix and A be the normalized one (i.e., A = D -1 A, and D is the diagonal degree matrix). Let the dimension of layer-input activation be f ( ) . The activation of node v is x

( ) v ∈ R f ( )

, and the weight matrix is

W ( ) ∈ R f ( ) ×f ( +1) . Note that x v = x (1)

v . Propagation rule of a layer is defined as follows:

EQUATION

where A v,u is a scalar, taking an element of A. And σ (•) is the activation function (e.g., ReLU).

We use subscript "s" to denote parameterd of the sampled graph (e.g., G s , V s , E s ).

GCNs can be applied under inductive and transductive settings. While GraphSAINT is applicable to both, in this paper, we focus on inductive learning. It has been shown that inductive learning is especially challenging (Hamilton et al., 2017) -during training, neither attributes nor connections of the test nodes are present. Thus, an inductive model has to generalize to completely unseen graphs. GraphSAINT follows the design philosophy of directly sampling the training graph G, rather than the corresponding GCN. Our goals are to 1. extract appropriately connected subgraphs so that little information is lost when propagating within the subgraphs, and 2. combine information of many subgraphs together so that the training process overall learns good representation of the full graph.

Figure 1 GCN construction on G s .

5:

{y v | v ∈ V s } ← Forward propagation of {x v | v ∈ V s }, normalized by α 6:

Backward propagation from λ-normalized loss L (y v , y v ). Update weights. 7: end for training proceeds by iterative weight updates via SGD. Each iteration starts with an independently sampled G s (where |V s | |V|). We then build a full GCN on G s to generate embedding and calculate loss for every v ∈ V s . In Algorithm 1, node representation is learned by performing node classification in the supervised setting, and each training node v comes with a ground truth label y v .

Intuitively, there are two requirements for SAMPLE: 1. Nodes having high influence on each other should be sampled in the same subgraph. 2. Each edge should have non-negligible probability to be sampled. For requirement (1), an ideal SAMPLE would consider the joint information from node connections as well as attributes. However, the resulting algorithm may have high complexity as it would need to infer the relationships between features. For simplicity, we define "influence" from the graph connectivity perspective and design topology based samplers. Requirement (2) leads to better generalization since it enables the neural net to explore the full feature and label space.

3.2. NORMALIZATION:

A sampler that preserves connectivity characteristic of G will almost inevitably introduce bias into minibatch estimation. In the following, we present normalization techniques to eliminate biases.

Analysis of the complete multi-layer GCN is difficult due to non-linear activations. Thus, we analyze the embedding of each layer independently. This is similar to the treatment of layers independently by prior work (Chen et al., 2018b; Huang et al., 2018) . Consider a layer-( + 1) node v and a layernode u. If v is sampled (i.e., v ∈ V s ), we can compute the aggregated feature of v as:

EQUATION

where

x( ) u = W ( ) T x ( )

u , and

1 u|v ∈ {0, 1} is the indicator function given v is in the subgraph (i.e., 1 u|v = 0 if v ∈ V s ∧ (u, v) ∈ E s ; 1 u|v = 1 if (u, v) ∈ E s ; 1 u|v not defined if v ∈ V s ).

We refer to the constant α u,v as aggregator normalization. Define p u,v = p v,u as the probability of an edge (u, v) ∈ E being sampled in a subgraph, and p v as the probability of a node v ∈ V being sampled.

Proposition 3.1. ζ ( +1) v is an unbiased estimator of the aggregation of v in the full ( + 1) th GCN layer, if α u,v = pu,v pv . i.e., E ζ ( +1) v = u∈V A v,u x( ) u .

Assuming that each layer independently learns an embedding, we use Proposition 3.1 to normalize feature propagation of each layer of the GCN built by GraphSAINT. Further, let L v be the loss on v in the output layer. The minibatch loss is calculated as L batch = v∈Gs L v /λ v , where λ v is a constant that we term loss normalization. We set λ v = |V| • p v so that:

EQUATION

Feature propagation within subgraphs thus requires normalization factors α and λ, which are computed based on the edge and node probability p u,v , p v . In the case of random node or random edge samplers, p u,v and p v can be derived analytically. For other samplers in general, closed form expression is hard to obtain. Thus, we perform pre-processing for estimation. Before training starts, we run the sampler repeatedly to obtain a set of N subgraphs G. We setup a counter C v and C u,v for each v ∈ V and (u, v) ∈ E, to count the number of times the node or edge appears in the subgraphs of G. Then we set α

u,v = Cu,v Cv = Cv,u

Cv and λ v = Cv N . The subgraphs G s ∈ G can all be reused as minibatches during training. Thus, the overhead of pre-processing is small (see Appendix D.2).

3.3. VARIANCE:

We derive samplers for variance reduction. Let e be the edge connecting u, v, and b ( )

e = A v,u x( -1) u + A u,v x( -1) v . It is desirable that variance of all estimators ζ ( )

v is small. With this objective, we define:

EQUATION

)

where

1 e = 1 if e ∈ E s ; 1 e = 0 if e ∈ E s . And 1 v = 1 if v ∈ V s ; 1 v = 0 if v ∈ V s .

The factor p u in the first equality is present so that ζ is an unbiased estimator of the sum of all node aggregations at all layers:

E (ζ) = v∈V E ζ ( ) v

. Note that 1 ( ) e = 1 e , ∀ , since once an edge is present in the sampled graph, it is present in all layers of our GCN.

We define the optimal edge sampler to minimize variance for every dimension of ζ. We restrict ourselves to independent edge sampling. For each e ∈ E, we make independent decision on whether it should be in G s or not. The probability of including e is p e . We further constrain p e = m, so that the expected number of sampled edges equals to m. The budget m is a given sampling parameter. Theorem 3.2. Under independent edge sampling with budget m, the optimal edge probabilities to minimize the sum of variance of each ζ's dimension is given by: p e = .

To prove Theorem 3.2, we make use of the independence among graph edges, and the dependence among layer edges to obtain the covariance of 1 ( ) e . Then using the fact that sum of p e is a constant, we use the Cauchy-Schwarz inequality to derive the optimal p e . Details are in Appendix A.

Note that calculating b:

( ) e requires computing

x( -1) v , which increases the complexity of sampling. As a reasonable simplification, we ignore

x( ) v to make the edge probability dependent on the graph topology only. Therefore, we choose

p e ∝ A v,u + A u,v = 1 deg(u) + 1 deg(v)

. The derived optimal edge sampler agrees with the intuition in Section 3.1. If two nodes u, v are connected and they have few neighbors, then u and v are likely to be influential to each other. In this case, the edge probability p u,v = p v,u should be high. The above analysis on edge samplers also inspires us to design other samplers, which are presented in Section 3.4.

Remark We can also apply the above edge sampler to perform layer sampling. Under the independent layer sampling assumption of Chen et al. (2018b) , one would sample a connection u ( ) , v ( +1) with probability p

( ) u,v ∝ 1 deg(u) + 1 deg(v) .

For simplicity, assume a uniform degree graph (of degree d). Then p ( ) e = p. For an already sampled u ( ) to connect to layer + 1, at least one of its edges has to be selected by the layer + 1 sampler. Clearly, the probability of an input layer node to "survive" the

L number of independent sampling process is 1 -(1 -p) d L-1

. Such layer sampler potentially returns an overly sparse minibatch for L > 1. On the other hand, connectivity within a minibatch of GraphSAINT never drops with GCN depth. If an edge is present in layer , it is present in all layers.

3.4. SAMPLERS:

Based on the above variance analysis, we present several light-weight and efficient samplers that GraphSAINT has integrated. Detailed sampling algorithms are listed in Appendix B.

Random node sampler We sample |V s | nodes from V randomly, according to a node probability distribution P (u) ∝ A :,u Random edge sampler We perform edge sampling as described in Section 3.3.

Random walk based samplers Another way to analyze graph sampling based multi-layer GCN is to ignore activations. In such case, L layers can be represented as a single layer with edge weights given by B = A L . Following a similar approach as Section 3.3, if it were possible to pick pairs of nodes (whether or not they are directly connected in the original A) independently, then we would set p u,v ∝ B u,v + B v,u , where B u,v can be interpreted as the probability of a random walk to start at u and end at v in L hops (and B v,u vice-versa). Even though it is not possible to sample a subgraph where such pairs of nodes are independently selected, we still consider a random walk sampler with walk length L as a good candidate for L-layer GCNs. There are numerous random walk based samplers proposed in the literature (Ribeiro & Towsley, 2010; Leskovec & Faloutsos, 2006; Hu & Lau, 2013; Li et al., 2015) . In the experiments, we implement a regular random walk sampler (with r root nodes selected uniformly at random and each walker goes h hops), and also a multi-dimensional random walk sampler defined in Ribeiro & Towsley (2010) . For all the above samplers, we return the subgraph induced from the sampled nodes. The induction step adds more connections into the subgraph, and empirically helps improve convergence.

4. DISCUSSION:

Extensions GraphSAINT admits two orthogonal extensions. First, GraphSAINT can seamlessly integrate other graph samplers. Second, the idea of training by graph sampling is applicable to many GCN architecture variants: 1. Jumping knowledge (Xu et al., 2018) : since our GCNs constructed during training are complete, applying skip connections to GraphSAINT is straightforward. On the other hand, for some layer sampling methods (Chen et al., 2018b; Huang et al., 2018) , extra modification to their samplers is required, since the jumping knowledge architecture requires layersamples to be a subset of layer-( -1) samples * . 2. Attention (Veličković et al., 2017; Fey, 2019; Zhang et al., 2018) : while explicit variance reduction is hard due to the dynamically updated attention values, it is reasonable to apply attention within the subgraphs which are considered as representatives of the full graph. Our loss and aggregator normalizations are also applicable † . 3. Others: To support high order layers (Zhou, 2017; Lee et al., 2018; Abu-El-Haija et al., 2019) or even more complicated networks for the task of graph classification (Ying et al., 2018b) , we replace the full adjacency matrix A with the (normalized) one for the subgraph A s to perform layer propagation.

Comparison GraphSAINT enjoys: 1. high scalability and efficiency, 2. high accuracy, and 3. low training complexity. Point (1) is due to the significantly reduced neighborhood size compared with Hamilton et al. (2017) ; Ying et al. (2018a) ; Chen et al. (2018a) . Point (2) is due to the better interlayer connectivity compared with Chen et al. (2018b) , and unbiased minibatch estimator compared with Chiang et al. (2019) . Point (3) is due to the simple and trivially parallelizable pre-processing compared with the sampling of Huang et al. (2018) and clustering of Chiang et al. (2019) .

5. EXPERIMENTS:

Setup Experiments are under the inductive, supervised learning setting. We evaluate GraphSAINT on the following tasks: 1. classifying protein functions based on the interactions of human tissue proteins (PPI), 2. categorizing types of images based on the descriptions and common properties of online images (Flickr), 3. predicting communities of online posts based on user comments (Reddit), 4. categorizing types of businesses based on customer reviewers and friendship (Yelp), and 5. classifying product categories based on buyer reviewers and interactions (Amazon). For PPI, we use the small version for the two layer convergence comparison (Table 2 and Figure 2019) to be consistent with its reported accuracy. All datasets follow "fixed-partition" splits. Appendix C.2 includes further details. We open source GraphSAINT ‡ . We compare with six baselines: 1. vanilla GCN (Kipf & Welling, 2016) , 2. GraphSAGE (Hamilton et al., 2017) , 3. FastGCN (Chen et al., 2018b) , 4. S-GCN (Chen et al., 2018a) , 5. AS-GCN (Huang et al., 2018) , and 6. ClusterGCN (Chiang et al., 2019) . All baselines are executed with their officially released code (see Appendix C.3 for downloadable URLs and commit numbers). Baselines and GraphSAINT are all implemented in Tensorflow with Python3.

We run experiments on a NVIDIA Tesla P100 GPU (see Appendix C.1 for hardware specification).

5.1. COMPARISON WITH STATE-OF-THE-ART:

Table 2 and Figure 2 show the accuracy and convergence comparison of various methods. All results correspond to two-layer GCN models (for GraphSAGE, we use its mean aggregator). For a given dataset, we keep hidden dimension the same across all methods. We describe the detailed architecture and hyperparameter search procedure in Appendix C.3. The mean and confidence interval of the accuracy values in Table 2 are measured by three runs under the same hyperparameters. The training time of Figure 2 excludes the time for data loading, pre-processing, validation set evaluation and model saving. Our pre-processing incurs little overhead in training time. See Appendix D.2 for cost of graph sampling. For GraphSAINT, we implement the graph samplers described in Section 3.4. In Table 2 , "Node" stands for random node sampler; "Edge" stands for random edge sampler; "RW" stands for random walk sampler; "MRW" stands for multi-dimensional random walk sampler. GraphSAINT-Node 0.960±0.001 0.507±0.001 0.962±0.001 0.641±0.000 0.782±0.004 GraphSAINT-Edge 0.981±0.007 0.510±0.002 0.966±0.001 0.653±0.003 0.807±0.001 GraphSAINT-RW 0.981±0.004 0.511±0.001 0.966±0.001 0.653±0.003 0.815±0.001 GraphSAINT-MRW 0.980±0.006 0.510±0.001 0.964±0.000 0.652±0.001 0.809±0.001 Clearly, with appropriate graph samplers, GraphSAINT achieves significantly higher accuracy on all datasets. For GraphSAINT-Node, we use the same node probability as FastGCN. Thus, the accuracy improvement is mainly due to the switching from layer sampling to graph sampling (see "Remark" in Section 3.3). Compared with AS-GCN, GraphSAINT is significantly faster. The sampler of AS-GCN is expensive to execute, making its overall training time even longer than vanilla GCN. We provide detailed computation complexity analysis on the sampler in Appendix D.2. For S-GCN on Reddit, it achieves similar accuracy as GraphSAINT, at the cost of over 9× longer training time. The released code of FastGCN only supports CPU execution, so its convergence curve is dashed.

Table 3 presents additional comparison with ClusterGCN. We use L × f to specify the architecture, where L and f denote GCN depth and hidden dimension, respectively. The four architectures are the ones used in the original paper (Chiang et al., 2019) . Again, GraphSAINT achieves significant accuracy improvement. To train models with L > 2 often requires additional architectural tweaks. ClusterGCN uses its diagonal enhancement technique for the 5-layer PPI and 4-layer Reddit models.

GraphSAINT uses jumping knowledge connection (Xu et al., 2018) for 4-layer Reddit.

Evaluation on graph samplers From Table 2 , random edge and random walk based samplers achieve higher accuracy than the random node sampler. Figure 3 presents sensitivity analysis on parameters of "RW". We use the same hyperparameters (except the sampling parameters) and network architecture as those of the "RW" entries in Table 2 . We fix the length of each walker to 2 (i.e., GCN depth), and vary the number of roots r from 250 to 2250. For PPI, increasing r from 250 to 750 significantly improves accuracy. Overall, for all datasets, accuracy stabilizes beyond r = 750.

5.2. GraphSAINT ON ARCHITECTURE VARIANTS AND DEEP MODELS:

In Figure 4 , we train a 2-layer and a 4-layer model of GAT (Veličković et al., 2017) and JK-net (Xu et al., 2018) , by using minibatches of GraphSAGE and GraphSAINT respectively. On the two 4-layer architectures, GraphSAINT achieves two orders of magnitude speedup than GraphSAGE, indicating much better scalability on deep models. From accuracy perspective, 4-layer GAT-SAGE and JK-SAGE do not outperform the corresponding 2-layer versions, potentially due to the smoothening effect caused by the massive neighborhood size. On the other hand, with minibatches returned by our edge sampler, increasing model depth of JK-SAINT leads to noticeable accuracy improvement (from 0.966 of 2-layer to 0.970 of 4-layer). Appendix D.1 contains additional scalability results.

6. CONCLUSION:

We have presented GraphSAINT, a graph sampling based training method for deep GCNs on large graphs. We have analyzed bias and variance of the minibatches defined on subgraphs, and proposed An interesting future direction is to develop distributed training algorithms using graph sampling based minibatches. After partitioning the training graph in distributed memory, sampling can be performed independently on each processor. Afterwards, training on the self-supportive subgraphs can significantly reduce the system-level communication cost. To ensure the overall convergence quality, data shuffling strategy for the graph nodes and edges can be developed together with each specific graph sampler. Another direction is to perform algorithm-system co-optimization to accelerate the training of GraphSAINT on heterogeneous computing platforms (Zeng et al., 2018; Zeng & Prasanna, 2019) . The resolution of "neighbor explosion" by GraphSAINT not only reduces the training computation complexity, but also improves hardware utilization by significantly less data traffic to the slow memory. In addition, task-level parallelization is easy since the light-weight graph sampling is completely decoupled from the GCN layer propagation.

A PROOFS:

Proof of Proposition 3.1. Under the condition that v is sampled in a subgraph:

E ζ ( +1) v =E u∈V A v,u α u,v x( ) u 1 u|v = u∈V A v,u α u,v x( ) u E 1 u|v = u∈V A v,u α u,v x( ) u P ((u, v) sampled|v sampled) = u∈V A v,u α u,v x( ) u P ((u, v) sampled) P (v sampled) = u∈V A v,u α u,v x( ) u p u,v p v (5)

where the second equality is due to linearity of expectation, and the third equality (conditional edge probability) is due to the initial condition that v is sampled in a subgraph.

It directly follows that, when

α u,v = pu,v pv , E ζ ( +1) v = u∈V A v,u x( ) u

Proof of Theorem 3.2. Below, we use Cov (•) to denote covariance and Var (•) to denote variance.

For independent edge sampling as defined in Section 3.3, Cov 1 ( 1) e1 , 1 ( 2) e2 = 0, ∀e 1 = e 2 . And for a full GCN on the subgraph, Cov 1 ( 1) e , 1 

C DETAILED EXPERIMENTAL SETUP C.1 HARDWARE SPECIFICATION AND ENVIRONMENT:

We run our experiments on a single machine with Dual Intel Xeon CPUs (E5-2698 v4 @ 2.2Ghz), one NVIDIA Tesla P100 GPU (16GB of HBM2 memory) and 512GB DDR4 memory. The code is written in Python 3.6.8 (where the sampling part is written with Cython 0.29.2). We use Tensorflow 1.12.0 on CUDA 9.2 with CUDNN 7.2.1 to train the model on GPU. Since the subgraphs are sampled independently, we run the sampler in parallel on 40 CPU cores. 

EQUATION

V s ← n nodes randomly sampled (with replacement) from V according to P 4:

G s ← Node induced subgraph of G from V s 5: end function 6: function EDGE(G,m)

Edge sampler (approximate version) 7:

P ((u, v)) := 1 deg(u) + 1 deg(v) / (u ,v )∈E 1 deg(u ) + 1 deg(v ) 8:

E s ← m edges randomly sampled (with replacement) from E according to P 9:

V s ← Set of nodes that are end-points of edges in E s 10:

G s ← Node induced subgraph of G from V s 11: end function 12: function RW(G,r,h)

Random walk sampler 13:

V root ← r root nodes sampled uniformly at random (with replacement) from V 14:

V s ← V root 15:

for v ∈ V root do 16:

u ← v V FS ← r root nodes sampled uniformly at random (with replacement) from V 26:

V s ← V FS 27:

for i = r + 1 to n do 28:

Select u ∈ V FS with probability deg(u)/ v∈VFS deg(v)

29:

u ← Node randomly sampled from u's neighbor 30: The Flickr dataset originates from NUS-wide § . The SNAP website ¶ collected Flickr data from four different sources including NUS-wide, and generated an un-directed graph. One node in the graph represents one image uploaded to Flickr. If two images share some common properties (e.g., same geographic location, same gallery, comments by the same user, etc.), there is an edge between the nodes of these two images. We use as the node features the 500-dimensional bag-of-word representation of the images provided by NUS-wide. For labels, we scan over the 81 tags of each image and manually merged them to 7 classes. Each image belongs to one of the 7 classes.

V FS ← (V FS \ {u}) ∪ {u } 31: V s ← V s ∪ {u}

The Yelp dataset is prepared from the raw json data of businesses, users and reviews provided in the open challenge website . For nodes and edges, we scan the friend list of each user in the raw json file of users. If two users are friends, we create an edge between them. We then filter out all the reviews by each user and separate the reviews into words. Each review word is converted to a 300-dimensional vector using the Word2Vec model pre-trained on GoogleNews * * . The word vectors of each node are added and normalized to serve as the node feature (i.e., x v ). As for the node labels, we scan the raw json file of businesses, and use the categories of the businesses reviewed by a user v as the multi-class label of v.

For the Amazon dataset, a node is a product on the Amazon website and an edge (u, v) is created if products u and v are bought by the same customer. Each product contains text reviews (converted to 4-gram) from the buyer. We use SVD to reduce the dimensionality of the 4-gram representation to 200, and use the obtained vectors as the node feature. The labels represent the product categories (e.g., books, movies, shoes).

Figure 5 shows the degree distribution of the five graphs. A point (k, p) in the plot means the probability of a node having degree at least k is p.

C.3 ADDITIONAL DETAILS IN EXPERIMENTAL CONFIGURATION:

Table 4 summarizes the URLs to download the baseline codes.

The optimizer for GraphSAINT and all baselines is Adam (Kingma & Ba, 2014) . For all baselines and datasets, we perform grid search on the hyperparameter space defined by: 2 . On the two large graphs (Reddit and Yelp), we increase the number of layers and measure the average time per minibatch execution. In Figure 6 , training cost of GraphSAINT is approximately linear with GCN depth. Training cost of S-GCN grows dramatically when increasing the depth. This reflects the "neighbor explosion" phenomenon (even though the expansion factor of S-GCN is just 2). On Yelp, S-GCN gives "out-of-memory" error for models beyond 5 layers.

D.2 COST OF SAMPLING AND PRE-PROCESSING:

Cost of graph samplers of GraphSAINT Graph sampling introduces little training overhead. Let t s be the average time to sample one subgraph on a multi-core machine. Let t t be the average time to perform the forward and backward propagation on one minibatch on GPU. Figure 7 shows the ratio t s /t t for various datasets. The parameters of the samplers are the same as Cost of layers sampler of AS-GCN AS-GCN uses an additional neural network to estimate the conditional sampling probability for the previous layer. For a node v already sampled in layer , features of layer-( -1) corresponding to all v's neighbors need to be fed to the sampling neural network to obtain the node probability. For sake of analysis, assume the sampling network is a single layer MLP, whose weight W MLP has the same shape as the GCN weights W ( ) . Then we can show, for a L-layer GCN on a degree-d graph, per epoch training complexity of AS-GCN is approximately γ

= (d • L) / L-1

=0 d times that of vanilla GCN. For L = 2, we have γ ≈ 2. This explains the observation that AS-GCN is slower than vanilla GCN in Figure 2 . Additional, Table 8 shows the training time breakdown for AS-GCN. Clearly, its sampler is much more expensive than the graph sampler of GraphSAINT. Cost of clustering of ClusterGCN ClusterGCN uses the highly optimized METIS software † † to perform clustering. Table 9 summarizes the time to obtain the clusters for the five graphs. On the large and dense Amazon graph, the cost of clustering increase dramatically. The pre-processing time of ClusterGCN on Amazon is more than 4× of the total training time. On the other hand, the sampling cost of GraphSAINT does not increase significantly for large graphs (see Figure 7 ). 11 shows the change of test set accuracy with batch sizes. For each row of Table 11 , we fix the batch size, tune the other hyperparameters according to Appendix C.3, and report the highest test set accuracy achieved. For GraphSAGE, S-GCN and AS-GCN, their default batch sizes (512,1000 and 512, respectively) lead to the highest accuracy on all datasets. For FastGCN, increasing the default batch size (from 400 to 4000) leads to noticeable accuracy improvement. For ClusterGCN, different datasets correspond to different optimal batch sizes. Note that the accuracy in Section 5.1 is already tuned by identifying the optimal batch size on a per graph basis.

For FastGCN, intuitively, increasing batch size may help with accuracy improvement since the minibatches may become better connected. Such intuition is verified by the rows of 400 and 2000. However, increasing the batch size from 2000 to 4000 does not further improve accuracy significantly. For ClusterGCN, the optimal batch size depends on the cluster structure of the training graph. For PPI, small batches are better, while for Amazon, batch size does not have significant impact on accuracy. For GraphSAGE, overly large batches may have negative impact on accuracy due to neighbor explosion. Approximately, GraphSAGE expand 10× more neighbors per layer. For a 2-layer GCN, a size 2 × 10 3 minibatch would then require the support of 2 × 10 5 nodes from the For S-GCN, with batch size of 500, it fails to learn properly on Reddit and Yelp. The accuracy fluctuates in a region of very low value, even after appropriate hyperparameter tuning. For AS-GCN, its accuracy is not sensitive to the batch size, since AS-GCN addresses neighbor explosion and also ensures good inter-layer connectivity within the minibatch.

:



Figures and Tables:

Figure 1: GraphSAINT training algorithm

2), sinceHamilton et al. (2017) andChen et al. (2018a)  report accuracy for this version in their original papers. We use the large version for additional comparison withChiang et al. (

Figure 2: Convergence curves of 2-layer models on GraphSAINT and baselines

Figure 3: Sensitivity analysis

p e -p 2 e . To start the proof, we first assume that the b ( ) e is one dimensional (i.e., a scalar) and denote it by b constant m = e p e be the expected number of sampled edges. By Cauchy-Schwarz ine . i.e., variance is minimized when p e ∝ b similar steps as above, it is easy to show that the optimal edge probability to minimize i Var (ζ i ) (where i is the index for ζ's dimensions) is: the four graph samplers we have integrated into GraphSAINT. The naming of the samplers follows that of Table2. Note that the sampling parameters n and m specify a budget rather than the actual number of nodes and edges in the subgraph G s . Since certain nodes or edges in the training graph G may be repeatedly sampled under a single invocation of the sampler, we often have |V s | < n for node and MRW samplers, |V s | < 2m for edge sampler, and |V s | < r • h for RW sampler. Also note that the edge sampler presented in Algorithm 2 is an approximate version of the independent edge sampler defined in Section 3.4. Complexity (excluding the subgraph induction step) of the original version in Section 3.4 is O (|E|), while complexity of the approximate one is O (m). When m |E|, the approximate version leads to identical accuracy as the original one, for a given m.

Node induced subgraph of G from V s 23: end function 24: function MRW(G,n,r) Multi-dimensional random walk sampler 25:

Figure 5: Degree Distribution

Figure 6: Comparison of training efficiency

and Algorithm 1 illustrate the training algorithm. Before training starts, we perform light-weight pre-processing on G with the given sampler SAMPLE. The pre-processing estimates the probability of a node v ∈ V and an edge e ∈ E being sampled by SAMPLE. Such probability is later used to normalize the subgraph neighbor aggregation and the minibatch loss (Section 3.2). Afterwards,

Table content: <table><tr><td colspan="2">Algorithm 1 GraphSAINT training algorithm</td></tr><tr><td colspan="2">Input: Training graph G (V, E, X); Labels Y ; Sampler SAMPLE;</td></tr><tr><td colspan="2">Output: GCN model with trained weights</td></tr><tr><td colspan="2">1: Pre-processing: Setup SAMPLE parameters; Compute normalization coefficients α, λ.</td></tr><tr><td colspan="2">2: for each minibatch do</td></tr><tr><td>3:</td><td>G s (V s , E s ) ← Sampled sub-graph of G according to SAMPLE</td></tr><tr><td>4:</td><td/></tr></table>

Dataset statistics ("m" stands for multi-class classification, and "s" for single-class.)

Table content: <table><tr><td>Dataset</td><td>Nodes</td><td>Edges</td><td colspan="4">Degree Feature Classes Train / Val / Test</td></tr><tr><td>PPI</td><td>14,755</td><td>225,270</td><td>15</td><td>50</td><td colspan="2">121 (m) 0.66 / 0.12 / 0.22</td></tr><tr><td>Flickr</td><td>89,250</td><td>899,756</td><td>10</td><td>500</td><td>7 (s)</td><td>0.50 / 0.25 / 0.25</td></tr><tr><td>Reddit</td><td>232,965</td><td>11,606,919</td><td>50</td><td>602</td><td>41 (s)</td><td>0.66 / 0.10 / 0.24</td></tr><tr><td>Yelp</td><td>716,847</td><td>6,977,410</td><td>10</td><td>300</td><td colspan="2">100 (m) 0.75 / 0.10 / 0.15</td></tr><tr><td colspan="3">Amazon 1,598,960 132,169,734</td><td>83</td><td>200</td><td colspan="2">107 (m) 0.85 / 0.05 / 0.10</td></tr><tr><td>PPI (large version)</td><td>56,944</td><td>818,716</td><td>14</td><td>50</td><td colspan="2">121 (m) 0.79 / 0.11 / 0.10</td></tr></table>

Comparison of test set F1-micro score with state-of-the-art methods

Table content: <table><tr><td>Method</td><td>PPI</td><td>Flickr</td><td>Reddit</td><td>Yelp</td><td>Amazon</td></tr><tr><td colspan="6">GCN 0.515±0.006 0.492±0.003 0.933±0.000 0.378±0.001 0.281±0.005</td></tr><tr><td colspan="6">GraphSAGE 0.637±0.006 0.501±0.013 0.953±0.001 0.634±0.006 0.758±0.002</td></tr><tr><td colspan="6">FastGCN 0.513±0.032 0.504±0.001 0.924±0.001 0.265±0.053 0.174±0.021</td></tr><tr><td colspan="5">S-GCN 0.963±0.010 0.482±0.003 0.964±0.001 0.640±0.002</td><td>- ‡</td></tr><tr><td colspan="4">AS-GCN 0.687±0.012 0.504±0.002 0.958±0.001</td><td>- ‡</td><td>- ‡</td></tr><tr><td colspan="6">ClusterGCN 0.875±0.004 0.481±0.005 0.954±0.001 0.609±0.005 0.759±0.008</td></tr></table>

Additional comparison with ClusterGCN (test set F1-micro score)

Table content: <table><tr><td colspan="2">PPI (large version)</td><td>Reddit</td><td/></tr><tr><td>2 × 512</td><td>5 × 2048</td><td>2 × 128</td><td>4 × 128</td></tr><tr><td colspan="4">ClusterGCN 0.903±0.002 0.994±0.000 0.954±0.001 0.966±0.001</td></tr><tr><td colspan="4">GraphSAINT 0.941±0.003 0.995±0.000 0.966±0.001 0.970±0.001</td></tr><tr><td/><td/><td/><td/></tr></table>

Algorithm 2 Graph sampling algorithms by GraphSAINT Input: Training graph G (V, E); Sampling parameters: node budget n; edge budget m; number of roots r; random walk length h Output: Sampled graph G s (V s , E s )

Table content: <table><tr><td>1: function NODE(G,n)</td><td>Node sampler</td></tr><tr><td>2:</td><td/></tr></table>

Hidden dimension: {128, 256, 512} § http://lms.comp.nus.edu.sg/research/NUS-WIDE.htm ¶ https://snap.stanford.edu/data/web-flickr.html https://www.yelp.com/dataset * * https://code.google.com/archive/p/word2vec/

Table content: <table><tr><td/><td colspan="3">GraphSAINT: Reddit</td><td/><td colspan="2">S-GCN: Reddit</td></tr><tr><td/><td colspan="3">GraphSAINT: Yelp</td><td/><td colspan="2">S-GCN: Yelp</td></tr><tr><td>Normalized training time</td><td>0 2 4 6 8</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td></tr><tr><td/><td/><td/><td colspan="2">GCN depth</td><td/><td/></tr></table>

For Node, Edge and RW samplers, we observe that time to sample one subgraph is in most cases less than 25% of the training time. The MRW sampler is more expensive to execute. Regarding the complete pre-processing procedure, we repeatedly run the sampler for N = 50 • |V| /|V s | times before training, to estimate the node and edge probability as discussed in Section 3.2 (where |V s | is the average subgraph size). These sampled subgraphs are reused as training minibatches. Thus, if training runs for more than N iterations, the pre-processing is nearly zero-cost. Under the setting of Table2, pre-processing on PPI and Yelp and Amazon does not incur any overhead in training time. Pre-processing on Flickr and Reddit (with RW sampler) takes less than 40% and 15% of their corresponding total training time.

Table content: <table/>

Per epoch training time breakdown for AS-GCN

Table content: <table><tr><td colspan="2">Dataset Sampling time (sec)</td><td>Forward / Backward propagation time (sec)</td></tr><tr><td>PPI</td><td>1.1</td><td>0.2</td></tr><tr><td>Flickr</td><td>5.3</td><td>1.1</td></tr><tr><td>Reddit</td><td>20.7</td><td>3.5</td></tr></table>

Clustering time of ClusterGCNTaking into account the pre-processing time, sampling time and training time altogether, we summarize the total convergence time of GraphSAINT and ClusterGCN in Table 10 (corresponding to Table 2 configuration). On graphs that are large and dense (e.g., Amazon), GraphSAINT achieves significantly faster convergence. Note that both the sampling of GraphSAINT and clustering of ClusterGCN can be performed offline.

Table content: <table><tr><td colspan="5">PPI Flickr Reddit Yelp Amazon</td></tr><tr><td>Time (sec) 2.2</td><td>11.6</td><td>40.0</td><td>106.7</td><td>2254.2</td></tr></table>

Comparison of total convergence time (pre-processing + sampling + training, unit: second)

Table content: <table><tr><td>PPI</td><td colspan="4">Flickr Reddit Yelp Amazon</td></tr><tr><td>GraphSAINT-Edge 91.0</td><td>7.0</td><td>16.6</td><td>273.9</td><td>401.0</td></tr><tr><td>GraphSAINT-RW 103.6</td><td>7.5</td><td>17.2</td><td>310.1</td><td>425.6</td></tr><tr><td>ClusterGCN 163.2</td><td>12.9</td><td>55.3</td><td>256.0</td><td>2804.8</td></tr><tr><td>D.3 EFFECT OF BATCH SIZE</td><td/><td/><td/><td/></tr><tr><td>Table</td><td/><td/><td/><td/></tr></table>

Test set F1-micro for the baselines under various batch sizes Note that the full training graph size of Reddit is just around 1.5 × 10 5 . Thus, no matter which nodes are sampled in the output layer, GraphSAGE would almost always propagate features within the full training graph for initial layers. We suspect this would lead to difficulties in learning.

Table content: <table><tr><td colspan="2">Method Batch size</td><td>PPI</td><td colspan="3">Flickr Reddit Yelp Amazon</td></tr><tr><td/><td>256</td><td colspan="4">0.600 0.474 0.934 0.563</td><td>0.428</td></tr><tr><td>GraphSAGE</td><td>512  *  1024</td><td colspan="4">0.637 0.501 0.953 0.634 0.610 0.482 0.935 0.632</td><td>0.758 0.705</td></tr><tr><td/><td>2048</td><td colspan="4">0.625 0.374 0.936 0.563</td><td>0.447</td></tr><tr><td/><td>400  *</td><td colspan="4">0.513 0.504 0.924 0.265</td><td>0.174</td></tr><tr><td>FastGCN</td><td>2000</td><td colspan="4">0.561 0.506 0.934 0.255</td><td>0.196</td></tr><tr><td/><td>4000</td><td colspan="4">0.564 0.507 0.934 0.260</td><td>0.195</td></tr><tr><td/><td>500</td><td colspan="2">0.519 0.462</td><td>- ¶</td><td>- ¶</td><td>- ‡</td></tr><tr><td/><td>1000  *</td><td colspan="4">0.963 0.482 0.964 0.640</td><td>- ‡</td></tr><tr><td>S-GCN</td><td>2000</td><td colspan="4">0.646 0.482 0.949 0.614</td><td>- ‡</td></tr><tr><td/><td>4000</td><td colspan="4">0.804 0.482 0.949 0.594</td><td>- ‡</td></tr><tr><td/><td>8000</td><td colspan="4">0.694 0.481 0.950 0.613</td><td>- ‡</td></tr><tr><td/><td>256</td><td colspan="3">0.682 0.504 0.950</td><td>- ‡</td><td>- ‡</td></tr><tr><td>AS-GCN</td><td>512  *  1024</td><td colspan="3">0.687 0.504 0.958 0.687 0.502 0.951</td><td>- ‡ - ‡</td><td>- ‡ - ‡</td></tr><tr><td/><td>2048</td><td colspan="3">0.670 0.502 0.952</td><td>- ‡</td><td>- ‡</td></tr><tr><td/><td>500</td><td colspan="4">0.875 0.481 0.942 0.604</td><td>0.752</td></tr><tr><td/><td>1000</td><td colspan="4">0.831 0.478 0.947 0.602</td><td>0.756</td></tr><tr><td/><td>1500</td><td colspan="4">0.865 0.480 0.954 0.602</td><td>0.752</td></tr><tr><td>ClusterGCN</td><td>2000 2500</td><td colspan="4">0.828 0.469 0.954 0.609 0.849 0.476 0.954 0.598</td><td>0.759 0.745</td></tr><tr><td/><td>3000</td><td colspan="4">0.840 0.473 0.954 0.607</td><td>0.754</td></tr><tr><td/><td>3500</td><td colspan="4">0.846 0.473 0.952 0.602</td><td>0.754</td></tr><tr><td/><td>4000</td><td colspan="4">0.853 0.472 0.949 0.605</td><td>0.756</td></tr><tr><td>input layer.</td><td/><td/><td/><td/></tr></table>

Peer review (iclr2020):
This paper proposed a new sampling method to train GCN in the mini-batch manner. In particular, unlike existing methods which samples the mini-batch in the node-wise way, GraphSAINT proposed to sample a mini-batch in the graph-wise way. As a result, GraphSAINT uses the same graph across different GCN layers, while most existing methods use different graphs across different GCN layers. In addition, the authors show that this sampling method is unbiased. Extensive experimental results have shown improvement over existing methods. Overall, this idea is interesting and well presented. Pros: 1. A new sampling method for the stochastic training of GCN. Have good performance. 2. Extensive experiments to verify the performance of the proposed method. 3. The theoretical analysis looks sound. Cons: 1. GraphSAGE and FastGCN use different graphs across different GCN layers, while ClusterGCN and GraphSAINT use the same graph across different GCN layers. To make a fair comparison, it is necessary to have the same batch size for different methods. How do you deal with this issue in your experiment? 2. For ClusterGCN, the clustering procedure is done before the training. So, it needs much less computational overhead for sampling in the training course. However, GraphSAINT needs to do the heavy sampling online. Thus, it may consume more time than ClusterGCN for large graphs. It*s better to show the running time of these two methods.