Year: 2021

Abstract:
Given the prevalence of large-scale graphs in real-world applications, the storage and time for training neural models have raised increasing concerns. To alleviate the concerns, we propose and study the problem of graph condensation for graph neural networks (GNNs). Specifically, we aim to condense the large, original graph into a small, synthetic and highly-informative graph, such that GNNs trained on the small graph and large graph have comparable performance. We approach the condensation problem by imitating the GNN training trajectory on the original graph through the optimization of a gradient matching loss and design a strategy to condense node futures and structural information simultaneously. Extensive experiments have demonstrated the effectiveness of the proposed framework in condensing different graph datasets into informative smaller graphs. In particular, we are able to approximate the original test accuracy by 95.3% on Reddit, 99.8% on Flickr and 99.0% on Citeseer, while reducing their graph size by more than 99.9%, and the condensed graphs can be used to train various GNN architectures.

text: Given the prevalence of large-scale graphs in real-world applications, the storage and time for training neural models have raised increasing concerns. To alleviate the concerns, we propose and study the problem of graph condensation for graph neural networks (GNNs). Specifically, we aim to condense the large, original graph into a small, synthetic and highly-informative graph, such that GNNs trained on the small graph and large graph have comparable performance. We approach the condensation problem by imitating the GNN training trajectory on the original graph through the optimization of a gradient matching loss and design a strategy to condense node futures and structural information simultaneously. Extensive experiments have demonstrated the effectiveness of the proposed framework in condensing different graph datasets into informative smaller graphs. In particular, we are able to approximate the original test accuracy by 95.3% on Reddit, 99.8% on Flickr and 99.0% on Citeseer, while reducing their graph size by more than 99.9%, and the condensed graphs can be used to train various GNN architectures.

heading: 1 INTRODUCTION
text: Many real-world data can be naturally represented as graphs such as social networks, chemical molecules, transportation networks, and recommender systems (Battaglia et al., 2018; Wu et al., 2019b; Zhou et al., 2018). As a generalization of deep neural networks for graph-structured data, graph neural networks (GNNs) have achieved great success in capturing the abundant information residing in graphs and tackle various graph-related applications (Wu et al., 2019b; Zhou et al., 2018).
However, the prevalence of large-scale graphs in real-world scenarios, often on the scale of millions of nodes and edges, poses significant computational challenges for training GNNs. More dramatically, the computational cost continues to increase when we need to retrain the models multiple times, e.g., under incremental learning settings, hyperparameter and neural architecture search. To address this challenge, a natural idea is to properly simplify, or reduce the graph so that we can not only speed up graph algorithms (including GNNs) but also facilitate storage, visualization and retrieval for associated graph data analysis tasks.
There are two main strategies to simplify graphs: graph sparsification (Peleg & Schäffer, 1989; Spielman & Teng, 2011) and graph coarsening (Loukas & Vandergheynst, 2018; Loukas, 2019) . Graph sparsification approximates a graph with a sparse graph by reducing the number of edges, while graph coarsening directly reduces the number of nodes by replacing the original node set with its subset. However, these methods have some shortcomings: (1) sparsification becomes much less promising in simplifying graphs when nodes are also associated with attributes as sparsification does not reduce the node attributes; (2) the goal of sparsification and coarsening is to preserve some graph properties such as principle eigenvalues (Loukas & Vandergheynst, 2018) that could be not optimal for the downstream performance of GNNs. In this work, we ask if it is possible to significantly reduce the graph size while providing sufficient information to well train GNN models.
Motivated by dataset distillation (Wang et al., 2018) and dataset condensation (Zhao et al., 2021) which generate a small set of images to train deep neural networks on the downstream task, we aim to condense a given graph through learning a synthetic graph structure and node attributes.
Correspondingly, we propose the task of graph condensation1. It aims to minimize the performance gap between GNN models trained on a synthetic, simplified graph and the original training graph. In this work, we focus on attributed graphs and the node classification task. We show that we are able to reduce the number of graph nodes to as low as 0.1% while training various GNN architectures to reach surprisingly good performance on the synthetic graph. For example, in Figure 1, we condense the graph of the Reddit dataset with 153,932 training nodes into only 154 synthetic nodes together with their connections. In essence, we face two challenges for graph condensation: (1) how to formulate the objective for graph condensation tractable for learning; and (2) how to parameterize the to-be-learned node features and graph structure. To address the above challenges, we adapt the gradient matching scheme in (Zhao et al., 2021) and match the gradients of GNN parameters w.r.t. the condensed graph and original graph. In this way, the GNN trained on condensed graph can mimic the training trajectory of that on real data. Further, we carefully design the strategy for parametrizations for the condensed graph. In particular, we introduce the strategy of parameterizing the condensed features as free parameters and model the synthetic graph structure as a function of features, which takes advantage of the implicit relationship between structure and node features, consumes less number of parameters and offers better performance.
Our contributions can be summarized as follows:
1. We make the first attempt to condense a large-real graph into a small-synthetic graph, such that the GNN models trained on the large graph and small graph have comparable performance. We introduce a proposed framework for graph condensation (GCOND) which parameterizes the condensed graph structure as a function of condensed node features, and leverages a gradient matching loss as the condensation objective. 2. Through extensive experimentation, we show that GCOND is able to condense different graph datasets and achieve comparable performance to their larger counterparts. For instance, GCOND approximates the original test accuracy by 95.3% on Reddit, 99.8% on Flickr and 99.0% on Citeseer, while reducing their graph size by more than 99.9%. Our approach consistently outperforms coarsening, coreset and dataset condensation baselines. 3. We make several important findings towards the condensation problem: (a) condensed graphs can generalize well to different GNN test models; (b) condensing node features and structural information simultaneously can benefit the performance; and (c) the condensed graphs are able to extract meaningful patterns hidden in the original data.

