Stochastic Blockmodels meet Graph Neural Networks

Nikhil Mehta, Lawrence Carin, Piyush Rai

Introduction

Learning the latent structure in graph-structured data (Fortunato, 2010; Goldenberg et al., 2010; Schmidt & Morup, 2013) is an important problem in a wide range of domains, such as social and biological network analysis and recommender systems. These latent structures help discover the underlying communities in the network, as well as in predicting potential links between nodes. Latent space models (Hoff et al., 2002) and their structured extensions, such as the stochastic blockmodel (Nowicki & Snijders, 2001) and variants like the infinite relational model (IRM) (Kemp et al., 2006), mixed-membership stochastic blockmodel (MMSB) (Airoldi et al., 2008), and the overlapping stochastic blockmodel (OSBM) (Miller et al., 2009a; Latouche et al., 2011a) accomplish this by learning low-dimensional, interpretable node embeddings defined via structured latent variables. These embeddings can be used to identify the community membership(s) of each node in the graph, as well as for tasks such as link prediction.

The overlapping stochastic blockmodel (OSBM), also known as the latent feature relational model (LFRM), is a particularly appealing model for relational data (Miller et al., 2009a; Latouche et al., 2011a; Zhu et al., 2016). The OSBM/LFRM models each node in the graph as belonging to one or more communities using a binary membership vector, and defines the link probability between any pair of nodes as a bilinear function of their community membership vectors. Despite its appealing properties, the OSBM/LFRM has a number of limitations. In particular, although usually considered to be more expressive (Miller et al., 2009a) than models such as IRM and MMSB, a single layer of binary node embeddings and the bilinear model for the link generation can still limit the expressiveness of OSBM/LFRM. Moreover, it has a challenging inference procedure, which primarily relies on MCMC (Miller et al., 2009a; Latouche et al., 2011a) or mean-field variational inference (Zhu et al., 2016). Although recent models have tried to improve the expressiveness of OSBM/LFRM, e.g.e.g., by assuming a deep hierarchy of binary-vector-based node embeddings (Hu et al., 2017), inference in such models remains intractable, requiring expensive MCMC-based inference. It is therefore desirable to have a model that retains the basic spirit to OSBM/LFRM (e.g.e.g., easy interpretability and strong link prediction performance), but with greater expressiveness, and a simpler and scalable inference procedure.

Motivated by these desiderata, we develop a deep generative framework for graph-structured data, that inherits the easy interpretability of overlapping stochastic blockmodels, but is much more expressive and enjoys a fast inference procedure. Our framework is based on a novel, sparse variant of the variational autoencoder (VAE) (Kingma & Welling, 2013), designed to model graph-structured data. Our VAE-based setup comprises a nonlinear generator/decoder for the graph and a nonlinear encoder based on the graph convolutional network (GCN) (Kipf & Welling, 2016a) (although other graph neural networks can also be used). Our framework posits each node of the graph to have an embedding in the form of a sparse latent representation (modeled by a Beta-Bernoulli process (Griffiths & Ghahramani, 2011), which also enables learning the size of the embeddings). The generator/decoder part of the VAE models the probability of a link between two nodes via a nonlinear function (defined by a deep neural network) of their associated embeddings. The encoder part of the VAE consists of a fast recognition model that is designed leveraging reparameterization method for Beta and Bernoulli distributions (Maddison et al., 2017; Nalisnick & Smyth, 2017). The recognition model, based on stochastic gradient variational Bayes (SGVB) inference, enables fast inference of the node embeddings. In contrast, the traditional stochastic blockmodels rely on iterative MCMC or variational inference procedures for inferring the node embeddings. Consequently, the SGVB inference algorithm we develop is also of independent interest, since the recognition model enables fast inference of the node embeddings in single-layer overlapping stochastic blockmodels.

Preliminaries

The OSBM (Latouche et al., 2011a; Miller et al., 2009a; Zhu et al., 2016) is a stochastic blockmodel for networks; it assumes each node nn has an associated binary vector (node embedding), also termed a latent feature vector zn∈{0,1}K\boldsymbol{z}_{n}\in\{0,1\}^{K}. Within the node embedding, znk=1z_{nk}=1 denotes that node nn belongs to cluster/community kk, and znk=0z_{nk}=0 otherwise. The OSBM allows each node to simultaneously belong to multiple communities, and defines the link probability between two nodes via a bilinear function of their latent feature vectors

