A Variational Edge Partition Model for Supervised Graph Representation Learning
Abstract
Graph neural networks (GNNs), which propagate the node features through the edges and learn how to transform the aggregated features under label supervision, have achieved great success in supervised feature extraction for both node-level and graph-level classification tasks.
However, GNNs typically treat the graph structure as given and ignore how the edges are formed.
This paper introduces a graph generative process to model how the observed edges are generated by aggregating the node interactions over a set of overlapping node communities, each of which contributes to the edges via a logical OR mechanism.
Based on this generative model, we partition each edge into the summation of multiple community-specific weighted edges and use them to define community-specific GNNs.
A variational inference framework is proposed to jointly learn a GNN-based inference network that partitions the edges into different communities, these community-specific
GNNs, and a GNN-based predictor that combines community-specific GNNs for the end classification task.
Extensive evaluations on real-world graph datasets have verified the effectiveness of the proposed method in learning discriminative representations for both node-level and graph-level classification tasks.
Introduction
Many real-world entities are bonded by relations, e.g. , the users in a social network service are connected by online friendships and the atoms in molecules are held together by chemical bonds.
Representing the entities by nodes and relations by edges, a set of interconnected entities naturally forms a graph.
Reasoning about these entities and their relations could be conducted under graph neural networks (GNNs)
Instead of isolating the feature transformation for each individual entity, GNNs allow the information to be exchanged between related entities.
Models employing this strategy have achieved great success in a wide range of applications involving graph structured data, such as classification [5, 6], link prediction [7], recommendation [8, 9], (overlapping) community detection [10, 11], and drug discovery [12].
The essence of many graph-analytic tasks could be summarized as supervised graph representation learning, where the information on the graph is usually characterized by the node features, adjacency matrix, and node or graph labels.
A supervised machine learning pipeline is often introduced to embed the nodes or graph under label supervision for a specific classification task.
For most of the
GNN-based methods, the information on nodes and edges are composited through neighborhood aggregation, i.e. , updating the features of each node by combining the features of the surrounding nodes.
During this process, the graph structure mostly serves as a given source to indicate the nodes’ neighborship [13] or provide the weights for aggregation [5].
Treating the graph structure as given overlooks the latent structures that control the formation of the graph, which, however, could provide valuable information for graph representation learning.
In other words, failing to consider the latent graph structures may limit the ultimate potential of this line of work.
One type of latent structure at the hinge of the graph structure and node information is node communities.
Their connection to the graph can be explained under a latent-community based graph generation process.
For example, both the mixed-membership stochastic blockmodel (MMSB) [14] and edge partition model (EPM) [15] explain the formation of edges by node interactions over overlapping latent communities.
Let us consider person u in social network G , some of her social connections may be established through interactions with colleagues as a machine learning researcher, some may originate from her interactions with co-members of the same hobby club, and different types of interactions could overlap to strengthen certain social connections between the nodes.
The node community structure also sets the aspects of node information.
In the example of social network G where person u is affiliated with both a research group and a few hobby groups, due to the diverse nature of these different communities, it is likely that she exhibits different characteristics when interacting with co-members of different communities.
Namely, the information on u for the research group may be related to her research expertise, and the information on u for the hobby clubs may be related to her hobbies.
Therefore, an ideal solution is to learn a different aspect of node properties for each community that it is affiliated with, and represent the overall node information as an aggregation of all community-specific node properties.
Based on this insight, we develop a variational edge partition model (VEPM), which is a generative graph representation learning framework.
VEPM models how the edges and labels are generated from overlapping latent communities.
Instead of hard assigning a node to a single community, VEPM encodes each node into a K -dimensional vector of scores measuring the strength that the node is affiliated with each of the K communities.
From these scores, we compute the intensities of pairwise interactions within each community.
Given that information, under the Bernoulli-Poisson link, the edges could be modeled by the logical OR of independently generated binary latent edges [15].
The generation of labels includes community-specific node representation learning and aggregation.
A key premise of the first part is to detect the hidden structure specified for each community.
In our model, it is achieved through edge partition, i.e. , decomposing each edge into a summation of link strengths according to the intensities of community-specific interactions.
The edge partition step isolates the link strengths accumulated through each community.
With the partitioned edges, we learn
K separate GNNs to produce community-specific node representations, then compose them into the overall node embeddings to generate the labels.
Evaluation shows that the proposed framework can achieve significant performance enhancement on various node and graph classification benchmarks.
We summarize our main contributions as follows:
• We introduce VEPM that utilizes the idea of edge partitioning to extract overlapping latent community structures, which are used to not only enrich node attributes with nodecommunity affiliation scores, but also define community-specific node feature aggregations.
• We formalize the training of VEPM in a variational inference framework, which is powered by GNNs in its latent community inference, representation generation, and label prediction.
• We analyze how VEPM works and evaluate it over various real-world network datasets.
Empirical results show that the proposed VEPM outperforms many previous methods in various node- and graph-level classification tasks, especially with limited labels.
Preliminaries and Related Work
Embedding nodes and graphs with GNNs.
Given a node-attributed graph G with N nodes, its information is generally expressed by a design matrix X ∈ R N × F , whose rows represent node features of dimension F , and an adjacency matrix A of shape N × N .
The nonzero values of A indicate the weights on the corresponding edges.
GNNs [1–5, 13, 16] are multi-layer parametric models that maps ( X , A ) to the embedding space.
The update of the embedding of node u at the t th GNN layer could be summarized as h ( t ) u
= AGG( f θ ( h ( t − 1) u ) , { f θ ( h ( t − 1) v ) } v ∈ N ( u ) , A u, : ) and h (0) u
= x u .
Here AGG denotes the neighborhood aggregation function, N ( u ) denotes the neighbors of u , and f θ ( · ) is a transformation function parameterized with θ .
In VEPM, we adopt the aggregation function introduced by Kipf and Welling [5], which can be expressed as h ( t ) u
= (cid:80) v ∈{ u }∪ N ( u ) ˜A u,v f θ
( h ( t − 1) v ) , where ˜ A is the normalized adjacency matrix of G augmented with self-loops.
When the task requires a graph-level representation, all node embeddings would be summarized into a single embedding vector.
This process is called graph pooling [17–19].
In this work, we focus on improving the overall performance from GNN’s perspective and adopt a simple graph pooling method proposed by Xu et al.
In the sequel, we unify the expression of models consisting of GNN layers as GNN θ (cid:0) X , A (cid:1) .
Community-regularized representation learning.
Communities are latent groups of nodes in a graph [20].
The simplest way to use community information to help a supervised learning task is to regularize it with a community-detection related task.
For instance, Hasanzadeh et al.
[21] and
Wang et al.
[22] jointly train a deep stochastic blockmodel and a classification model; a similar approach could be found in Liu et al.
[23] where the graph reconstruction regularizer is replaced by a modularity metric.
Either way, the node embeddings are expected to reflect patterns of community structures and maintain informative to the task at the same time.
These methods generally treat node-community affiliation as node embeddings and expect them to contain sufficient information for the downstream task.
However, the affiliation strengths of nodes to a community may oversimplify the information that such a community can provide for the downstream task.
Unlike these methods,
VEPM embeds node information on each community with a specific GNN, where the community structures are reflected by the partitioned adjacency matrices.
Aggregating node features with these weighted adjacency matrices naturally incorporates community information into task-learning.
Multi-relational data analysis.
Leveraging heterogeneous relations has been extensively studied in the literature of mining Knowledge Graphs [24–26].
The data of these models is usually organized by a multigraph, which is related to our perspective of the latent node interactions that generate the observed graph because the interactions in different communities are potentially heterogeneous, and they are permitted to coexist between a pair of nodes.
This leads to a shared high-level idea to break down the original heterogeneous graph into homogeneous factors and analyze each factor with a customized model.
However, unlike those multigraphs where the edge types are explicitly annotated, the overlapping heterogeneous node interactions are not observable from the data that VEPM aims to handle, escalating the difficulty of our optimization problem.
To deal with the latent variables, we formalize VEPM into a generative model and train it via variational inference.
Graph factorization-based models.
The existence of multiple hidden structures in graphs is also noticed by some previous work [27, 28].
The architecture of these models starts with graph factorization, followed by a set of modules with each one processing the information from one of the graph factors.
In these methods, the only ground-truth information that trains graph factorization is from label supervision, making them rely on excessive label annotations, which might be hard to suffice in practice and thus potentially hinder their application.
On account of the potential heterogeneity of graph information on different communities, VEPM adopts a similar pipeline to these methods, but the factorization of the original graph is driven by not only the supervised task but also a graph generative model, which greatly reduces our dependency on the amount of labeled data.
Variational Edge Partition Model
Many analytical tasks on node-attributed graphs could boil down to (semi-) supervised classification problems, i.e. , given ( X , A ) and observed node or graph labels y o , predicting the unobserved labels y u .
In VEPM, we formalize the classification task as modeling the predictive distribution as p ( y u | X , A , y o ) , and construct our variational supervised learning pipeline with GNNs.
3.1 Generative task-dependent graph representation learning with latent communities
To model p ( y u | X , A , y o ) , we introduce Z ∈ R N × K + , a latent non-negative node-community affiliation matrix, whose entry at the n th row and k th column is interpreted as the strength that the n th node is affiliated with the k th community.
Given Z , we specify a generative network as
[Equation]
to describe how the observed edges A and labels y o are generated.
Due to the complexity brought by the deep architecture of the generative network , analytically inferring the posterior of Z is impractical.
T X
A ( 1 ) A (
2 ) A ( 3 ) A ( 3 ) T H
Output ( 2 ) T H ( 1 ) T H
T X
A community encoder edge partitioner community-GNN bank representation composer
The Inference Network
The Generative Network
T K
T 
K L egen t a s k GNNGNN GNNGNN GNNGNN
GNNGNN
GNNGNN
T Z T Z We hence approximate the posterior p θ ( Z | A , y o ) with a variational distribution, q ϕ ( Z | A , X ) , modeled by a separate GNN-based inference network . The subscripts θ and ϕ denote the parameters in the generative network and inference network , respectively.
We illustrate the architecture of VEPM in Figure 1.
We approximate the posterior predictive distribution using the Monte Carlo method as
[Equation]
where Z ( s ) iid ∼ q ϕ ( Z | A , X ) for s = 1 , . . .
, S .
In what follows, we outline the data generation process and corresponding modules in the generative network , introduce the module in the inference network , and describe how to train both networks.
3.2 Edge generation and label prediction
To model the distribution of the edges given Z , we adopt the generative process developed in
EPM [15], which explains the generation of the edges under the Bernoulli-Poisson link as A i,j = 1 M i,j ≥ 1 , M i,j ∼ Poisson (cid:16)(cid:80)
Kk =1 γ k Z i,k Z j,k (cid:17) .
Here γ k is a positive community activation level indicator, which measures the member interaction frequency via community k , and in our practice is treated as a trainable parameter shared by both the inference network and generative network .
We interpret γ k Z i,k Z j,k as the interaction rate between nodes i and j via community k .
The EPM has an alternative representation that partitions each edge into the logical disjunction ( i.e. , logical OR) of K latent binary edges, expressed as
[Equation]
where p ijk := 1 − e − γ k Z i,k Z j,k .
Thus nodes i and j would be connected as long as their interaction forms up an edge in at least one community.
In other words, they are disconnected only if their interactions in all communities fail to generate any edges.
Under the EPM, we have the conditional probability as p θ (A i,j = 1 | Z ) = 1 − e − (cid:80)
Kk =1 γ k Z i,k Z j,k .
To complete the model, we set the prior distribution of the node-community affiliation matrix as Z ∼ (cid:81) N i =1 (cid:81) K k =
Gamma(Z i,k ; α, β ) .
Given A and Z , we now describe the predictive process of the labels.
The node-community affiliation impacts this process from two aspects: for each node, the corresponding row of Z serves as side information that could enrich node attributes; for each pair of connected nodes, it could be used to derive the node interactions rate via each community, i.e. , { γ k Z i,k Z j,k } k =1 ,K , which are further used to partition the edges to K communities, carried out by the edge partitioner :
Edge partitioner.
The edge partitioner takes edges A and node-community affiliation matrix Z as inputs and returns K positive-weighted edges: { A (1) , A (2) , · · · , A ( K ) } , s . t .
(cid:80)
Kk =1 A ( k ) =
A .
The edge partition function is
[Equation]
where τ is a “temperature” that controls the sharpness of partition.
The effect of the edge partitioner could be considered as a soft assignment of each edge into different communities.
Setting temperature τ to be low could drive the soft assignment towards a hard assignment, and consequently, when aggregating node features with { A (1) , A (2) , · · · , A ( K ) } , the edge partitioner would concentrate the information exchange between any two connected nodes at one community.
In other words, the mutual influence between two nodes, measured by the edge weight, is relatively high at the community that contributes the most of the interactions between the pair, while being relatively weak at the other communities.
In our implementation, we further generalize Equation (3) to a metacommunity-based edge partition, specifically, by replacing γ k Z i,k Z j,k with Z i,k diag(
γ k ) Z ′ j,k .
In the new expression, Z i,k denotes the k th segment in node i ’s community-affiliation encoding, γ k is a vector of the activation levels for communities in the k th metacommunity.
This generalization allows the total number of communities to be greater than K , enhancing the model implementation flexibility at a minor interpretability cost.
The edge partitioner provides a soft separation of the neighborhood aggregation routes for each community, which is passed to the community-GNN bank :
Community-GNN bank.
The module takes X ∗ :
= X ∥ Z as input, where the operator ∥ denotes “concatenation,” and learns community-specific node embeddings with K separate GNNs, i.e., the outputs are g (1) θ ( X ∗ ) , g (2) θ ( X ∗ ) , · · · , g ( K ) θ ( X ∗ ) , where g ( k ) θ ( · ) :
=
GNN θ (cid:0) · , A ( k ) (cid:1) , k ∈ { 1 , . .
. , K } .
The intention of the edge partitioner and community-GNN bank is to capture the node information specific to each community.
For instance, in a social network, such kind of information could be the different social roles of people when considered affiliated with different social groups, e.g. , one may be a former computer science major student in an alumni group, a research scientist in a work group, and an amateur chess player in a hobby club group.
As shown in Section 4.3, the node embeddings produced by the community-GNN bank are separable by communities.
We finally introduce the representation composer , which embeds a combination of the information provided by each community into a global representation via a GNN:
Representation composer.
Let H ( k ) :
= g ( k ) θ ( X ∗ ) denote the node representations learned from the k th community, where k = 1 , . .
, K , and f ( · ) denote the representation composer, whose functionality is to project a composite of community-specific node representations to one representation matrix, i.e., H V =
f (cid:0) H (1) , H (2) , · · · , H ( K ) (cid:1) :
=
GNN θ (cid:0) ∥
Kk =1 H ( k ) , A (cid:1) .
For graph-level tasks, we further pool node embeddings into a single vector representation h G , as in
Xu et al.
Taking softmax on the feature dimension of H V or h G gives the predicted probabilities of labels, from which we are able classify the unlabeled objects.
Cascading the edge partitioner and community-GNN bank with the representation composer yields the probability p θ ( y | X , A , Z ) .
3.3 Variational latent community inference
We use a community encoder as the module in the inference network to approximate the posterior distribution p θ ( Z | A , y ) , and provide the generative network with the critical latent variable Z :
Community encoder.
The community encoder models the variational posterior q ϕ ( Z | A , X ) by a Weibull distribution with shape K and scale Λ , whose parameters are learned by a GNN as
K ∥ Λ = GNN ϕ (cid:0) X , A (cid:1) .
A Weibull random sample from q ϕ ( Z | A , X ) could be created through the inverse CDF transformation of a uniform random variable, given as follows:
[Equation]
where ⊙ and ⊘ denote element-wise multiplication and division.
3.4 The overall training algorithm and complexity analysis
We train VEPM by optimizing the evidence lower bound (ELBO), decomposed into three terms, as
[Equation]
where L task =
E q ϕ ( Z | A , X ) log p θ ( y o | A , Z , X ) , L egen =
E q ϕ ( Z | A , X ) log p θ ( A | Z ) , and L KL = − D KL (cid:0) q ϕ ( Z | A , X ) ∥ p ( Z ) (cid:1) .
These three terms correspond to the classification task, edge generation, and KL-regularization, respectively.
Note that our specifications of Z ’s prior and variational posterior yield an analytical expression of L KL , as described in detail in Appendix B.
Recall that N , M , K denote the numbers of nodes, edges, and communities (or metacommunities) in the graph; F denotes the feature dimension; and L 1 , L 2 , L 3 denote the number of layers in the community encoder , in the community-GNN bank , and in the representation composer .
In VEPM, we limit the size of hidden dimension in each community-GNN to 1 / K of what is commonly used among the baselines, hence the time complexity of training VEPM is O (( L 1 + L 2 + L 3 ) MF +( L 1 + L 2 / K +
L 3 ) NF 2 + N 2 F ) . For a sparse graph where N 2 ≫ M , the computational overhead can be reduced to O ( M ) 3 if graph reconstruction is accelerated via subsampling the nodes to O ( √ M ) , as in Salha et al. Effects and implications of adopting such type of acceleration algorithms are discussed in
Appendix A. The space complexity of VEPM is O (( L 1 + L 2 + L 3 ) NF + KM + ( L 1 + L 2 / K + L 3 ) F 2 ) , among which O (( L 1 + L 2 / K + L 3 ) F 2 ) is contributed by model parameters.
It is noteworthy to point out that the memory cost of graph reconstruction is manageable by computing the dense matrix multiplication block-wise with a fixed maximum block size. From all aspects of complexity, VEPM (with acceleration) is comparable to GATs [13, 30] and models involving graph factorization [27, 28].
Empirical Evaluation 4.1 Node & graph classification
[Table]
Datasets & experimental settings.
For node classification, we consider three citation networks (Cora, Citeseer, and
Pubmed) and a Wikipedia-based online article network (WikiCS) [31], which provide either bag-of-words document representations or average word embeddings as node features, and (undirected) citations or hyperlinks as edges; For graph classification, we consider four bioinformatics datasets (MUTAG, PTC, NCI1, PROTEINS) and four social network datasets (IMDBBINARY, IMDB-MULTI, REDDIT-BINARY and REDDIT-MULTI).
The input node features are crafted in the same way as Xu et al.
Most of the baselines are compared following the 10-fold cross validation based evaluation protocol proposed by Xu et al.
For the graph classification task, we also evaluate our model following Zhang and Chen [32], which conducts a more rigorous train-validation-test protocol.
More details about the experiments are elaborated in Appendix C.2.
Node classification.
We use classification accuracy as the evaluation metric for node classification.
Table 1 reports the average performance of VEPM ( ± standard error) against related baselines that are categorized into three different groups.
The first group consists of the GCNs [5] and its variant GCN-64 that expands the hidden dimension from 16 to 64.
VEPM outperforms the first group by a significant margin.
The explanation is twofold: (i) VEPM augments the node attributes with community information carried by the inferred node-community affiliations, (ii) VEPM learns community-specific node embeddings.
The second group includes SIG-VAE [21] and WGCAE [22], both of which learn node embeddings from graph generative models jointly optimized with a supervised loss.
The performance gain that VEPM obtains could be attributed to our unique label predictive process, which not only appends extra community information to node attributes, but also injects structural patterns of communities into neighborhood aggregation.
The third group [13, 30, 27] is focused on learning node embeddings leveraging heterogeneous hidden relations.
When fitting the hidden relations via attention mechanism, they only use information from the node features through scale [Table] [Table] label supervision, whereas our approach also takes the observed graph structure into account via a graph generative model.
The additional information from the graph utilized by VEPM could explain the enhancement achieved by VEPM over the third group
[Table]
Graph classification.
For the first protocol, we compare VEPM with classical graph classification baselines [33–35], generic-GNN-based models [13, 30, 6] [Table] and GNNs with relation-based or taskdriven graph factorization [25, 26, 28].
Results in Table 2 show that VEPM achieves the best graph classification performance on 5 out of 8 benchmarks, and the second-best performance on the otherbenchmarks, including NCI1, where VEPM outperforms all the other GNN-based models.
For the second protocol, aside from a traditional method, WL [33], and a generic-GNN-based method,
DGCNN [36], we compare VEPM with two GNNs [37, 32] that adapt capsule neural networks [38] to graph-structured data, which aim to learn different aspects of graph properties via dynamic routing [39].
The results in Table 3 show that VEPM outperforms these GNN-based methods on most of the benchmarks.
This indicates that the aspects of graph information, as defined with communities and learned via aggregating node features with partitioned graphs, are more pertinent to the end tasks.
[Figure]
Classification with reduced labels.
The gain of incorporating the graph generation process into VEPM is that the observed graph structure also provides information for hidden community detection and edge partition, which is beneficial if the amount of labeled data is not sufficient for both decomposing the graph into hidden factors and semi-supervised task-learning.
To illustrate this point, based on the evaluation protocol by Kipf and Welling [5] for node classification and Xu et al.
[6] for graph classification, we re-evaluate the performance of VEPM under reduced training labels on Cora (for node classification) and MUTAG (for graph classification), along with generic-GNN-based methods [5, 13, 6] and decomposition-based methods [27, 28].
The results are shown in Figure 2: the performance of all models is negatively impacted by the reduction in training labels, those suffering from the strongest performance decline are DisenGCN [27] and FactorGCN [28] that decompose graphs solely based on label supervision, while VEPM also performs graph factorization with limited labels, it consistently outperforms the other methods under all settings, and the superiority becomes even more evident as the amount of annotated data further decreases.
We consider the enhanced robustness under sparsely labeled data as a crucial feature to have for real-world graphs.
4.2 Ablation Studies
Different edge partition schemes.
In this part, we study how much a meaningful edge partition would benefit the task. Except for the partition we obtained from training the regular VEPM, we tested the performance of VEPM under two edge partition schemes: even partition and random partition.
Even partition means all edges weights are 1 / K . For random partition, we sample the unnormalized edge weights from U(0 , 100) , then normalize them along the community dimension with softmax .
The random edge weights are fixed for training to simulate an undesirable convergence state of edge partition. The results are recorded in Table 4. Generally speaking, the performance of VEPM with even edge partition is comparable to that of GIN, our base model; when we substitute random partition for even partition, the model performance becomes worse than the base model.
These ablation study results suggest that VEPM can benefit from enhancing the quality of edge partitions.
[Table]
Different representation composer . Next, we use the partition obtained from a regular VEPM to represent partitions that are meaningful for the task, and a random partition to represent “meaningless partitions.” For each partition scheme, we contrast the performance of VEPM between two designs of the representation composer : (i) GNN-based design, represented by the current design; (ii) parsimonious design, represented by a fully-connected (FC) layer.
The results are in Table 5. When the edge partition is meaningful, i.e. , relevant to the task, the overall performance with a simpler representation composer is generally slightly worse than the current design, but still better than most of the baselines. However, if the partition is irrelevant to the task, the GNN-based representation composer would be the last thing standing between the model and a failed task, as the graph structure used for neighborhood aggregation is still informative to the task. So the current design would slightly benefit VEPM in a general case, and protects the performance of the model in the worst-case scenario.
[Table]
Different edge partitioning temperatures.
We use the same way as the previous study to get meaningful and random partitions. In this study, we focus on the effect of different selections of τ , the temperature parameter of softmax .
The value of τ controls the sharpness of the partitioned edge weights, i.e. , a small τ drives the partitied weights for the same edge towards a one-hot vector, whereas a large τ would eliminate the divergence among the edge weights and make the edge partition no more different from an even partition. The results of this experiment are recorded in Table 6, the upper half of which is obtained from a meaningful edge partition, and the lower half is obtained from a random edge partition.
We can induce from these results that when the basis to perform edge partition, namely, the inferred latent node interactions, are relevant to the task, a sharp edge partition that highlights the differences among the communities may be helpful for the task. Otherwise a smooth edge partition might be more favorable. [Table]
4.3 Qualitative analysis
Visualizing community structures.
To show that through partitioning the edges [Table] VEPM identifies each latent community from the original graph [Table]
in Figure
[Table]
we plot the adjacency matrices of a 200-node subgraph of Cora, before and after edge partition.
The subgraph is created via breadth-first search [40] node selection to ensure connectivity.
We sort the nodes sample S in order to present a clearer view of the community structures.
Specifically, we prepare K buckets; for node u , we compute the total interactions it engages under metacommunity k by µ u,k := (cid:80) v ∈ S Z u,k diag( γ k ) Z ′ v,k [Table] and assign it to bucket k ′ , where k ′
=
arg max k µ u,k .
We first sort the buckets by descending their counts [Figure] [Figure] of assigned nodes, then sort the nodes within bucket k, k ∈ { 1 , . .
, K } , by descending value of µ u,k .
The Z used for sorting is sampled at the end of training.
The community structures that VEPM detects could be found in Figure 3a as the blocks on the main diagonal.
The fact that most of the bright spots ( i [Figure] e. , edges) are located in these on-diagonal blocks reflects dense node connections internal to each community.
Sparsely distributed off-diagonal spots provide evidence of overlapping membership between the communities, which is also taken into account by our graph generative model.
Figures 3b to 3i show that the edge partitioner has done a sound job in separating latent communities.
Due to the limited size of the subgraph, some small metacommunities may not contain any large-weighted edges between the nodes in this subgraph, which accounts for the appeared emptiness in Figures 3h and 3i.
Such kind of artifact disappears when we replace the subgraph by the full graph of Cora, as visualized in Figures 6 to 14 in Appendix G.
[Figure] latent representations.
The previous visualization experiment verifies the following propositions: (i) the identified hidden structures are latent communities, and (ii) the partitioned graphs are different from each other.
We now study how they benefit representation learning.
Cora and
MUTAG are selected as the representatives for node and graph classification benchmarks.
For the
MUTAG dataset, we remove graphs that contain node categories with less than 5 instances (less than 10 from a totality of 188) and randomly sample 10 graphs for the visualization experiments.
We first visualize Z obtained at the end of the unsupervised pretrain stage (Figures 4a and 4b), where the node-community affiliation vectors are projected to 2-D space via t-SNE [41].
Proposition (i) ensures that the node information carried by Z is about communities.
We color code the scatters by node labels, both Figures 4a and 4b exhibit strong correlation between the spatial clusters and colors, which indicates that even without label supervision, the node information provided with Z has discriminative power on classifying nodes.
We then visualize the community-specific node emebddings obtained at the end of the supervised finetune stage (Figures 4c and 4d).
Similarly, t-SNE is adopted to reduce the dimensionality of obtained node embeddings.
This time we color code the scatters by the latent metacommunity they correspond to.
Both Figures 4c and 4d exhibit clear boundaries between the colored clusters, which shows that the model is able to extract different information from multiple communities, which enhances the overall expressiveness of learned node or graph representations and potentially leads to better model performance on the downstream tasks.
[Figure]
Task-relevant communities. We assess the relevance of the learned communities to the task from the an experiment on the Cora dataset.
In order to see the statistical dependency between communities and the task, we first hard-assign each node to the community of the highest affiliation strength, then we compute the normalized mutual information (NMI) between the hard-partitioned communities and node labels. NMI is a score between 0 and 1, with higher values indicating stronger statistical dependencies between two random variables. In the above experiment, we obtain an NMI of 0 .when
the communities are learned solely by the unsupervised pretrain , such value increases to 0 .after
the supervised finetune .
The results of this experiment show that the initial communities we obtained from the unsupervised pretrain are meaningful to the task, and the relevance between the inferred communities and the task would be enhanced by the supervised finetune .
Diverse community-specific information .
To see the effect of the information provided by different communities, we first train VEPM until convergence, then use the node representations learned by each community GNN to train an SVM and visualize the averaged 10-fold cross-validation results by a confusion matrix.
With the results shown in Figure 5, we can further conclude that most of the communities can provide task-related information, as we can observe from Figure 5 that the diagonal cells in most of the confusion matrices have darker shades than off-diagonal cells.
Beyond that, the information extracted from different communities is complementary to each other. For example, in the second column of Figure 5, information from the upper community can separate classes 3 andwell, but would mix classes 4 and 5; information from the lower community, on the other hand, can separate classes 4 and 5 but works worse on separating classes 3 and 4. The working mechanism of VEPM. In summary, the communities learned by VEPM have the following properties: (i) the communities are relevant to the task; (ii) the information provided be different communities are complementary, so the overall amount of information for the task is accumulated over communities.
Both properties are intuitively helpful for the downstream task.
Conclusion
Moving beyond treating the graph adjacency matrix as given, we develop variational edge partition models (VEPMs) to extract overlapping node communities and perform community-specific node feature aggregations.
Specifically, we first utilize a GNN-based inference network to obtain nodecommunity affiliation strengths, with which we augment node attributes, and partition the edges according to the intensities of node interactions with respect to each community.
We learn GNNbased node embeddings for each community by aggregating node features with the corresponding partitioned graph, and aggregate all community-specific node embeddings for the downstream tasks.
Extensive qualitative and quantitative experiments on both node-level and graph-level classification tasks are performed to illustrate the working mechanism and demonstrate the efficacy of VEPMs in supervised graph representation learning.
Acknowledgments
Y. He and M. Zhou acknowledge the support of NSF IIS 1812699 and 2212418, and the Texas
Advanced Computing Center (TACC) for providing HPC resources that have contributed to the research results reported within this paper.
Appendix A More Details on Training VEPM A.1 A pretrain-finetune scheme
Since modeling the likelihood of the labels involves stacking multiple modules embodied by deep neural networks, approximating the posterior p θ ( Z | A , y o ) is difficult from an optimization perspective.
To effectively train VEPM, we break down the overall training pipeline into two phases: an unsupervised pretrain , followed by a supervised finetune .
Specifically, we first pretrain the inference network by optimizing L egen + L KL to link latent communities with edge generation.
We then join the pretrained inference network up with the generative network , and train the entire architecture with the objective function given in Equation (5).
In this stage, the latent communities are finetuned by
L task to align them to the task. The efficacy of pretraining the model with an unsupervised loss is also expressed in other work [42] that involves optimizing graph structure for GNNs with a graph autoencoder.
The pretrain-finetune scheme is given in Algorithm 1.
Algorithm
The overall training algorithm of VEPM
Data: node features X , observed edges A , and observed labels y o .
Modules: Community ENCoder ( CENC ), Edge PARTitioner ( EPART ), Community-GNN BANK ( CGNN BANK ) and REPresentation COMPoser ( REPCOMP ).
Parameters: ϕ in the inference network , and θ in the generative network .
Initialize ϕ and θ ; repeat Z , K , Λ ← CENC( A , X ) ; compute L egen and L KL , given in Equation (5); ϕ ← ϕ − η unsup · ∇ ϕ ( L egen + L KL ) ; until CENC converges repeat Z , K , Λ ← CENC( A , X ) ;
A (1) , A (2) , · · · , A ( K ) ← EPART( Z , A ) ; for step ← 1 to M do ˆ p y o ← softmax (cid:0) [Equation]
BANK( Z , [Equation] , A ( [Equation]
, A (2) [Equation] · , A ( K ) ) (cid:1) ; until the whole model converges A.2 Subsampling-Based Acceleration Algorithm
Like all neural graph generative models that model the connection statuses of all (cid:0) N 2 (cid:1) node pairs, e.g. ,
VGAE [7] and its various extensions, the time complexity of (pre)training VEPM is also O ( N 2 ) .
Thus a direct implementation that considers all node pairs in each iteration will face the scalability issue as N increases.
Fortunately, such computation burden could be reduced to O ( N 2 S ) through subgraph-sampling based acceleration, where N S denotes the number of nodes in the subgraph after sampling, as analogous to FastGAE [29].
Specifically, we develop an explainable and flexible strategy to sample nodes from the original graph with replacement , where node i is sampled at probability p i : [Equation] [Equation]
With f ( · ) measuring the “importance” of node i , q i denotes the probability of sampling node i for its relative importance in graph G .
The sharpness of the probability distribution { q i } i =1 ,N is adjusted by the exponent α , where greater sharpness can be obtained with a higher value of α , and { q i } i =1 ,N would be equivalent to an uniform distribution if α is set to 0.
Likewise, 1 − q i N − 1 can be interpreted as the probability that node i is sampled for its relative unimportance.
For a better coverage, both “important nodes” and “unimportant nodes” are to be included in the sampled subgraph, with their percentages balanced by k ∈ [0 , 1] , i.e. , the higher the value of k , the more “important nodes” are expected to be included in the subgraph.
We use k = 0 .
9 , α = 1 , and node degrees as f ( · ) .
We record both node classification accuracy and the elapsed time per epoch for VEPM trained with and without subgraph sampling.
The modeled is evaluated on Cora, Citeseer and Pubmed where N S is set to 200.
As shown in Table 7, the acceleration algorithm successfully reduces the time cost by a huge margin, it also results in a slight decrease in model performance and a mild inflation in the error bar.
However, the negative impacts are not significant enough to offset the achievement in scalability, especially considering the fact that with the implication in model performance, VEPM with scalable training still outperforms other baselines on two out of three benchmarks.
[Table]
B Statistical Properties of the Probabilistic Distributions
The Bernoulli-Poisson distribution, which augments binary edges into counts of edges, not only adds interpretability in terms of edge partition, but also is well suited for sparse graphs.
The gamma prior not only ensures positivity and promotes sparsity on Z , but also allows an analytic KL term by combining with the Weibull variational distribution, which is reparameterizable.
Here are some properties of the Weibull distribution [43] that we would like to highlight:
• Similar density characteristics with gamma distribution
The Weibull distribution has similar characteristics with the gamma distribution, i.e. , the density functions of the two distributions are similar, and both enjoy the flexibility in modeling sparse and nonnegative latent representations.
[Equation]
• Easily Reparameterization
The latent variable x ∼ Weibull ( k, λ ) can be easily reparameterized as
[Equation]
leading to an expedient and numerically stable gradient calculation.
• Analytic KL-divergence
Moverover, the KL-divergence between the Weibull and gamma distributions has an analytic expression formulated as
[Equation] [Equation]
C More Details on the Experiments
The source code of VEPM is publicly available at https://github.com/YH-UtMSB/VEPM , which is developed upon Pytorch 1.9.0 / 1.11.0 and Python 3.8. Experiments are carried out on NVIDIA GeForce GTX 1080-Ti, NVIDIA Quadro RTX 5000, and NVIDIA RTX A4000. C.1 Data preparation
[Table] For the node classification task, we evaluate VEPM on four benchmarks, including three citation networks and one Wikipedia-based online article network.
The citation networks are Cora, Citeseer and PubMed, in which the academic literature is treated as nodes and citations are treated as edges. The node features are bag-of-words document representations.
The online article network is WikiCS, which treat each article as a node, and the hyperlinks between these articles as the edges.
All four networks used for node classification are undirected, node-attributed graphs.
The node features for the citation networks are bag-of-words document representations, for the online article network, the features for each article are the average GloVe word embeddings [44].
For graph classification, we consider four bioinformatics datasets (MUTAG, PTC, NCI1, PROTEINS) and four social network datasets (IMDB-BINARY, IMDB-MULTI, REDDIT-BINARY and REDDITMULTI).
The input node features are crafted in the same way as Xu et al.
We summarize some key statistics of the benchmarks we used for evaluating VEPM in Table 8.
To make a fair comparison with the baselines, for semi-supervised node classification on the citation networks (Cora, Citeseer, PubMed), we use the train/test/validation split standardized by the GCNs [5], and adopt cross-validation strategy for hyperparameter determination and early stop. For node classification on WikiCS, we follow the protocol of Kim and Oh [45].
For graph classification, we evaluate VEPM under two experimental protocols.
The results recorded in Table 2 are obtained following the 10-fold cross validation based evaluation protocol proposed by Xu et al.
Since this protocol is criticized for being prone to overestimating model performance [46], we also evaluate our model following Zhang and Chen [32], who conduct a more rigorous train-validation-test protocol.
The results obtained by the second protocol are shown in Table 3.
We evaluate the model performance with four types of inputs: random noise, hand-crafted features by
Xu et al.
[6], node-community affiliation scores ( i.e. , Z ), and the combination of the last two.
The quality of these inputs are evaluated by the graph classification accuracy as summarized in Table 9.
Two conclusions could be drawn: (i) Z is comparably informative to the end task as hand-crafted node features, both are significantly better than random noise (see rows 1 – 3 of Table 9); (ii) the information Z and X hold for the task enhances the discriminative level of learned representations in a complementary manner (see rows 2, 4 of Table 9).
These results indicate that inferring Z and treat it as additional node features would benefit task-learning.
[Table]
D.2 Alternatives of training schemes
In this part, we compare the performance of VEPM that undergoes both pretraining and finetuning against that of a VEPM trained with Equation (5) from scratch.
Results in Table 10 shows that comparing with training from scratch, the state of the community encoder after pretraining is better for the classification tasks, suggesting the benefits brought by pretraining.
[Table]
Why training from scratch is not good. As shown in Section 4.2, VEPM’s performance is dependent on the quality of edge partition. A relatively meaningful edge partition as the initial state for finetuning would facilitate information exchange between the model and the task, and thus is beneficial for optimization. Contrariwise, a less meaningful edge partition as the initial state would make it more difficult for the model to converge to an optimal state.
We notice that the performance of VEPM when trained from scratch is between baselines and a random guess, and we assume that the cause to such behavior is a less meaningful edge partition obtained by that training scheme.
Intuitively speaking, considering an extreme case where edge partition is not relevant to the task, which would render community-specific node representations meaningless for the task, and by passing them to the representation composer, which is a layer-reduced GIN, it is plausible that a worse result would be obtained. In the meantime, since the original graph is used in the representation composer, which still carries some information about the task, the model performance is protected from a total failure.
D.3 Sensitivity analyses
The number of (meta)communities.
We hold all other hyperparameters as constants and run 10-fold cross validations with K ∈ { 4 , 5 , 6 , 7 , 8 } , with K denoting the number of (meta)communities.
From the results in Table 11, we can find that (i) the variation in graph classification performance that
VEPM achieves with different values of K is not significant, most of the results recorded in the same column are within one standard deviation with each other; (ii) there is not a collective pattern between model performance and K shared across all benchmarks, in other words, not a single setting of K could consistently outperform other settings on all datasets.
Given the above observations, we conclude that the performance of VEPM performance on graph classification is not significantly influenced by the number of metacommunities within a reasonable range.
[Table]
Network depth allocation of the generative network .
In this part, we focus on studying the potential influence of different network structures on the graph classification tasks.
As we decide to make the generative network in VEPM to have a comparable number of parameters with GIN [6], the variation space left for the network structure is at how to distribute the 4 GIN layers to the community-GNN bank and representation composer .
We use the name convention VEPM-
{ L 1 } - { L 2 } to denote the variant with L 1 GIN layers in the community-GNN bank and L 2 GIN layers in the representation composer , where L 1 , L 2 ∈ Z + and L 1 + L 2 = 4 .
We hold all other hyperparameters as constants and evaluate VEPM under 3 structures: VEPM- { 1 } - { 3 } , VEPM- { 2 } - { 2 } and VEPM- { 3 } - { 1 } .
From the results shown in Table 12, the graph classification performance that VEPM achieves at different combinations of L 1 and L 2 are quite close to each other, the differences among the results in each column are at low statistical significance level.
We hence conclude that the predictive power of
VEPM is relatively stable at the variation of the network structure of the generative network .
[Table]
E The Characteristics of the Detected Communities
We summarize the patterns of communities detected by some well-established community detection / graph clustering / graph partition algorithms and compare them with VEPM
[Table]
[Table]
• Equisized: the size of communities are approximately the same.
• High (low) local edge density: the intra-community connection rate is specified to be high or low.
• Overlapping memebership: nodes are permitted to be affiliated with multiple communities simultaneously.
• Task-dependent: the community membership is affected by a downstream task.
F Limitations and Broader Impacts
While our model exhibits superiority over traditional convolution based graph neural networks on both node-level and graph-level representation learning tasks, several caveats are noteworthy.
From the perspective of model design, we only focus on intra-community node interaction in our graph generative model, while it is a common practice and usually leads to good results in modeling homophilous graphs, it cannot well explain the edges generated as a result of cross-community node interaction, which potentially limits its modeling performance on heterogeneous graphs.
VEPM offers a a new perspective to model the network with latent communities, it separates latent communities from the entire network and models them individually.
Used with goodwill, it can understand what optimally benefits each community and help policy-making accordingly.
However, along with its modeling power that could be harnessed to benefit communities, it can be dangerous if been put into socially harmful applications.
After all, no model is self-immune to malicious purpose, the potential misusages of VEPM include but not limited to group-targeted broadcast of fake news or conspiracy theories.
G Partitioned Adjacency Matrix