heading: 2 RELATED WORK
text: Dataset Distillation & Condensation. Dataset distillation (DD) (Wang et al., 2018; Bohdal et al., 2020; Nguyen et al., 2021) aims to distill knowledge of a large training dataset into a small synthetic dataset, such that a model trained on the synthetic set is able to obtain the comparable performance to that of a model trained on the original dataset. To improve the efficiency of DD, dataset condensation (DC) (Zhao et al., 2021; Zhao & Bilen, 2021) is proposed to learn the small synthetic dataset
1We aim to condense both graph structure and node attributes. A formal definition is given in Section 3.
by matching the gradients of the network parameters w.r.t. large-real and small-synthetic training data. However, these methods are designed exclusively for image data and are not applicable to non-Euclidean graph-structured data where samples (nodes) are interdependent. In this work, we generalize the problem of dataset condensation to graph domain and we seek to jointly learn the synthetic node features as well as graph structure. Additionally, our work relates to coreset methods (Welling, 2009; Sener & Savarese, 2017; Rebuffi et al., 2017), which seek to find informative samples from the original datasets. However, they rely on the presence of representative samples, and tend to give suboptimal performance.
Graph Sparsification & Coarsening. Graph sparsification and coarsening are two means of reducing the size of a graph. Sparsification reduces the number of edges while approximating pairwise distances (Peleg & Schäffer, 1989), cuts (Karger, 1999) or eigenvalues (Spielman & Teng, 2011) while coarsening reduces the number of nodes with similar constraints (Loukas & Vandergheynst, 2018; Loukas, 2019; Deng et al., 2020), typically by grouping original nodes into super-nodes, and defining their connections. Cai et al. (2021) proposes a GNN-based framework to learn these connections to improve coarsening quality. Huang et al. (2021) adopts coarsening as a preprocessing method to help scale up GNNs. Graph condensation also aims to reduce the number of nodes, but aims to learn synthetic nodes and connections in a supervised way, rather than unsupervised grouping as in these prior works. Graph pooling is also related to our work, but it targets at improving graph-level representation learning (see Appendix D).
Graph Neural Networks. Graph neural networks (GNNs) are a modern way to capture the intuition that inferences for individual samples (nodes) can be enhanced by utilizing graph-based information from neighboring nodes (Kipf & Welling, 2016; Hamilton et al., 2017; Klicpera et al., 2018; Veličković et al., 2018; Wu et al., 2019b;a). Due to their prevalence, various real-world applications have been tremendously facilitated including recommender systems (Ying et al., 2018a; Fan et al., 2019), computer vision (Li et al., 2019) and drug discovery (Duvenaud et al., 2015).
Graph Structure Learning. Our work is also related to graph structure learning, which explores methods to learn graphs from data. One line of work (Dong et al., 2016; Egilmez et al., 2017) learns graphs under certain structural constraints (e.g. sparsity) based on graph signal processing. Recent efforts aim to learn graphs by leveraging GNNs (Franceschi et al., 2019; Jin et al., 2020; Chen et al., 2020). However, these methods are incapable of learning graphs with smaller size, and are thus not applicable for graph condensation.

heading: 3 METHODOLOGY
text: In this section, we present our proposed graph condensation framework, GCOND. Consider that we have a graph dataset T = {A,X,Y}, where A ∈ RN×N is the adjacency matrix, N is the number of nodes, X ∈ RN×d is the d-dimensional node feature matrix and Y ∈ {0, . . . , C − 1}N denotes the node labels over C classes. Graph condensation aims to learn a small, synthetic graph dataset S = {A′,X′,Y′} with A′ ∈ RN ′×N ′ , X′ ∈ RN ′×D, Y′ ∈ {0, . . . , C − 1}N ′ and N ′ N , such that a GNN trained on S can achieve comparable performance to one trained on the much larger T . Thus, the objective can be formulated as the following bi-level problem,
min S L (GNNθS (A,X),Y) s.t θS = arg min θ L(GNNθ(A′,X′),Y′), (1)
where GNNθ denotes the GNN model parameterized with θ, θS denotes the parameters of the model trained on S, and L denotes the loss function used to measure the difference between model predictions and ground truth, i.e. cross-entropy loss. However, optimizing the above objective can lead to overfitting on a specific model initialization. To generate condensed data that generalizes to a distribution of random initializations Pθ0 , we rewrite the objective as follows:
min S Eθ0∼Pθ0 [L (GNNθS (A,X),Y)] s.t. θS = arg min θ L(GNNθ(θ0)(A ′,X′),Y′). (2) where θ(θ0) indicates that θ is a function acting on θ0. Note that the setting discussed above is for inductive learning where all the nodes are labeled and test nodes are unseen during training. We can easily generalize graph condensation to transductive setting by assuming Y is partially labeled.