The nonparametric latent feature relational model (LFRM) is a specific type of OSBM, that leverages the Indian Buffet Process (IBP) prior (Miller et al., 2009a) on the N×KN\times K binary matrix Z=[z1,…,zN]⊤{\bf Z}=[\boldsymbol{z}_{1},\ldots,\boldsymbol{z}_{N}]^{\top} of the node-community membership vectors. Use of the IBP enables learning the number of communities. Inference in LFRM/OSBM is typically performed via MCMC or variational inference (Miller et al., 2009a; Latouche et al., 2011a; Zhu et al., 2016), which tends to be slow and often cannot scale easily to more than a few hundred nodes.

Deep Generative OSBM

Given the node embeddings zn=bn⊙rn\boldsymbol{z}_{n}={\boldsymbol{b}}_{n}\odot\boldsymbol{r}_{n}, the VAE decoder generates each link in the graph as Anm∼pθ(zn,zm)A_{nm}\sim p_{\theta}(\boldsymbol{z}_{n},\boldsymbol{z}_{m}), where probability distribution pθp_{\theta} defines a decoder or generator model for the graph. This decoder can consist of one or more layers of deterministic nonlinear transformation of the node embeddings zn\boldsymbol{z}_{n}. Denoting the overall transformation for a node embedding zn\boldsymbol{z}_{n} as f(zn)=fnf(\boldsymbol{z}_{n})={\boldsymbol{f}}_{n}, we model the probability of a link as p(Anm=1∣fn,fm)=σ(fn⊤fm)p(A_{nm}=1|{\boldsymbol{f}}_{n},{\boldsymbol{f}}_{m})=\sigma({\boldsymbol{f}}_{n}^{\top}{\boldsymbol{f}}_{m}), where the nonlinear function ff can be modeled by a deep neural network (in our experiments, we use a deep neural net with each hidden layer having leaky ReLU nonlinearity). Figure 1 (left) depicts the generator.

We model the binary vector bn∈{0,1}K{\boldsymbol{b}}_{n}\in\{0,1\}^{K}, denoting node-community memberships, using the stick-breaking construction of the IBP (Teh et al., 2007), which enables learning of the effective KK by specifying a sufficiently large truncation level KK. The stick-breaking construction is given as follows

2 VAE Encoder

We employ a nonlinear encoder to infer the node embedding zn\boldsymbol{z}_{n} for each node, using a fast non-iterative recognition model (Kingma & Welling, 2013). Denoting the parameters of the variational posterior for the embeddings of all the nodes collectively as {v,b,r}\{\boldsymbol{v},{\boldsymbol{b}},\boldsymbol{r}\}, we consider an approximation to the model’s true posterior p(v,b,r∣A,X)p(\boldsymbol{v},{\boldsymbol{b}},\boldsymbol{r}|{{\bf A}},{{\bf X}}) with a variational posterior of the form qϕ(v,b,r)q_{\phi}(\boldsymbol{v},{\boldsymbol{b}},\boldsymbol{r}). For simplicity, we consider a mean-field approximation, which allows us to factorize the posterior as qϕ(v,b,r)=∏k=1K∏n=1Nqϕ(vnk)qϕ(bn,k)qϕ(rn,k)q_{\phi}(\boldsymbol{v},{\boldsymbol{b}},\boldsymbol{r})=\prod_{k=1}^{K}\prod_{n=1}^{N}q_{\phi}(v_{nk})q_{\phi}(b_{n,k})q_{\phi}(r_{n,k}). Our nonlinear encoder, as shown in Fig. 1 (Right), assumes variational distributions on the local variables of each node, i.e.i.e., vn\boldsymbol{v}_{n}, bn{\boldsymbol{b}}_{n} and rn\boldsymbol{r}_{n}, and defines the variational parameters of these distributions as the outputs of a graph convolutional network (GCN) (Kipf & Welling, 2016a), which takes as input the network A{{\bf A}} and the node feature matrix X{{\bf X}}. GCN has recently emerged as a flexible encoder of graph-structured data (similar in spirit to convolutional neural networks for images), which makes it an ideal choice of the encoder in our VAE-based generative model for graphs. The forward propagation rule for each layer ll in GCN is defined as Hl=g(A^Hl−1Wl){\bf H}^{l}=g(\hat{{{\bf A}}}{\bf H}^{l-1}{{\bf W}}^{l}), where H0=X{\bf H}^{0}={{\bf X}} (X=I{{\bf X}}={\bf I} when no side information is present), Wl{{\bf W}}^{l} is the weight matrix, g(⋅)g(\cdot) is the non-linear activation, and A^\hat{{{\bf A}}} is the symmetric normalization of adjacency A{{\bf A}}. Although here we have used the vanilla GCN in our architecture, more-generalized variants of GCN, such as GraphSAGE (Hamilton et al., 2017), can also be used as the encoder. The variational distributions have the following forms

where cnk,dnk,πnk,μn,and σnc_{nk},d_{nk},\pi_{nk},{\boldsymbol{\mu}}_{n},\text{and }{\boldsymbol{\sigma}}_{n} are outputs of a GCN, i.e.i.e., {ck,dk,πk,μk,σk}n=1n=N=GCN(A,X)\{c_{k},d_{k},\pi_{k},\mu_{k},\sigma_{k}\}_{n=1}^{n=N}=\text{GCN}({{\bf A}},{{\bf X}}). We use the stochastic gradient variational Bayes (SGVB) algorithm (Kingma & Welling, 2013) to infer the parameters of the variational distributions. Details on reparameterization and the loss formulation are provided in Section 4.

3 Special Cases

Existing models for graph-structured data can be seen as special cases of our framework. Recall that we model the node embeddings as zn=bn⊙rn\boldsymbol{z}_{n}={\boldsymbol{b}}_{n}\odot\boldsymbol{r}_{n}, and our generative model is of the form Anm∼pθ(zn,zm)A_{nm}\sim p_{\theta}(\boldsymbol{z}_{n},\boldsymbol{z}_{m}). If we ignore the community strength latent variable rn\boldsymbol{r}_{n}, i.e.i.e., zn\boldsymbol{z}_{n} is defined simply as zn=bn\boldsymbol{z}_{n}={\boldsymbol{b}}_{n} (just a binary vector) and further define pθp_{\theta} as a Bernoulli distribution with its probability being a bilinear function of the embeddings zn\boldsymbol{z}_{n} and zm\boldsymbol{z}_{m}, then we recover the OSBM/LFRM (Latouche et al., 2011a; Miller et al., 2009a). Note, however, that while OSBM/LFRM typically rely on MCMC or variational inference, our framework can leverage SGVB for efficient inference.

Likewise, if we define zn=rn\boldsymbol{z}_{n}=\boldsymbol{r}_{n}, i.e.i.e., a dense vector, and define pθp_{\theta} as a Bernoulli distribution with its probability being a bilinear function of the embeddings, we recover the Eigenmodel or latent-space model (LSM) (Hoff et al., 2002). Note that this model cannot infer KK since the binary vector bn{\boldsymbol{b}}_{n} is not present. Finally, if pθp_{\theta} is a Bernoulli distribution with its probability being a nonlinear function of the embeddings, then we recover the VGAE model (Kipf & Welling, 2016b), which can also be seen as a nonlinear extension of LSM. Moreover, note that a key limitation of LSM and VGAE is that these cannot be used to infer the community structure (due to the non-sparse nature of zn\boldsymbol{z}_{n}) and usually can only be used for link-prediction tasks.

Inference

We define the factorized variational posterior qϕ(v,b,r)q_{\phi}(\boldsymbol{v},{\boldsymbol{b}},\boldsymbol{r}) as

where ck,dk,πk,μnand σnc_{k},d_{k},\pi_{k},\boldsymbol{\mu}_{n}\text{and }\boldsymbol{\sigma}_{n} are a function of the GCN encoder, with inputs A{{\bf A}} and X{{\bf X}}. We define the loss function L\mathcal{L} parameterized by inference network (encoder) parameters (ϕ\phi) and generator parameters (θ\theta) by minimizing the negative of the evidence lower bound (ELBO)