heading: 3.1 GRAPH CONDENSATION VIA GRADIENT MATCHING
text: To tackle the optimization problem in Eq. (2), one strategy is to compute the gradient ofLw.r.t S and optimize S via gradient descent, as in dataset distillation (Wang et al., 2018). However, this requires
solving a nested loop optimization and unrolling the whole training trajectory of the inner problem, which can be prohibitively expensive. To bypass the bi-level optimization, we follow the gradient matching method proposed in (Zhao et al., 2021) which aims to match the network parameters w.r.t. large-real and small-synthetic training data by matching their gradients at each training step. In this way, the training trajectory on small-synthetic data S can mimic that on the large-real data T , i.e., the models trained on these two datasets converge to similar solutions (parameters). Concretely, the parameter matching process for GNNs can be modeled as follows:
minS Eθ0∼Pθ0 [∑T−1 t=0 D ( θSt ,θ T t )] with
θSt+1 = optθ
( L (
GNNθSt (A ′,X′),Y′ )) and θTt+1 = optθ ( L ( GNNθTt (A,X),Y ))
(3) whereD(·, ·) is a distance function, T is the number of steps of the whole training trajectory, optθ is the update rule for model parameters, and θSt , θ T t denote the model parameters trained on S and T at time step t, respectively. Since our goal is to match the parameters step by step, we then consider one-step gradient descent for the update rule optθ: θSt+1 ← θ S t − η∇θL ( GNNθSt (A ′,X′),Y′ ) and θTt+1 ← θ T t − η∇θL ( GNNθTt (A,X),Y
) (4)
where η is the learning rate for the gradient descent. Based on the observation made in Zhao et al. (2021) that the distance between θSt and θ T t is typically small, we can simplify the objective as a gradient matching process as follows,
min S Eθ0∼Pθ0 [ T−1∑ t=0 D (∇θL (GNNθt(A′,X′),Y′) ,∇θL (GNNθt(A,X),Y)) ] (5)
where θSt and θ T t are replaced by θt, i.e., training the same GNN on both synthetic graph and original graph. The distance D is further defined as the sum of the distance dis at each layer. Given two gradients GS ∈ Rd1×d2 and GT ∈ Rd1×d2 at a specific layer, the distance dis(·, ·) used for condensation is defined as follows,
dis(GS ,GT ) = d2∑ i=1
( 1− G
S i ·GTi∥∥GSi ∥∥∥∥GTi ∥∥
) (6)
where GSi ,G T i are the i-th column vectors of the gradient matrices. With the above formulations, we are able to achieve parameter matching through an efficient strategy of gradient matching.
We note that jointly learning the three variables A′,X′ and Y′ is highly challenging, as they are interdependent. Hence, to simplify the problem, we fix the node labels Y′ while keeping the class distribution the same as the original labels Y.
Graph Sampling. GNNs are often trained in a full-batch manner (Kipf & Welling, 2016; Wu et al., 2019b). However, as suggested by previous works that reconstruct data from gradients (Zhu et al., 2019), large batch size tends to make reconstruction more difficult because more variables are involved during optimization. To make things worse, the computation cost of GNNs gets expensive on large graphs as the forward pass of GNNs involves the aggregation of enormous neighboring nodes. To address the above issues, we sample a fixed-size set of neighbors on the original graph in each aggregation layer of GNNs and adopt a mini-batch training strategy. To further reduce memory usage and ease optimization, we calculate the gradient matching loss for nodes from different classes separately, as matching the gradients w.r.t. the data from a single class is easier than that from all classes. Specifically, for a given class c, we sample a batch of nodes of class c together with a portion of their neighbors from large-real data T . We denote the process as (Ac,Xc,Yc) ∼ T . For the condensed graph A′, we sample a batch of synthetic nodes of class c but do not sample their neighbors. In other words, we use all of their neighbors, i.e., all other nodes, during the aggregation process, since we need to learn the connections with other nodes. We denote the process as (A′c,X ′ c,Y ′ c) ∼ S.