Our variational autoencoder for link generation is trained using Stochastic Gradient Variational Bayes (SGVB) (Kingma & Welling, 2013). SGVB can be used to perform inference for a broad class of non-conjugate models and is therefore appealing to Bayesian nonparametric models, such as those based on stick-breaking priors that we use in our framework. SGVB uses differentiable Monte Carlo (MC) expectations to learn the model parameters. Specifically, it requires differentiable, non-centered parameterization (DNCP) (Kingma & Welling, 2014) to allow backpropagation. However, our model has expectations over Beta and Bernoulli distributions, neither of which permit easy reparameterization as required by SGVB. We leverage recent developments on reparameterizing these distributions (Maddison et al., 2017; Nalisnick & Smyth, 2017), which consequently leads to a simple inference procedure.

Following (Nalisnick & Smyth, 2017), we approximate the Beta posterior in (4) with the Kumaraswamy distribution, defined as: Kumar(x;a,b)=abxa−1(1−xa)b−1Kumar(x;a,b)=abx^{a-1}(1-x^{a})^{b-1} for x∈(0,1)x\in(0,1) and a,b>0a,b>0. The closed-form inverse CDF allows easy reparameterization, and samples for vnkv_{nk} (with parameters cnkc_{nk} and dnkd_{nk}) can be drawn using:

We compute the KL divergence between the Kumaraswamy q(v)q(\boldsymbol{v}) and the Beta distribution p(v)p(\boldsymbol{v}) by taking a finite approximation of the infinite sum as mentioned in (Nalisnick & Smyth, 2017).

We reparameterize bnkb_{nk}, defined by a Bernoulli with probability πnk\pi_{nk}, (in (3) and (5)) with reparameterization:

where σ(⋅)\sigma(\cdot) is the sigmoid function, logit(⋅)logit(\cdot) is the inverse-sigmoid function, λ\lambda is the relaxation temperature and u∼Uniform(0,1)u\sim\text{Uniform}(0,1).

Structured Mean-Field: Since the vanilla mean-field variational inference ignores the posterior dependence among the latent variables, we also considered Structured Stochastic Variational Inference (SSVI) (Hoffman, 2014; Hoffman et al., 2013), which allows global-local parameter dependency and improves upon the mean-field approximation. We considered v\boldsymbol{v} (and its variational parameters c and dc\text{ and }d) as global parameters and impose a hierarchical structure on bn{\boldsymbol{b}}_{n} by conditioning it on v\boldsymbol{v}. The variational posterior of our framework using SSVI can be factorized as qϕ(v,b,r)=∏k=1Kqϕ(vk)∏n=1Nqϕ(bn,k∣v)qϕ(rn,k)q_{\phi}(\boldsymbol{v},{\boldsymbol{b}},\boldsymbol{r})=\prod_{k=1}^{K}q_{\phi}(v_{k})\prod_{n=1}^{N}q_{\phi}(b_{n,k}|\boldsymbol{v})q_{\phi}(r_{n,k}) with qϕ(vk)=Beta(ck,dk);qϕ(bnk∣v)=Bernoulli(πk);πk=∏j=1Kvkq_{\phi}(v_{k})=\text{Beta}(c_{k},d_{k});q_{\phi}(b_{nk}|\boldsymbol{v})=\text{Bernoulli}(\pi_{k});\pi_{k}=\prod_{j=1}^{K}v_{k}, where ck,dkc_{k},d_{k} are parameters to be learned. In practice, we have found structured mean-field to perform better than the mean-field, and our model implementation uses the former.

Related Work

The proposed framework can be seen as bridging two lines of research on modeling graphs: (ii) structured latent variable models for graphs, such as stochastic blockmodels and its variants (Kemp et al., 2006; Airoldi et al., 2008; Miller et al., 2009a; Latouche et al., 2011a); and (iiii) deep learning models for graphs, such as graph convolutional networks (Kipf & Welling, 2016a). Our effort is motivated by the goal of harnessing their complementary strengths to develop a deep generative stochastic blockmodel for graphs, that also enjoys an efficient inference procedure.

The most prominent methods in stochastic blockmodels include models that associate each node to a single community (Nowicki & Snijders, 2001; Kemp et al., 2006), a mixture of communities (Airoldi et al., 2008), and an overlapping set of communities (Miller et al., 2009a; Latouche et al., 2011a; Yang & Leskovec, 2012; Zhou, 2015). While stochastic blockmodels have nice interpretability, these models usually assume the links of the networks to be modeled as a simple bilinear function of the node embeddings, which may not be able to capture the nonlinear interactions between the nodes (Yan et al., 2011). An approach to model such nonlinear interactions was proposed in (Yan et al., 2011), using a matrix-variate Gaussian process. However, despite the modeling flexibility, inference in this model is challenging and the model is usually infeasible to run on networks with more than 100 nodes.

There is also significant recent interest in non-probabilistic deep learning models for graphs. Some of the prominent works in this direction include DeepWalk (Perozzi et al., 2014) and graph autoencoders (GAE) (Kipf & Welling, 2016a; Hamilton et al., 2017). DeepWalk is inspired by the idea of word embeddings. It treats each node as a “document,” by starting a random walk at that node and taking the nodes encountered in the path taken as the word in that document. It uses document/word embedding methods to the learn embedding of each node. In contrast, the GAE approaches are based on the idea of graph convolutional networks (GCN) (Kipf & Welling, 2016a). This line of work nicely complements our contribution, since modules like GCN can be effectively used to design the encoder model for our deep generative framework. In particular, as noted in the model description, our encoder is essentially a GCN. We believe that such advances in graph encoding can be used as modules to design new deep generative models for relational data.

Despite the significant success of deep generative models for images and text data, there has been relatively little work on deep generative models for relational data (You et al., 2018; Hu et al., 2017; Wang et al., 2017; Kipf & Welling, 2016b). GraphRNN (You et al., 2018) learns a single representation of an entire graph to model the joint distribution of different graphs. The focus of GraphRNN is on generating small-sized graphs, whereas we focus on link prediction and community detection for a given graph. Among other existing methods, (Hu et al., 2017) proposed an extension of the LFRM via a deep hierarchy of binary latent features for each node. However, this model relies on expensive batch MCMC inference, precluding its applicability to large-scale networks. Another deep latent variable model was proposed recently in (Wang et al., 2017). However, this model also has a difficult inference procedure, requiring model-specific inference. Moreover, the node embeddings are not interpretable. Perhaps the closest in spirit to our work is the recent work on variational graph autoencoders (VGAE) (Kipf & Welling, 2016b). Graphite (Grover et al., 2018) extends the VGAE by using a multi-layer iterative decoder that alternates between message passing and graph refinement. A similar decoding scheme can also be applied in our framework; however, the focus of this work is on learning sparse interpretable node embeddings. Both VGAE and Graphite are built on top of the standard VAE, and consequently do not have direct interpretability of node embeddings as desired by stochastic blockmodels. This leads to a model with different properties and a different inference procedure, compared to (Kipf & Welling, 2016b). Moreover, our VAE architecture is nonparametric in nature and can infer the node embedding size.

Experiments

We report experimental results on several synthetic and real-world datasets, to demonstrate the efficacy of our model. Our experimental results include quantitative comparisons on the task of link prediction as well as qualitative results, such as using the embeddings to discover the underlying communities in the network data. The qualitative results are meant to demonstrate the expressiveness of the latent space that our model infers. The expressive nature of our model is the result of the sparse and interpretable embedding for each node of the graph. In particular, we show that these sparse embeddings can be interpreted as the memberships and strength of memberships of each node in one or more communities.

First we evaluate our model on link-prediction, comparing it with various baselines on several benchmark datasets on moderate (about 2000 nodes) to large-scale (about 20,000 nodes) datasets. We then analyze the latent structure zn\boldsymbol{z}_{n} learned by our model on a synthetic and a real-world co-authorship dataset. We compare the latent structure with the embeddings learned by the variational graph autoencoder (VGAE) (Kipf & Welling, 2016b). We also examine the community structure on the real-world co-authorship dataset, and show that the proposed framework is able to readily capture the underlying communities. We refer to our framework as DGLFRM (Deep Generative Latent Feature Relational Model), which refers to our most general model with sparse embeddings zn=bn⊙rn\boldsymbol{z}_{n}={\boldsymbol{b}}_{n}\odot\boldsymbol{r}_{n} with nonlinear generator and nonlinear encoder. We also consider a variant of DGLFRM with binary embeddings zn=bn\boldsymbol{z}_{n}={\boldsymbol{b}}_{n}, which we refer to as DGLFRM-B (the ‘B’ here denotes “binary”). Note that DGLFRM-B can be seen as a deep generalization of LFRM (Miller et al., 2009b)/OSBM (Latouche et al., 2011b), with another key difference from LFRM/OSBM being the fact that we use amortized inference.