heading: 3.2 MODELING CONDENSED GRAPH DATA
text: One essential challenge in the graph condensation problem is how to model the condensed graph data and resolve dependency among nodes. The most straightforward way is to treat both A′ and X′ as free parameters. However, the number of parameters in A′ grows quadratically as N ′ increases.
The increased model complexity can pose challenges in optimizing the framework and increase the risk of overfitting. Therefore, it is desired to parametrize the condensed adjacency matrix in a way where the number of parameters does not grow too fast. On the other hand, treating A′ and X′ as independent parameters overlooks the implicit correlations between graph structure and features, which have been widely acknowledged in the literature (Pfeiffer III et al., 2014; Shalizi & Thomas, 2011); e.g., in social networks, users interact with others based on their interests, while in e-commerce, users purchase products due to certain product attributes. Hence, we propose to model the condensed graph structure as a function of the condensed node features:
A′ = gΦ(X ′), with A′ij = Sigmoid
( MLPΦ([x′i;x ′ j ]) + MLPΦ([x ′ j ;x ′ i])
2
) (7)
where MLPΦ is a multi-layer neural network parameterized with Φ and [·; ·] denotes concatenation. In Eq. (7), we intentionally control A′ij = A ′ ji to make the condensed graph structure symmetric since we are mostly dealing with symmetric graphs. It can also adjust to asymmetric graphs by setting A′ij = Sigmoid(MLPΦ([xi;x ′ j ]). Then we rewrite our objective as
min X′,Φ Eθ0∼Pθ0 [ T−1∑ t=0 D (∇θL (GNNθt(gΦ(X′),X′),Y′) ,∇θL (GNNθt(A,X),Y)) ] (8)
Note that there are two clear benefits of the above formulation over the naı̈ve one (free parameters). Firstly, the number of parameters for modeling graph structure no longer depends on the number of nodes, hence avoiding jointly learning O(N ′2) parameters; as a result, when N ′ gets larger, GCOND suffers less risk of overfitting. Secondly, if we want to grow the synthetic graph by adding more synthetic nodes condensed from real graph, the trained MLPΦ can be employed to infer the connections of new synthetic nodes, and hence we only need to learn their features.
Alternating Optimization Schema. Jointly optimizing X′ and Φ is often challenging as they are directly affecting each other. Instead, we propose to alternatively optimize X′ and Φ: we update Φ for the first τ1 epochs and then update X′ for τ2 epochs; the process is repeated until the stopping condition is met – we find empirically that this does better as shown in Appendix B.
Sparsification. In the learned condensed adjacency matrix A′, there can exist some small values which have little effect on the aggregation process in GNNs but still take up a certain amount of storage (e.g. 4 bytes per float). Thus, we remove the entries whose values are smaller than a given threshold δ to promote sparsity of the learned A′. We further justify that suitable choices of δ for sparsification do not degrade performance a lot in Appendix B.
The detailed algorithm can be found in Algorithm 1 in Appendix C. In detail, we first set the condensed label set Y′ to fixed values and initialize X′ as node features randomly selected from each class. In each outer loop, we sample a GNN model initialization θ from a distribution Pθ. Then, for each class we sample the corresponding node batches from T and S, and calculate the gradient matching loss within each class. The sum of losses from different classes are used to update X′ or Φ. After that we update the GNN parameters for τθ epochs. When finishing the updating of condensed graph parameters, we use A′ = ReLU(gΦ(X′)− δ) to obtain the final sparsified graph structure. A “Graphless” Model Variant. We now explore another parameterization for the condensed graph data. We provide a model variant named GCOND-X that only learns the condensed node features X′ without learning the condensed structure A′. In other words, we use a fixed identity matrix I as the condensed graph structure. Specifically, this model variant aims to match the gradients of GNN parameters on the large-real data (A,X) and small-synthetic data (I,X′). Although GCOND-X is unable to learn the condensed graph structure which can be highly useful for downstream data analysis, it still shows competitive performance in Table 2 in the experiments because the features are learned to incorporate relevant information from the graph via the matching loss.

heading: 4 EXPERIMENTS
text: In this section, we design experiments to validate the effectiveness of the proposed framework GCOND. We first introduce experimental settings, then compare GCOND against representative baselines with discussions and finally show some advantages of GCOND.

heading: 4.1 EXPERIMENTAL SETUP
text: Datasets. We evaluate the condensation performance of the proposed framework on three transductive datasets, i.e., Cora, Citeseer (Kipf & Welling, 2016) and Ogbn-arxiv (Hu et al., 2020), and two inductive datasets, i.e., Flickr (Zeng et al., 2020) and Reddit (Hamilton et al., 2017). We use the public splits for all the datasets. For the inductive setting, we follow the setup in (Hamilton et al., 2017) where the test graph is not available during training. Dataset statistics are shown in Appendix A.
Baselines. We compare our proposed methods to five baselines: (i) one graph coarsening method (Loukas, 2019; Huang et al., 2021), (ii-iv) three coreset methods (Random, Herding (Welling, 2009) and K-Center (Farahani & Hekmatfar, 2009; Sener & Savarese, 2017)), and (v) dataset condensation (DC). For the graph coarsening method, we adopt the variation neighborhoods method implemented by Huang et al. (2021). For coreset methods, we first use them to select nodes from the original dataset and induce a subgraph from the selected nodes to serve as the reduced graph. In Random, the nodes are randomly selected. The Herding method, which is often used in continual learning (Rebuffi et al., 2017; Castro et al., 2018), picks samples that are closest to the cluster center. K-Center selects the center samples to minimize the largest distance between a sample and its nearest center. We use the implementations provided by Zhao et al. (2021) for Herding, K-Center and DC. As vanilla DC cannot leverage any structure information, we develop a variant named DC-Graph, which additionally leverages graph structure during test stage, to replace DC for the following experiments. A comparison between DC, DC-Graph, GCOND and GCOND-X is shown in Table 1 and their training details can be found in Appendix A.3.
Evaluation. We first use the aforementioned baselines to obtain condensed graphs and then evaluate them on GNNs for both transductive and inductive node classification tasks. For transductive datasets, we condense the full graph with N nodes into a synthetic graph with rN (0 < r < 1) nodes, where r is the ratio of synthetic nodes to original nodes. For inductive datasets, we only condense the training graph since the rest of the full graph is not available during training. The choices of r2 are listed in Table 2. For each r, we generate 5 condensed graphs with different seeds. To evaluate the effectiveness of condensed graphs, we have two stages: (1) a training stage, where we train a GNN model on the condensed graph, and (2) a test stage, where the trained GNN uses the test graph (or full graph in transductive setting) to infer the labels for test nodes. The resulting test performance is compared with that obtained when training on original datasets. All experiments are repeated 10 times, and we report average performance and variance.
Hyperparameter settings. As our goal is to generate highly informative synthetic graphs which can benefit GNNs, we choose one representative model, GCN (Kipf & Welling, 2016), for performance evaluation. For the GNN used in condensation, i.e., the GNNθ(·) in Eq. (8), we adopt SGC (Wu et al., 2019a) which removes the ReLU activation from GCN. In our gradient matching problem, SGC enjoys the advantage of being twice-differentiable while sharing similar graph filtering behavior as GCN. Unless otherwise stated, we use 2-layer models with 256 hidden units. The weight decay and dropout for the models are set to 0 in condensation process. More details for hyper-parameter tuning can be found in Appendix A.

heading: 4.2 COMPARISON WITH BASELINES
text: In this subsection, we test the performance of a 2-layer GCN on the condensed graphs, and compare the proposed GCOND and GCOND-X with baselines. Notably, all methods produce both structure and node features, i.e. A′ and X′, except DC-Graph and GCOND-X. Since DC-Graph and GCONDX do not produce any structure, we simply use an identity matrix as the adjacency matrix when training GNNs solely on condensed features. However, during inference, we use the full graph (transductive setting) or test graph (inductive setting) to propagate information based on the trained GNNs. This training paradigm is similar to the C&S model (Huang et al., 2020) which trains an MLP without the graph information and performs label propagation based on MLP predictions. Table 2 reports node classification performance; we make the following observations:
Obs 1. Condensation methods achieve promising performance even with extremely large reduction rates. Condensation methods, i.e., GCOND, GCOND-X and DC-Graph, outperform coreset methods and graph coarsening significantly at the lowest ratio r for each dataset. This shows the
2We determine r based on original graph size and labeling rate – see Appendix A for details.
importance of learning synthetic data using the guidance from downstream tasks. Notably, GCOND achieves 79.8%, 80.1% and 79.3% at 1.3%, 2.6% and 5.2% condensation ratios at Cora, while the whole dataset performance is 81.2%. The GCOND variants also show promising performance on Cora, Flickr and Reddit at all coarsening ratios. Although the gap between whole-dataset Ogbn-arxiv and our methods is larger, they still outperform baselines by a large margin.
Obs 2. Learning X′ instead of (A′,X′) as the condensed graph can also lead to good results. GCOND-X achieves close performance to GCOND on 11 of 15 cases. Since our objective in graph condensation is to achieve parameter matching through gradient matching, training a GNN on the learned features X′ with identity adjacency matrix is also able to mimic the training trajectory of GNN parameters. One reason could be that X′ has already encoded node features and structural information of the original graph during the condensation process. However, there are many scenarios where the graph structure is essential such as the generalization to other GNN architectures (e.g., GAT) and visualizing the patterns in the data. We will provide more details in the following subsections.
Obs 3. Condensing node features and structural information simultaneously can lead to better performance. In most cases, GCOND and GCOND-X obtain much better performance than DCGraph. One key reason is that GCOND and GCOND-X can take advantage of both node features and structural information in the condensation process. We notice that DC-Graph achieves a highly comparable result (90.5%) on Reddit at 0.2% condensation ratio to the whole dataset performance (93.9%). This may indicate that the original training graph structure might not be useful. To verify this assumption, we train a GCN on the original Reddit dataset without using graph structure (i.e., setting Atrain = I), but allow using the test graph structure for inference using the trained model. The obtained performance is 92.5%, which is very close to the original performance 93.9%, indicating that training without graph structure can still achieve comparable performance. We also note that learning X′,A′ simultaneously creates opportunities to absorb information from graph structure
directly into learned features, lessening reliance on distilling graph properties reliably while still achieving good generalization performance from features.
Obs 4. Larger condensed graph size does not strictly indicate better performance. Although larger condensed graph sizes allow for more parameters which can potentially encapsulate more information from original graph, it simultaneously becomes harder to optimize due to the increased model complexity. We observe that once the condensation ratio reaches a certain threshold, the performance becomes stable. However, the performance of coreset methods and graph coarsening is much more sensitive to the reduction ratio. Coreset methods only select existing samples while graph coarsening groups existing nodes into super nodes. When the reduction ratio is too low, it becomes extremely difficult to select informative nodes or form representative super nodes by grouping.

heading: 4.3 GENERALIZABILITY OF CONDENSED GRAPHS
text: Next, we illustrate the generalizability of condensed graphs from the following two perspectives: (1) the graphs that are condensed based on one specific GNN can be used to train other GNNs; and (2) graphs can be condensed using different GNNs and they all show reasonable transfer performance.
Different Architectures. Next, we show the generalizability of the graph condensation procedure. Specifically, we show test performance when using a graph condensed by one GNN model to train different GNN architectures. Specifically, we choose APPNP (Klicpera et al., 2018), GCN, SGC (Wu et al., 2019a), GraphSAGE (Hamilton et al., 2017), Cheby (Defferrard et al., 2016) and GAT (Veličković et al., 2018). We also include MLP and report the results in Table 3. From the table, we find that the condensed graphs generated by GCOND show good generalization on different architectures. We may attribute such transferability across different architectures to similar filtering behaviors of those GNN models, which have been studied in Ma et al. (2020); Zhu et al. (2021).
Versatility of GCOND. The proposed GCOND is highly composable in that we can adopt various GNNs inside the condensation network. We investigate the performances of various GNNs when using different GNN models in the condensation process, i.e., GNNθ(·) in Eq. (8). We choose APPNP, Cheby, GCN, GraphSAGE and SGC to serve as the models used in condensation and evaluation. Note that we omit GAT due to its deterioration under large neighborhood sizes (Ma et al., 2021). We choose Cora and Ogbn-arxiv to report the performance in Table 4 where C and T denote condensation and test models, respectively. The graphs condensed by different GNNs all show strong transfer performance on other architectures.

heading: 4.4 ANALYSIS ON CONDENSED DATA
text: Statistics of Condensed Graphs. In Table 5, we compare several properties between condensed graphs and original graphs. Note that a widely used homophily measure is defined in (Zhu et al., 2020) but it does not apply to weighted graphs. Hence, when computing homophily, we binarize the
graphs by removing edges whose weights are smaller than 0.5. We make the following observations. First, while achieving similar performance for downstream tasks, the condensed graphs contain fewer nodes and take much less storage. Second, the condensed graphs are less sparse than their larger counterparts. Since the condensed graph is on extremely small scale, there would be almost no connections between nodes if the condensed graph maintains the original sparsity. Third, for Citeseer, Cora and Flickr, the homophily information are well preserved in the condensed graphs.
Visualization. We present the visualization results for all datasets in Figure 4, where nodes with the same color are from the same class. Notably, as the learned condensed graphs are weighted graphs, we use black lines to denote the edges with weights larger than 0.5 and gray lines to denote the edges with weights smaller than 0.5. From Figure 4, we can observe some patterns in the condensed graphs, e.g., the homophily patterns on Cora and Citeseer are well preserved. Interestingly, the learned graph for Reddit is very close to a star graph where almost all the nodes only have connections with very few center nodes. Such a structure can be meaningless for GNNs because almost all the nodes receive the information from their neighbors. In this case, the learned features X′ play a major role in training GNN parameters, indicating that the original training graph of Reddit is not very informative, aligning with our observations in Section 4.2.

heading: 5 CONCLUSION
text: The prevalence of large-scale graphs poses great challenges in training graph neural networks. Thus, we study a novel problem of graph condensation which targets at condensing a large-real graph into a small-synthetic one while maintaining the performances of GNNs. Through our proposed framework, we are able to significantly reduce the graph size while approximating the original performance. The condensed graphs take much less space of storage and can be used to efficiently train various GNN architectures. In the future, we plan to investigate interpretable graph condensation and graph condensation for graph-level applications.

heading: A DATASETS AND HYPER-PARAMETERS

heading: A.1 DATASETS
text: We evaluate the proposed framework on three transductive datasets, i.e., Cora, Citeseer (Kipf & Welling, 2016) and Ogbn-arxiv (Hu et al., 2020), and two inductive datasets, i.e., Flickr (Zeng et al., 2020) and Reddit (Hamilton et al., 2017). Since all the datasets have public splits, we download them from PyTorch Geometric (Fey & Lenssen, 2019) and use those splits throughout the experiments. Dataset statistics are shown in Table 6.

heading: A.2 HYPER-PARAMETER SETTING
text: Condensation Process. For DC, we tune the number of hidden layers in a range of {1, 2, 3} and fix the number of hidden units to 256. We further tune the number of epochs for training DC in a range of {100, 200, 400}. For GCOND, without specific mention, we adopt a 2-layer SGC (Wu et al., 2019a) with 256 hidden units as the GNN used for gradient matching. The function gΦ that models the relationship between A′ and X′ is implemented as a multi-layer perceptron (MLP). Specifically, we adopt a 3-layer MLP with 128 hidden units for small graphs (Cora and Citeseer) and 256 hidden units for large graphs (Flickr, Reddit and Ogbn-arxiv). We tune the training epoch for GCOND in a range of {400, 600, 1000}. For GCOND-X, we tune the number of hidden layers in a range of {1, 2, 3} and fix the number of hidden units to 256. We further tune the number of epochs for training GCOND-X in a range of {100, 200, 400}. We tune the learning rate for all the methods in a range of {0.1, 0.01, 0.001, 0.0001}. Furthermore, we set δ to be 0.05, 0.05, 0.01, 0.01, 0.01 for Citeseer, Cora, Ogbn-arxiv, Flickr and Reddit, respectively.
For the choices of condensation ratio r, we divide the discussion into two parts. The first part is about transductive datasets. For Cora and Citeseer, since their labeling rates are very small (5.2% and 3.6%, respectively), we choose r to be {25%, 50%, 100%} of the labeling rate. Thus, we finally choose {1.3%, 2.6%, 5.2%} for Cora and {0.9%, 1.8%, 3.6%} for Citeseer. For Ogbn-arxiv, we choose r to be {0.1%, 0.5%, 1%} of its labeling rate (53%), thus being {0.05%, 0.25%, 0.5%}. The second part is about inductive datasets. As the nodes in the training graphs are all labeled in inductive datasets, we simply choose {0.1%, 0.5%, 0.1%} for Flickr and 0.05%, 0.1%, 0.2% for Reddit. Evaluation Process. During the evaluation process, we set dropout rate to be 0 and weight decay to be 0.0005 when training various GNNs. The number of epochs is set to 3000 for GAT while it is set to 600 for other models. The initial learning rate is set to 0.01.
Settings for Table 3 and Table 4. In both condensation stage and evaluation stage, we set the depth of GNNs to 2. During condensation stage, we set weight decay to 0, dropout to 0 and training epochs to 1000. During evaluation stage, we set weight decay to 0.0005, dropout to 0 and training epochs to 600.

heading: A.3 TRAINING DETAILS OF DC-GRAPH, GCOND-X AND GCOND
text: DC-Graph: During the condensation stage, DC-Graph only leverages the node features to produce condensed node features X′. During the training stage of evaluation, DC-Graph takes the condensed features X′ together with an identity matrix as the graph structure to train a GNN. In the later test stage of evaluation, the GNN takes both test node features and test graph structure as input to make predictions for test nodes.
GCOND-X: During the condensation stage, GCOND-X leverages both the graph structure and node features to produce condensed node features X′. During the training stage of evaluation, GCOND-X takes the condensed features X′ together with an identity matrix as the graph structure to train a GNN. In the later test stage of evaluation, the GNN takes both test node features and test graph structure as input to make predictions for test nodes.
GCOND: During the condensation stage, GCOND leverages both the graph structure and node features to produce condensed graph data (A′,X′). During the training stage of evaluation, GCOND takes the condensed data (A′,X′) to train a GNN. In the later test stage of evaluation, the GNN takes both test node features and test graph structure as input to make predictions for test nodes.

heading: B MORE EXPERIMENTS

heading: B.1 ABLATION STUDY
text: Different Parameterization. We study the effect of different parameterizations for modeling A′ and compare GCOND with modeling A′ as free parameters in Table 7. From the table, we observe a significant improvement by taking into account the relationship between A′ and X′. This suggests that directly modeling the structure as a function of features can ease the optimization and lead to better condensed graph data.
Joint optimization versus alternate optimization. We perform the ablation study on joint optimization and alternate optimization when updating Φ and X′. The results are shown in Table 8. From the table, we can observe that joint optimization always gives worse performance and the standard deviation is much higher than alternate optimization.

heading: B.2 NEURAL ARCHITECTURE SEARCH
text: We focus on APPNP instead of GCN since the architecture of APPNP involves more hyperparameters regarding its architecture setup. The detailed search space is shown as follows:
(a) Number of propagation K: we search the number of propagation K in the range of {2, 4, 6, 8, 10}. (b) Residual coefficient α: for the residual coefficient in APPNP, we search it in the range of {0.1, 0.2}. (c) Hidden dimension: We collect the set of dimensions that are widely adopted by existing work as the candidates, i.e., {16,32,64,128,256,512}. (d) Activation function: The set of available activation functions is listed as follows: {Sigmoid, Tanh, ReLU, Linear, Softplus, LeakyReLU, ReLU6, ELU}
In total, for each dataset we search 480 architectures of APPNP and we perform the search process on Cora, Citeseer and Ogbn-arxiv. Specifically, we train each architecture on the reduced graph for epochs on as the model converges faster on the smaller graph. We use the best validation accuracy to choose the final architecture. We report (1) the Pearson correlation between validation accuracies obtained by architectures trained on condensed graphs and those trained on original graphs, and (2) the average test accuracy of the searched architecture over 20 runs.

heading: B.3 TIME COMPLEXITY AND RUNNING TIME
text: Time Complexity. We start from analyzing the time complexity of calculating gradient matching loss, i.e., line 8 to line 11 in Algorithm 1. Let the number of MLP layers in gΦ be L and r be the number of sampled neighbors per node. For simplicity, we assume all the hidden units are d for all layers and we use L-layer GCN for the analysis. The forward process of gΦ has a complexity of O(N ′ 2 d2). The forward process of GCN on the original graph has a complexity of O(rLNd2) and that on condensed graph has a complexity of O(LN ′2d+LN ′d). The complexity of calculating the second-order derivatives in backward propagation has an additional factor of O(|θt|2), which can be reduced to O(|θt|) with approximated Hessian-vector products. Although there are C iterations in line 7-11, we note that the process is easily parallelizable. Furthermore, the process of updating θt in line 16 has a complexity of τθ(LN ′2d + LN ′d). Considering there are T iterations and K different initializations, we multiply the aforementioned complexity by KT . To sum up, we can see that the time complexity linearly increases with number of nodes in the original graph.
Running Time. We now report the running time of the proposed GCOND for different condensation rates. Specifically, we vary the condensation rates in the range of {0.1%, 0.5%, 1%} on Ogbn-arxiv and {1%, 5%, 10%} on Cora. The running time of 50 epochs on one single A100-SXM4 GPU is reported in Table 10.

heading: B.4 SPARSIFICATION
text: In this subsection, we investigate the effect of threshold δ on the test accuracy and sparsity. In detail, we vary the values of the threshold δ used for truncating adjacency matrix in a range of {0.01, 0.05, 0.1, 0.2, 0.4, 0.6, 0.8}, and report the corresponding test accuracy and sparsity in Figure 3. From the figure, we can see that increasing δ can effectively increase the sparsity of the obtained adjacency matrix without affecting the performance too much.

heading: B.5 DIFFERENT DEPTH AND HIDDEN UNITS.
text: Depth Versus Hidden Units. We vary the number of model layers (GCN) in a range of {1, 2, 3, 4} and the number of hidden units in a range of {16, 32, 64, 128, 256}, and test them on the condensed graphs of Cora and Citeseer. The results are reported in Table 11. From the table, we can observe that changing the number of layers impacts the model performance a lot while changing the number of units does not.
Propagation Versus Transformation. We further study the effect of propagation and transformation on the condensed graph. We use Cora as an example and use SGC as the test model due to its decoupled architecture. Specifically, we vary both the propagation layers and transformation layers of SGC in the range of {1, 2, 3, 4, 5}, and report the performance in Table 13. As can be seen, the condensed graph still achieves good performance with 3 and 4 layers of propagation. Although the condensed graph is generated under 2-layer SGC, it is able to generalize to 3-layer and 4-layer SGC. When increasing the propagation to 5, the performance degrades a lot which could be the cause of the oversmoothing issue. On the other hand, stacking more transformation layers can first help boost the performance but then hurt. Given the small scale of the graph, SGC suffers the overfitting issue in this case.
Cross-depth Performance. We show the cross-depth performance in Table 12. Specifically, we use SGC of different depth in the condensation to generate condensed graphs and then use them to test on SGC of different depth. Note that in this table, we set weight decay to 0 and dropout to 0.5. We can observe that usgin a deeper GNN is not always helpful. Stacking more layers do not necessarily
mean we can learn better condensed graphs since more nodes are involved during the optimization, and this makes optimization more difficult.

heading: B.6 PERFORMANCES ON ORIGINAL GRAPHS
text: We show the performances of various GNNs on original graphs in Table 14 to serve as references.

heading: B.7 EXPERIMENTS ON PUBMED.
text: We also show the experiments for Pubmed with condensation ratio of 0.3% in Table 15. From the table, we can observe that GCOND approximates the original performance very well (77.92 vs. 79.32 on GCN). It also generalizes well to different architectures and outperforms GCOND-X and DC-Graph, indicating that it is important to leverage the graph structure information and learn a condensed structure.
B.8 VISUALIZATION OF NODE FEATURES.
In addition, we provide the t-SNE (Van der Maaten & Hinton, 2008) plots of condensed node features to further understand the condensed graphs. In Cora and Citeseer, the condensed node features are well clustered. For Ogbn-arxiv and Reddit, we also observe some clustered pattern for the nodes within the same class. In contrast, the condensed features are less discriminative in Flickr, which indicates that the condensed structure information can be essential in training GNN.

heading: C ALGORITHM
text: We show the detailed algorithm of GCOND in Algorithm 1. In detail, we first set the condensed label set Y′ to fixed values and initialize X′ as node features randomly selected from each class. In each outer loop, we sample a GNN model initialization θ from a distribution Pθ. Then, for each class we sample the corresponding node batches from T and S, and calculate the gradient matching
loss within each class. The sum of losses from different classes are used to update X′ or Φ. After that we update the GNN parameters for τθ epochs. When finishing the updating of condensed graph parameters, we use A′ = ReLU(gΦ(X′)− δ) to obtain the final sparsified graph structure.
Algorithm 1: GCOND for Graph Condensation 1 Input: Training data T = (A,X,Y), pre-defined condensed labels Y′ 2 Initialize X′ as node features randomly selected from each class 3 for k = 0, . . . ,K − 1 do 4 Initialize θ0 ∼ Pθ0 5 for t = 0, . . . , T − 1 do 6 D′ = 0 7 for c = 0, . . . , C − 1 do 8 Compute A′ = gΦ(X′); then S = {A′,X′,Y′} 9 Sample (Ac,Xc,Yc) ∼ T and (A′c,X′c,Y′c) ∼ S B detailed in Section 3.1
10 Compute LT = L (GNNθt(Ac,Xc),Yc) and LS = L (GNNθt(A′c,X′c),Y′c) 11 D′ ← D′ +D(∇θtLT ,∇θtLS) 12 if t%(τ1 + τ2) < τ1 then 13 Update X′ ← X′ − η1∇X′D′
14 else 15 Update Φ← Φ− η2∇ΦD′
16 Update θt+1 ← optθ(θt,S, τθ) B τθ is the number of steps for updating θ
17 A′ = ReLU(gΦ(X′)− δ) 18 Return: (A′,X′,Y′)

heading: D MORE RELATED WORK
text: Graph pooling. Graph pooling (Zhang et al., 2018; Ying et al., 2018b; Gao & Ji, 2019) also generates a coarsened graph with smaller size. Zhang et al. (2018) is one the first to propose an end-to-end architecture for graph classification by incorporating graph pooling. Later, DiffPool (Ying et al., 2018b) proposes to use GNNs to parameterize the process of node grouping. However, those methods are majorly tailored for the graph classification task and the coarsened graphs are a byproduct graph during the representation learning process.

Review summaries:
The paper proposes and addresses the problem of graph condensation. In a nutshell, provided a large graph G, the scope of the paper is to propose a solution able to generate a smaller synthetic graph G’, which effectively allows to train Graph Neural Networks (GNNs) able to achieve similar performance as if they were trained on G. In order to do that, the authors propose to match the gradients produced by a specific GNN on mini-batches extracted from G and G’. This avoids the need of constructing a minimization problem based on an outer and inner training loop which would be computationally heavy to handle. The node-wise features X’ of the smaller graph G’ are considered as free parameters in the optimization process and the adjacency matrix A’ is instead inferred from X’ via a learnable MLP which is trained alongside X’ with an alternating optimization schema. The authors evaluate the quality of their approach on the Cora, Citeseer, OGBN-Arxiv and Reddit datasets, condensing and evaluating the new graphs with a variety of different architectures. 

To alleviate the storage and time consumption for training GNN models on large graphs, the paper studies graph condensation, which draws inspirations from data distillation/condensation. It first constructs a much smaller synthetic graph, and then train GNN models on this small graph. Empirical results show that, graph condensation can reduce the size of the graph by 99% but still achieves comparable accuracy.

This paper introduces GCond, a graph condensation framework designed to compress graph datasets and reduce storage and time requirements while training GNNs on large-scale graphs. GCond makes use of gradient matching and graph sampling to reduce the graph size. Experiments demonstrate that GCond can maintain a high degree of accuracy while significantly lowering the size of the graph.