For link prediction, we compare the proposed model with four baselines, one of which is a simplified variant of DGLFRM akin to LFRM (Miller et al., 2009a), which is an overlapping stochastic blockmodel. The original LFRM, which uses MCMC-based inference, was infeasible to run on the datasets used in these experiments. On the other hand, DGLFRM with zn=bn\boldsymbol{z}_{n}={\boldsymbol{b}}_{n} and bilinear decoder (link generation model) is similar to LFRM, but with a much faster SGVB based inference (we will refer to this simplified variant of DGLFRM as LFRM).

Among the other three baselines, Spectral Clustering (SC) and DeepWalk (DW) (Perozzi et al., 2014) learn node embeddings, which we use to compute the link probability as σ(zn⊤zm)\sigma(\boldsymbol{z}_{n}^{\top}\boldsymbol{z}_{m}). The third baseline is the recently proposed variational autoencoder on graphs (VGAE) (Kipf & Welling, 2016b). Note that none of these baselines can be used for community detection, since the real-valued embeddings learned by these baselines are not interpretable (unlike our model which learns sparse embeddings, with nonzeros denoting community memberships).

2 Datasets

We consider five real-world datasets, with three datasets consisting of side information in the form of the node features, and the other two datasets having only the link information. For the link-prediction experiments, all models are provided a partially-complete network (with unknown part to be predicted). The node features (when available) are provided to all the models. The description of each data set is as follows:

NIPS12: The NIPS12 coauthor network (Zhou, 2015) includes all 2037 authors in NIPS papers from volumes 1-12, with 3134 edges. This network has no side information.

Yeast: The Yeast protein interaction network (Zhou, 2015) has 2361 nodes and 6646 non-self edges. This network has no side information.

Cora: Cora network is a citation network consisting of 2708 documents. The datasets contain sparse bag-of-words feature vectors of length 1433 for each document. These are used as node features. The network has total 5278 links.

Citeseer: Citeseer is a citation network consisting of 3312 scientific publications from six categories: agents, AI, databases, human computer interaction, machine learning, and information retrieval. The side information for the dataset is the category label for each paper which is converted into a one-hot representation. These one-hot vectors are used as node features. The network has a total of 4552 links.

Pubmed: A citation network consisting of 19,717 nodes. The dataset contains sparse bag-of-words feature vectors of length 500 for each document, used as node features. The network has total 44,324 links.

3 Link Prediction

We use Area Under the ROC Curve (AUC) and Average Precision (AP) to compare our model with the other baselines for link prediction. For all datasets, we hold out 10% and 5% of the links as our test set and validation set, respectively, and use the validation set to fine-tune the hyperparameters. We take the average of AUC-ROC and AP scores by running our model on 10 random splits of each dataset, to compare with the baselines. The AUC-ROC scores of our models and the various baselines are shown in Table 1 and AP scores are shown in Table 2. As shown in the tables, our models outperforms the baselines on almost all datasets. We again highlight that unlike the baselines, such as VGAE, that cannot learn interpretable embeddings, our model also learns embeddings that can be interpreted as memberships of nodes into communities. The superior results of DGLFRM and DGLRFM-B demonstrate the benefit of our deep generative models. The significantly better results of these as compared to LFRM also show the benefit of endowing LFRM with a deep architecture, with nonlinear decoder and nonlinear encoder. The hyperparameter settings used for all experiments are included in the Supplementary Material. We also performed an experiment to investigate the model’s ability to leverage node features. As expected, when using the features the model performs better compared to the case when it ignores features. This experiment is included in the supplementary section.

4 Qualitative Analysis on Learned Embeddings

To demonstrate the interpretable nature of the embeddings learned by our model, we generate a synthetic dataset with 100 nodes and 10 communities. The dataset is generated by fixing the ground-truth communities (by creating a binary vector for each node) such that some of the nodes belong to same communities. The adjacency matrix is then generated using a simple inner product, followed by the sigmoid operation (Figure 2a). We train using 85% of the synthetic adjacency matrix for link-prediction and for visualizing the latent structure that our model learns. The latent structure obtained using DGLFRM is plotted in Figure 2(b). Figure 2(c) shows that by using only the first two dimensions of the latent structure we can reconstruct the graph reasonably well. This depicts an important property of using a stick-breaking IBP prior which encourages the most commonly selected communities (the columns on the left in Figure 2 (b)) to be dense, while the communities with higher indices (columns in right) to be sparse. This shows that DGLFRM can learn the effective number of communities given a graph. Finally, we can quantize the latent space into discrete intervals to extract nodes belonging to different communities. In our experiments we saw that the latent structure learned is in fact close to the ground-truth community assignments we started with. In Figure 2(d) we compare the community structure from our model with the latent structure obtained by running the VGAE. Note that the Gaussian latent structure in VGAE is dense and therefore fails to learn community memberships that are readily interpretable.

We also do a qualitative analysis on the NIPS12 dataset. Again we train DGLFRM and VGAE using 85% of the adjacency matrix. Table 3 shows five of the inferred communities by DGLFRM. The authors shown under each community are ordered by the strength of their community memberships (in decreasing order). As Table 3 shows, each of the communities represent a sub-field, with authors working on similar topics. Moreover, note that some authors (e.g.e.g., Sejnowski) are inferred as belonging to more than one community. This qualitative experiment demonstrates that our model can learn interpretable embeddings that can be used for tasks such as (overlapping) clustering. We have included a visualization of the latent structure learned on NIPS12 data in the Supplementary Material. Note that our model can infer the number of communities naturally, via the stick-breaking prior. The stick-breaking prior requires specifying a large truncation level on the number of communities. Our model effectively infers the “active” communities for a given truncation level. As shown in Fig. 2 (b)-(c), the posterior inference in our model is able to “turn off” the unnecessary columns in Z{\bf Z}. Although we do not know the ground truth for the number of communities, the number of inferred active communities is similar to what is reported in prior work on nonparametric Bayesian overlapping stochastic blockmodels (Miller et al., 2009a). Note that VGAE embeddings require an additional step (such as KK-Means clustering) to cluster nodes. Moreover, a method such as KK-means cannot detect overlapping communities, and it is also sensitive to the initialization of KK (estimated number of communities). For reference, we have included the clustering results on the VGAE embeddings in the Supplementary Material.

Conclusion and Discussion

We have presented a deep generative framework for overlapping community discovery and link prediction. This work combines the interpretability of stochastic blockmodels, such as the latent feature relational model, with the modeling power of deep generative models. Moreover, leveraging a nonparametric Bayesian prior on the node embeddings enables learning the node embedding size (i.e.i.e., the number of communities) from data. Our framework is modular and a wide variety of decoder and encoder models can be used. In particular, it can leverage recent advances in non-probabilistic autoencoders for graphs, such as the graph convolutional network (Kipf & Welling, 2016a) or its extensions (Hamilton et al., 2017). Inference in the model is based on SGVB, that does not require conjugacy. This further widens the applicability of our framework to model different types of networks (e.g.e.g., weighted, count-valued edges, and power-law degree distribution of node degrees). We believe this combination of discrete latent variables based stochastic blockmodels and graph neural network will help leverage their respective strengths, and will fuel further research and advance the state-of-the-art in (deep) generative modeling of graph-structured data.

Although SGVB inference makes our model fairly efficient, it can be scaled up further for massive networks by using mini-batch based inference (Chen et al., 2018). Another possibility to scale up the model is to replace the Bernoulli-logistic likelihood model by a Bernoulli-Poisson link (Zhou, 2015), which enable scaling up the model in the number of nonzeros (i.e.i.e., number of edges) in the network. Given that our framework can work with a wide variety of decoder/generator models, such modifications can be done without much difficulty.

Finally, in this work we model each node as having a single binary vector, denoting its memberships in one or more communities. Another interesting extension would be to consider multiple layers of latent variables, which can model a node’s membership into a hierarchy of communities (Ho et al., 2011; Blundell & Teh, 2013; Hu et al., 2017).

Acknowledgements: PR acknowledges support from Google AI/ML faculty award and DST-SERB Early Career Research Award. The Duke investigators acknowledge the support of DARPA and ONR.

References

Supplementary Material

The framework proposed uses a stick-breaking IBP prior which has two parameters: α\alpha and KK. The parameter α\alpha is the initial guess of the number of non-zero entries in the binary vector bnb_{n} and KK is the truncation parameter. In the experiments, α∈{5,10,20,50,100}\alpha\in\{5,10,20,50,100\}. In general, a higher value of the α\alpha parameter worked better for DGLFRM-B and LFRM, as compared to the α\alpha value in the DGLFRM model. This difference in α\alpha reflects the inherent capacity of the latent space of these models. The embedding learned by DGLFRM, while being highly sparse, are in real space resulting in more capacity to represent data as compared to the binary latent space in DGLFRM-B and LFRM.

The encoder network for DGLFRM and DGLFRM-B had two non-linear GCN layers. The length of the first non-linear layer was fixed to 32/64 for the datasets which had side-information (Cora, Citeseer and Pubmed), and otherwise was set to 128/256. The second layer of the GCN encoder had K∈{50,100,200}K\in\{50,100,200\} hidden units. The decoder network for DGLFRM and DGLFRM-B had two layers with dimension 32 and 16. All the models were trained for 500-1000 iterations using the Adam optimizer (Kingma & Ba, 2014) with a learning rate of 0.010.01. We used 0.5 dropout. The temperature parameter of the Binary Concrete distribution (Maddison et al., 2017) was 0.5 for the prior and 1.0 for the posterior.

Qualitative results:

For experiments on the synthetic data (with 100 nodes and 10 communities), the DGLFRM model had two GCN encoding layers with 32 and K=10K=10 hidden units, and the decoder had a simple inner-product layer. The VGAE model had the same set of hyperparameters as above. The qualitative experiment on the NIPS12 co-authorship dataset had two hidden layers with 64 and K=10K=10 hidden units. The α\alpha parameter for this experiment was fixed to 2.

2 K-means on VGAE embeddings

Variational Graph Autoencoder (VGAE), unlike the proposed model, is not able to learn embeddings which are readily interpretable. It requires additional processing such as K-Means over the learned embeddings for node clustering. Moreover, a method like K-Means does not result in overlapping communities. In this section, we compare the clusters obtained after applying K-means on embeddings learned from VGAE with the readily available overlapping communities obtained from our framework.

We use K-means to find clusters for NIPS12 (3134 authors) co-authorship data on the node embeddings learned using VGAE. The K-means results are shown in Table 4. We performed two experiments with different k-means cluster hyperparameter KK (K=5 and K=20). We also show the clusters (communities) which our model was readily able to infer for reference Table 3. We only show prominent authors and their clusters for both the models.

As we see in Table 4, ad-hoc post-processing of embeddings may break some relevant coherent communities which were inferred by our model. It is also important to note that, unlike our model, k-means has no strength indicator for community membership.

3 Latent Structure on NIPS12

The latent structure of the NIPS12 dataset learned by DGLFRM and VGAE is shown in Figure 2. In this experiment, the truncation parameter for the stick-breaking prior is 50. As shown in Figure 2(b), the posterior inference in DGLFRM is naturally able to “turn off” the unnecessary columns in Z{\bf Z}. The average number of active communities for each node was found to be 8. The sparse nature of the embedding matrix allows us to consider each column as a possible community of a given node. For visualization, we have ordered the indices of the communities (columns of Z{\bf Z}) such that the community with higher active nodes has a lower index in the visualization. For the VGAE model, we used a two layer GCN with dimensions 32 and 16. Figure 2(c) depicts the dense node embedding learned by VGAE.

4 Effect of Side Information

We also perform an experiment to investigate the model’s ability to leverage side information associated with nodes. For this experiment, we ran our model on three datasets (Cora, Citeseer and Pubmed) with and without node features. We compare the AUC-ROC results in Fig. 4. As expected, when using the node side information, the model performs better as compared to the case when it ignores the side information.