Cascade-BGNN: Toward Efficient Self-supervised Representation Learning on Large-scale Bipartite Graphs
Chaoyang He Tian Xie Yu Rong Wenbing Huang Junzhou Huang Xiang Ren Cyrus Shahabi


















Both authors contributed equally to this research.
chaoyang.he@usc.edu
1234-5678-9012

[1]
xiet@usc.edu

  University of Southern California
  
  Los Angeles
  California
  USA
  




  Tencent AI Lab
  
  Shenzhen
  China
yu.rong@hotmail.com



  Tencent AI Lab
  
  Shenzhen
  China
hwenbing@126.com













  Tencent AI Lab
  
  Shenzhen
  China
jzhuang@uta.edu



  University of Southern California
  
  Los Angeles
  California
  USA

xiangren@usc.edu



  University of Southern California
  
  Los Angeles
  California
  USA

shahabi@usc.edu














Bipartite graphs have been used to represent data relationships in many data-mining applications such as in E-commerce recommendation systems. Since learning in graph space is more complicated than in Euclidian space, recent studies have extensively utilized neural nets to effectively and efficiently embed a graph's nodes into a multidimensional space. However, this embedding method has not yet been applied to large-scale bipartite graphs. Existing techniques either cannot be scaled to large-scale bipartite graphs that have limited labels or cannot exploit the unique structure of bipartite graphs, which have distinct node features in two domains. Thus, we propose Cascade Bipartite Graph Neural Networks, Cascade-BGNN, a novel node representation learning for bipartite graphs that is domain-consistent, self-supervised, and efficient. To efficiently aggregate information both across and within the two partitions of a bipartite graph, BGNN utilizes a customized Inter-domain Message Passing (IDMP) and Intra-domain Alignment (IDA), which is our adaptation of adversarial learning, for message aggregation across and within partitions, respectively. BGNN is trained in a self-supervised manner.
Moreover, we formulate a multi-layer BGNN in a cascaded training manner to enable multi-hop relationship modeling while improving training efficiency. Extensive experiments on several datasets of varying scales verify the effectiveness and efficiency of BGNN over baselines. Our design is further affirmed through theoretical analysis for domain alignment. The scalability of BGNN is additionally verified through its demonstrated rapid training speed and low memory cost over a large-scale real-world bipartite graph [Our code is open-sourced at <https://github.com/chaoyanghe/bipartite-graph-learning>].











































Cascade-BGNN: Toward Efficient Self-supervised Representation Learning on Large-scale Bipartite Graphs
    Cyrus Shahabi
    December 30, 2023
======================================================================================================



§ INTRODUCTION


Graphs have been used to capture and represent complex structural relationships among data items in various domains, including drug discovery <cit.>, social networks analysis <cit.>, and visual understanding <cit.>. Amongst their varying forms, bipartite graphs are prevalent in data mining applications. A bipartite graph (Fig. <ref>) is a graph whose vertices are divided into two independent partitions such that every edge connects nodes from one partition to the other. For example, in an e-commerce recommendation system, the two distinct partitions are represented by users and products, and an edge from a member from one partition to a member of the other represents the user purchasing the product <cit.>. 
The ability to utilize information from the graphical structure, such as node features in the two distinct partitions and topology information, plays an important role in the accuracy and effectiveness of services and tasks, such as classification, prediction, and recommendation. 






Graph representation learning, also called graph embedding, is a machine learning paradigm that aims to solve the above problem by mapping structural information into a low-dimensional vector space which can then be used to improve the performance of downstream tasks <cit.>. Early classical works include random walk-based methods (DeepWalk <cit.>, Node2Vec<cit.>), where only graph topology and node relations are embedded as vectors. 
In light of the rapid advancements of deep learning, Graph Neural Networks (GNNs) <cit.> have exhibited tremendous
progress in representation learning for generic graphs (GraphSAGE <cit.>, AS-GCN <cit.>).

In general, GNNs recursively update each node's feature by aggregating its neighbors through message passing, by which not only the patterns of graph topology but also node features are captured. However, GNNs cannot embed the rich information contained in distinct node features from two domains and topology information into a single node presentation, especially for an extremely large-scale bipartite graph without sufficient node-wise labels. For example, in the e-commerce system (Fig. 1), to precisely represent a user, hidden product attributes should also be extracted and incorporated into the final embedding vector because it can express a user's taste and interest, which is useful in accurately classifying users. 

This paper studies the above problem of node representation learning on large-scale bipartite graphs in a self-supervised manner. There are two main challenges. The first challenge with bipartite graphs is that features of nodes in each partition of a bipartite graph may follow different distributions in distinct feature domains (e.g., in Fig. <ref>, users and products have different attributes). Therefore, representing bipartite graphs as generic graphs to leverage neighbor message passing, as is typically done with GNNs, fails to exploit the extra knowledge from two distinct node domains. One can deal with two different partitions for each domain by converting two-hop neighbors to one-hop homogeneous connections within the same domain (note that each node and its two-hop neighbors are in the same partition). This approach is clearly unable to exploit the feature correlations across the two partitions. Alternatively, one can treat bipartite graphs as heterogeneous networks and use random walk-based methods such as Metapath2Vec <cit.>. 
However, Metapath2Vec does not integrate node features into the embedding process. Additionally, a meta-path in a bipartite graph can be equated to a naive unbiased random walk in homogeneous graphs. 


The second challenge is that the limited label issue and computational inefficiency become non-trivial when scaling up extremely large bipartite graphs. Limited labels prohibit supervised learning. For example, an e-commerce bipartite graph contains billions of users, and labeling every user requires tremendous effort, and is thus impractical. Normally, only an extremely small fraction of the billions of users is manually labeled, which is insufficient for supervised learning. Some unsupervised learning methods have been proposed to address this problem <cit.>. However, they either do not apply to bipartite graphs or are inefficient in scalability.
In terms of computational inefficiency, scaling up is difficult. Although sampling methods, such as GraphSAGE<cit.>, AS-GCN<cit.> and FastGCN<cit.>), have been proposed to deal with the scalability issue (uncontrollable neighborhood expansion across layers), when applied to bipartite, they are only able to propagate through multiple layers in the same feature domain by connecting indirect two-hop nodes, which significantly increases the edge number. Thus, their training speed and memory costs are still unsatisfied.

To address the limitations of existing methods, we propose cascade-BGNN (Bipartite Graph Neural Networks), a highly efficient graph neural network framework that we have developed and deployed in production. Cascade-BGNN outperforms current competitive baselines in terms of both effectiveness and efficiency in a large-scale bipartite graph where nodes and edges are on the order of millions or billions [Because of privacy and regulatory restrictions, in this paper, we only release a million-level dataset for the experimental demonstration.] - a graph that is 1000 times larger than typical applications of GNNs. These advantages are due to the three key designs of our Cascade-BGNN.

Domain-consistent. To represent the node features within different domains into a single representation, BGNN consists of two central operations: inter-domain message passing (IDMP) and intra-domain alignment (IDA). As illustrated in Fig.  <ref>, two node domains are represented as U and V, respectively. In each layer (depth) of BGNN, we formulate two simultaneous directions of information flow, one from U to V and the other from V to U, each of which is equipped with different weight filters. By aggregating information from another domain through the connected edges, IDMP can attain an inter-domain representation for each node, which is then fused with the raw feature in each node itself. For domain fusion, we propose an intra-domain alignment technique to minimize the divergence between raw features and the inter-domain representation by using adversarial models <cit.>, a tool that has been applied successfully for distribution matching. 


Self-Supervised. Most notably, BGNN is tailored for a limited-label setting. BGNN is a self-supervised learning framework, which is a form of unsupervised learning in which the data itself provides supervision. One may argue that a straightforward method to fuse the two domains is to concatenate the input feature of each node with its corresponding inter-domain representation as an enhanced output. Nevertheless, such a method requires using the final labels as supervised signals for the training process, which is not feasible in the limited label setting. 

Efficient in Large-Scale. Our model and training method co-design elegantly improve the scalability. We design a cascaded training method that allows for multi-stage training without supervision. That is, the training of the upper layer (depth k+1 in Fig. <ref>) begins only after the lower one (depth k in Fig. <ref>) has been trained completely. 
Cascaded training is clearly more memory-efficient than conventional end-to-end training method since it does not require restoration of all intermediate activation maps of neural layers. Additionally, in cascaded training, the domain shift in lower layers (i.e. the discrepancy between two domain features, which always exists during the early training phase) is not passed to higher ones. In contrast, in end-to-end training, this type of error accumulates as the depth increases. More details are discussed in § <ref>.


We provide theoretical analysis and empirical verification to demonstrate the advantages of Cascade-BGNN. Our theoretical analysis proves that domain alignment is able to make the representation distribution closer. Such distribution approaching causes information from one domain to be incorporated into the other. In our experiments, we contrast the performance of our algorithm with several unsupervised representation learning baselines: Node2Vec <cit.>, VGAE <cit.>, GraphSAGE <cit.>, and AS-GCN <cit.>. We use a large-scale bipartite graph dataset from the Tencent Platform and also construct three synthesized datasets based on the citation networks Cora, Citeseer, and PubMed <cit.>. For all benchmarks, BGNN outperforms other competitive baselines in terms of both effectiveness and efficiency, with a higher classification accuracy, faster training speed, and lower memory cost.








To our knowledge, this is the largest self-supervised representation learning framework for bipartite graphs. Our source code and large dataset are released for reproducibility and future research.



§ PROBLEM STATEMENT

We define Bipartite Graphs as follows: Let G=(U, V, E) be a bipartite graph (as illustrated in Fig. 1), where U and V denote the set of the two domains of vertices (nodes). u_i and v_j denote the i-th and j-th vertex in U and V, respectively, where i=1,2,...,M and j=1,2,...,N. There are only inter-domain edges, which are defined as E⊆U×V. e_ij represents the edge between u_i and v_j. The incidence matrix for set U is B_u∈ℝ^M×N and B_v∈ℝ^N×M for set V. B_u(i,j) = 1 if e_ij∈E, and B_u(i,j)=0  if  e_i j∉ E. 
The features of two sets of nodes can be formulated as X_u and X_v, respectively, where X_u∈ℝ^M×P is a feature matrix with x_u(i)∈ℝ^P representing the feature vector of node u_i, and X_v∈ℝ^N×Q is similarly defined.

A core assumption is that the number of nodes and edges in bipartite graphs might be extremely large (on the order of millions or billions) and that there are limited node-wise labels.

Our work focuses on designing a self-supervised node representation learning model that can exploit both topology information and distinct node features from two domains to improve the accuracy of downstream tasks (e.g., classification). 




§ PROPOSED MODEL: BGNN


In this section, we introduce Cascade-BGNN, Cascade Bipartite Graph Neural Networks, a self-supervised representation learning framework for large-scale bipartite graphs. We also summarize the overall algorithm and provide a theoretical analysis. 




  
Overall Framework

In general, bipartite graph representation learning aims to learn the embedding representation H_u∈ℝ^P^' and H_v∈ℝ^Q^' for nodes in group U and V, respectively. Let f_emb be a general bipartite graph embedding model with parameters θ. In order to embed distinct node features X_u and X_v, the representation of H_u and H_v is defined as follows:


    H_u, H_v    =    f_emb(X_u, B_u, X_v, B_v; θ)




The entire architecture of f_emb is illustrated in Fig. <ref>. There are three key designs within. The first is inter-domain message passing (IDMP), which is represented in blue in Fig. <ref>. Its goal is for one domain to aggregate information from the other domain through the connected edges. Formally, it can be expressed as:

    H_v → u   =    f_u(X_v, B_u; θ_u) 
    
    H_u → v   =    f_v(X_u, B_v; θ_v)

where f_u and f_v are the IDMP function for these two domains respectively, H_v → u (resp. H_u → v) represents aggregated information flowing from V (resp. U) to U (resp. V). More details of IDMP are provided in § <ref>.

Once the aggregated features from the opposite domain H_v → u, H_u → v are attached, we use intra-domain alignment (IDA) to fuse these two distinct features into a single representation. IDA is represented by orange in Fig. <ref>. Formally, we express it as:

    Loss_u = L_adv(H_v → u, X_u) 
    
    Loss_v = L_adv(H_u → v, X_v)

where L_adv is specified as an adversarial loss.  After one layer training through minimization of Eq. (<ref>)-(<ref>) in a self-supervised manner, we obtain the representation of the two domains H_u^1 and H_v^1. Further explanation for IDA is provided in § <ref>. We also provide a theoretical analysis in § <ref> to explain our design choice of the domain alignment.

The embedding of H_u^1 (resp. H_v^1) merely captures the one-hop topology structure of B_u (resp. B_v) as well as feature information from X_u and X_v. As presented in previous works <cit.>, the one-hop aggregation does not sufficiently characterize diverse graph structures, hence a multi-hop mechanism is required. Instead of leveraging the typical end-to-end training method, this paper develops a cascaded training method to drive multi-hop message passing. Additionally, cascaded training is far more scalable. We will detail the cascaded training in § <ref>.

secnumdepth


 §.§ Inter-Domain Message Passing (IDMP)


Formally, the adjacency matrix of a bipartite graph is 

    A = [ 0_u, u    B_u;    B_v 0_v, v ]


where B_u and B_v are incidence matrices for two partitions, respectively. For stability, we normalize B_u as B̂_u=D_u^-1 B_u, where D_u is the degree matrix of B_u. Similar normalization is done for B_v. The IDMP process is defined as 


    {[ H_v → u^(k) = σ(B̂_u H_v^(k) W_u^(k))                                      ; H_u → v^(k) = σ(B̂_v H_u^(k) W_v^(k))                                       ].


where σ denotes an activation function, such as ReLU, H_v → u^k∈ℝ^M×Q^' (resp. H_u → v^(k)∈ℝ^N×P^') are hidden features of the nodes in set U (resp. V) aggregated from the features in V (resp. U), and k indicates the depth index (note that when k=0, H^(0)_u = X_u, H^(0)_v = X_v are actually input features).

As we can see from Eq.<ref>, there are two distinctions between IDMP and conventional GCNs <cit.>: 1. IDMP only performs aggregation on each node's neighbor nodes without involving the node itself, while conventional GCN methods usually consider the self-loop computation; 2. The propagation is only one-hop-neighbor aware. The first distinction motivates us to further design an intra-domain alignment to take the self-input features into account, while the second one leads to our design in the cascaded training approach which enables multi-hop modeling and supports efficient training.



 §.§ Intra-Domain Alignment (IDA)


We introduce IDA from the perspective of the domain U. We design two types of alignment losses to align H_v → u with H_u. Our first alignment employs adversarial learning <cit.>. A discriminator is trained to discriminate between vectors randomly sampled from H_v → u and H_u. Conversely, IDMP (Inter-Domain Message Passing) is trained as a generator to prevent the discriminator from predicting accurately. As a result, this
becomes a two-player min-max game, where the discriminator aims to maximize the ability to identify two distinct feature representations, and IDMP aims to prevent the discriminator from doing so by making the encoded representation H_v → u (source) to approach H_u (target). After training, they will reach a Nash equilibrium, successfully aligned H_v → u and H_u.


Discriminator objective: we define parameters of IDA discriminator as θ and IDMP generator as ϕ. We denote P_θ, ϕ (source = 1|h) as the probability that the input feature vector h is from the source domain H_v → u. Conversely, source = 0 signifies that h is from the target domain H_u. The discriminator loss function is as follows:


    L_D(θ|ϕ) =    1/M∑_i=1^Mlog P_θ, ϕ (source = 0|h_u(i))
    
    -   1/N∑_i=1^Nlog P_θ, ϕ (source = 1|h_v→u(i))



Generator objective: in the generative setting, IDMP is trained to align the encoded representation H_v → u (source) to H_u (target) so that the discriminator is unable to distinguish them:


    L_G(ϕ|θ) =   1/N∑_i=1^Nlog P_θ, ϕ (source = 0|h_v→u(i))



During training, the discriminator and the generator are trained successively with gradient updates to optimize the two networks, respectively. In experiment § <ref>, when using this method for domain alignment, we call our model BGNN-Adv. 

Another intuitive approach is to utilize multi-layer perceptron (MLP) as IDA to project node features H_u and IDMP output H_v → u into the same feature space. This approach is relatively straight-forward, but we can compare it with BGNN-Adv to judge whether or not adversarial learning can align the domain effectively. Formally, we define the loss function for one set U as


    L_u = ||MLP(H^(i)_v → u)-H^(i-1)_u||_F


which is symmetric for set V. The multi-layer perceptron takes the IDMP output as its input and minimizes it with original features in a Frobenius norm. In the experiment § <ref>, we term our model BGNN-MLP when using MLP as IDA. We show that BGNN-Adv outperforms BGNN-MLP on the classification task. 



 §.§ Cascaded Training: Towards Efficient BGNN






We present the cascaded training design for our proposed BGNN. In Fig. <ref>, we depict a detailed diagram to illustrate our cascaded training process in comparison with the conventional end-to-end training paradigm. In cascaded training, we regard one depth (layer) training as training on a basic BGNN block (IDMP with IDA). Each depth completes its training with one-hop embedding in E epochs. Then, its trained embedding is used as the input for later training. This process is also illustrated in Fig. <ref>. Cascaded training is in contrast to the conventional end-to-end training paradigm (shown in Fig. <ref>), which propagates through multiple depths for a fixed number of hops to train the final embedding.

We argue that cascaded training can embed information from multi-hops in bipartite graphs, similarly to how GNN-based methods perform on general graphs. Additionally, cascaded training is more memory-efficient and also requires less training time. System-wise advantages demonstrate our design choice:
 
Only one depth training is alive. This indicates that our method requires a significantly lower memory cost. In Fig. <ref>, each depth in a cascaded architecture takes the final embedding from the previous depth as its input. This indicates that we can destroy model instance (release unused memory) in the previous depth and only keep one depth training alive throughout the entire training process. 

Avoid uncontrollable neighborhood expansion. On a large-scale graph, the uncontrollable neighborhood expansion of each node layer by layer leads to a low computational speed and high memory cost. Sampling methods like GraphSAGE <cit.> and AS-GCN <cit.> have been proposed to deal with this issue by reducing the number of neighborhood nodes in each layer. Compared to these methods, since the propagation of our architecture only happens one-hop, the neighborhood expansion issue is avoided, which consequently speeds up the training and reduces memory cost.



Robust in hyper-parameter tuning. Our cascaded architecture is robust in that it can be easily trained with minimal hyper-parameter tuning effort. By using cascaded training, the domain shift (i.e, the discrepancy between two domain features, which always exists during the early training phase) in lower depths will not be passed to higher ones; while in end-to-end training this kind of error accumulates as the depth increases.

With out statistical performance sacrifice. Notably, system-wise optimization does not sacrifice the statistical performance: multi-hop topology information can also be preserved by cascaded training, and it simultaneously reduces the memory cost and training time on large-scale bipartite graphs. 

We verified the advantages of cascaded training in § <ref> and  § <ref>.


 





 §.§ Algorithm




We summarize our overall implementation framework for Cascade-BGNN model in Algorithm <ref>, which is consistent with Fig. <ref> and Fig.  <ref>. The processes for set U and V are symmetric. Each step in the outmost loop proceeds as follows, where k represents the current layer and H^(k)_u, H^(k)_v are hidden representations in layer k. For every epoch, sampling is conducted on these hidden representations to get a mini-batch as input. After several epochs of training, the embedding representation of depth k can be learned and saved for k+1 layer training. The kth layer model instance and unused memory are released. The final representation can be extracted in the last layer K, which can then be used for downstream tasks. The time complexity per epoch for Cascade-BGNN is fixed at O(|E|) (|E| denotes the number of edges), where there is no neighborhood expansion along with layer (depth) in traditional end-to-end training.



 §.§ Theoretical Analysis


In this section, we show that the better the alignment of embedding space in IDA, the better the downstream model M performs on the node representation. We show this by theoretically analyzing the relationship between alignment effects and the difference between the loss function value on model M on these two domains representations when handling a node classification task. 

We denote the nodes' label by y and its representation vector by h. There are two domains, H_u and H_v→ u from output of IDMP. We assume that M outputs the conditional distribution of a node's label y based on its representation vector h and model parameter θ, denoted as P̂(y|v;θ). This gives the probability that a node has a label given the embedding vector of the node. We can write the loss function of the model M on one domain H_u as L_M, u:

    L_M, u = 𝔼(D(P̂_u(y|h;θ), P(y|h)))

where P(y|h) is the ground truth, and D(P_1, P_2) measures the distance of two distributions. P̂_u(y|h;θ) means that this prediction is based on training data from the U domain. We can rewrite the expectation as:

    L_M, u = ∑_hp_u(h) · D(P̂_u(y|h;θ), P(y|h))

where p_u(h) is the distribution in the embedding space. Similarly, the performance of the same model based on another domain H_v→ u training data can be measured by the loss function:

    L_M, v→ u    = 𝔼(D(P̂_v→ u(y|h;θ), P(y|h)))
        = ∑_hp_v→ u(h) · D(P̂_v→ u(y|h;θ), P(y|h))


We introduce a theorem:


If following inequalities are satisfied:

    D(P̂_u(y|h;θ), P̂_v→ u(y|h;θ)) < d, ∀ h ∈ H


    |p_u(h) - p_v→ u(h)|/p_v→ u(h) < ϵ, ∀ h ∈ H

Then we will have following inequality:

    L_M, u≤ (1 + ϵ) L_M, v→ u + d



The Proof for Theorem 1 can be found in the appendix.

This theorem shows that by optimizing the representation on the domain H_v→ u, we are also improving the representation on the domain H_u, which is in the form of achieving a lower loss bounded by L_M, v→ u on the downstream classification model M in equation Eq. <ref>. The closer loss of these two domains produces a similar embedding space, which captures information from both domains. Thus, in order to achieve this, we need to make ϵ and d in Eq. <ref> and <ref> smaller. In other words, we need to force distribution p_u(h) and p_v→ u(h) to keep close in the same embedding space. Furthermore, if two domains are close in the embedding space, then models trained on these two domains should output similar classification distributions, which guarantees to have a smaller probability distance in Eq. <ref>. We achieve the above goals through adversarial learning in BGNN. Consequently, this distribution alignment by IDA is guaranteed to capture information from both domains and result in better representation. 



§ EXPERIMENTS


We design our experiments with the goals of (i) providing a rigorous comparison of the graph representation performance between our BGNN model and state-of-art baselines,  (ii) verifying domain alignment and cascaded training, (iii) evaluating the BGNN efficiency of space and time complexity on a large-scale dataset.


 §.§ Dataset

In this section, we introduce datasets that we used for experiments and the methods that we prepossessed these datasets.



Tencent - Social Networks. This is a large-scale real-world social network represented by a bipartite graph. Nodes in set U are social network users, and nodes in set V are social communities (e.g., a subset of social network users who share the same interests in electrical products may join the same shopping community). Both users and communities are described by dense off-the-shelf feature vectors.  The edge connection between two sets indicates that the user belongs to the community. Note that this dataset provides classification labels for research purposes. In real-world applications, labeling every node is impractical.

Cora, Citeseer, PubMed - Citation Networks. These are synthetic bipartite graph datasets that are generated from citation networks (single graph) where documents and citation links between them are treated as nodes and undirected edges, respectively. 











Data Preprocessing. The process that we synthesize the bipartite graphs from citation networks is as follows: We process the Cora, CiteSeer, and PubMed datasets similarly and treat the original graph as an undirected graph. First, we divide the paper documents of each class into two equal-sized subsets. Then, we combine the first half of all classes into the U group and the second half into the V group. We remove some of the features of papers in the V group to introduce heterogeneity between U and V.  Lastly, we only keep edges that connected a paper in U group and a paper in V group and remove all other edges to make the graph bipartite. All isolated nodes are removed. Note that the parameters used for preprocessing do not affect the fairness of the comparison: we have verified that the relative ranking of the performance comparison on different baselines will not change with differing split proportions and dimensional heterogeneity.

As the Tencent dataset is already a bipartite graph, there is no need to change the graphical structure. To simplify the data loading process, we maintain the same format as the citation network datasets. The statistics of our datasets are summarized in Table <ref>. 


















 §.§ Experimental Settings






Baselines for comparison. We mainly compare our BGNN algorithm against four unsupervised node embedding baselines: 

    
  * Raw features: This indicates a naive solution in which only raw features are used as input for the classification model, without using any graph structure information incorporated.
    
  * Node2Vec <cit.>: This approach is an extension of Word2Vec <cit.> on graph, which learns a feature representation by simulating biased random walks on the graph. We run Node2Vec on the bipartite graph and then concatenate the node embeddings with their own features.
    
  * VGAE <cit.>: This method is based on a variational auto-encoder, where GCN is used as an encoder and a simple inner product as a decoder to embed the nodes into a low-dimensional feature space.
    
  * GraphSAGE-MEAN, GraphSAGE-GCN
    <cit.>: We implement two types of aggregator functions: GCN and MEAN aggregator. Node-wise sampling is used to address the scalability issue. 
    
  * AS-GCN <cit.>: This method uses adaptive sampling between each layer to deal with node explosion in large-scale graphs. Since this method is originally designed for supervised learning, we only compare its scalability in § <ref>.

Note that we do not compare our method with other baselines, e.g. Methpath2vec++, because these models are not tailored to bipartite graphs: they cannot embed distinct features in two domains into a single representation; meta-path in bipartite graphs is the same as unbiased random walk in one of two subgraphs. Therefore, node2vec is adequate to represent them as baselines. 

We cannot directly apply GCN to bipartite graphs due to the inconsistency of the nodes’ feature dimensions in the two bipartite partitions. To make the comparison available, we reconstruct the bipartite graph into two subgraphs, where each only contains nodes from one partition with their two-hops connection through the opposite partition, as shown in Fig. 1. Through this conversion, GCN based methods can be implemented on two partitions, each with the same feature dimensions respectively, but still containing the original connectivity information in bipartite graphs. 

For each baseline model, we follow the open-source implementation from the authors' original paper (in the appendix, we introduced the source code we used). In order to provide a fair comparison, we also tune the hyper-parameters for every baseline and report the best results among them. 
For the adversarial learning in IDA, we use a hyperbolic function as the non-linear activation function in the graph convolution networks. The dropout and L2 regularization are applied to each layer to prevent overfitting. During training, we use mini-batch to reduce the memory and computational cost for the large-scale dataset. We found that the optimal batch size for all four data set is near 500, and it only requires around 3 epochs on each data set to quickly converge to the best result. More details about parameter settings for each dataset are shown in the appendix.

Experiments are conducted on a GPU server with 8 Tesla V100 cards. We describe more details about our tailored system for our BGNN in the Appendix.



 §.§ Evaluation Results



We evaluated our BGNN results on a classification downstream task with F_1 score <cit.> which is a popular metric for classification. For binary classification on the Tencent dataset, we report F_1 scores. For other multi-classification tasks, we use both micro- and macro-averaged F_1 scores.

Performance comparison. From Table <ref> we can see that BGNN-Adv achieves the best performance on bipartite graph representation learning. BGNN surpasses other methods on both large and small data sets, suggesting its effectiveness in capturing both inter-domain and intra-domain information. Particularly on the Tencent large-scale bipartite graph, BGNN-Adv achieves a 29% gain over the raw feature baseline. In the PubMed dataset, due to the balanced degree distribution, even incorporating the graph structure information into the model can only marginally improve the accuracy. However, BGNN still achieves the best results among other baselines, which verifies that it also has a better capacity to embed more information on different long-tail datasets and balanced datasets. The overall evaluation proves that Cascade-BGNN, using distinct features and topology information, is effective for graph representation learning.






 §.§ Effect of Distribution Alignment


In this section, we conduct ablation studies for the IDA component. For domain fusion, one straightforward method is to concatenate the input feature of each node with its corresponding inter-domain representation as an enhanced feature vector. Nevertheless, such a simple concatenation requires supervising signals, which are not feasible for large-scale graphs that only have very limited node labels. Therefore, to demonstrate the effectiveness of IDA, our ablation studies still focus on unsupervised learning.




Comparison with the feature concatenation method. To show the importance of distribution alignment, we compare BGNN with raw features (Raw features in Table 3) input and feature aggregated from another domain (Feature aggregation in Table 3) without any adversarial training. The result is shown in Table 3. BGNN-Adv significantly outperforms these two naive baselines that have no distribution alignment. Both baselines only contain part of the information from the entire graph, which provides a limited representation. This also corresponds with our theory that merging information from two domains in a bipartite graph will lead to improvement in the final representation.




BGNN-Adv v.s. BGNN-MLP. We replace the adversarial IDA into MLP for self supervision, which we introduced in  § <ref>. Compared to BGNN-Adv, BGNN-MLP shows lower prediction results. The reason is that MLP only performs linear mapping in high dimensions between two domains distribution, which limits its ability in nonlinear type distribution alignment typically seen in high dimensions.




 §.§ Effect of Cascaded Training


In this section, we verified our cascaded training design by comparing it with end-to-end training and evaluating the results on different amounts of cascaded layers.

Self-supervised training loss. We demonstrate the training loss of cascaded architecture. During each layer of training, we wait until the loss functions converge before continuing to the next layer step. To reduce the memory cost, rather than training two domains simultaneously in each layer, we alternatively select one domain to train the model. 



The adversarial training loss function of BGNN is shown in Fig. <ref> where we only plot training losses of the first and second layers due to limited space. The generator and discriminator losses clearly demonstrate that the IDA performs an intra-domain alignment in an adversarial way. 








Comparison with end-to-end training. To compare cascaded training with end-to-end training, we specify an end-to-end training architecture in which there are multiple successive IDMP layers and one IDA output layer. In each IDMP layer, one domain's output, the hidden node vector, is the concatenation of raw features and another domain's aggregated node features obtained by IDMP operation. IDA is performed as the final output in an unsupervised manner. The results for comparison are shown in Table <ref>. We well-tuned the IDMP layer number for end-to-end training and find that the architecture with two IDMP layers achieves the best performance. The results demonstrate that our cascaded architecture achieves better performance on multiple datasets. In other words, this experiment verifies that cascaded training does not sacrifice statistical performance. We can also see from the results that end-to-end training runs out of memory (OOM) in the large-scale dataset Tencent. Since cascaded training also has system-wise benefits, such as faster training and lower memory cost (details are discussed in § <ref>), it is crucial for large-scale bipartite graphs.

Effect of cascaded layer number. With deeper cascaded training layers, the model can not only embed multi-hops information into the final representation but can also do so without expanding the memory cost and uncontrollable neighborhood expansion. The experiments in Fig. <ref> show the resultsa of Micro F_1 score of the downstream classification task along with the increase in the number of cascaded layers. Our observations and analysis are as follows:


    
  * Without cascaded architecture, a single layer BGNN has a relatively lower performance on all datasets. Particularly, a single layer BGNN means that there is no cascaded architecture during learning; only one-time optimization is performed. The reason is that a single layer only embeds one-hop neighbor information in the final representation. 
    
  * Cascade-BGNN can achieve the best performance when there are two layers. Beyond two layers, the improvement is minimal, and even decreases slightly. This phenomenon is attributed to two reasons: 1. in the bipartite setting, nodes in two domains normally represent entirely different entities (e.g., user and community). Consequently, one node may not have enough of a correlation with its multi-hop connected node from the opposite domain. 2. Techniques that can train truly deep GNN are in demand. We suggest that future research may address this problem by incorporating/exploring the use of trained parameters from previous layers.




 §.§ Evaluation the efficiency of BGNN on large-scale Bipartite Graphs






We developed a graph system based on Cascade-BGNN, which is introduced in the Appendix.
In order to compare the scalability of BGNN against the baselines, we measure the training time and memory cost of algorithms on the Tencent large-scale dataset. As demonstrated in Fig. <ref>, BGNN greatly outperforms baselines in terms of both space and time requirements. This final result is due to our experimental observations beforehand: (1) BGNN does not need to load the entire graph into memory–only one mini-batch is needed. However, all other methods require one to fill the graph into memory first, which corresponds to the huge increase in memory cost at the start of training. (2) BGNN does not require sampling in each graph convolutional layer and thus avoids an additional time-consuming procedure. (3) The unique unsupervised learning loss in BGNN based on adversarial learning does not require further computational processes. For example, in GraphSAGE, the unsupervised loss is based on random walks, causing it to increase significantly with the graph size. Additional nodes and a longer walk length are needed to maintain high performance, which consequently requires an even longer training time and a larger memory cost. (4) in § <ref>, we introduced that using cascaded training saves memory and avoids uncontrollable neighborhood expansion, reducing the memory cost and expediting training. 




§ RELATED WORK


Graph representation learning methods typically can be classified into two groups, supervised and unsupervised learning.

Unsupervised methods <cit.> traditionally use the adjacency matrix to define and measure the similarity among nodes for graph embedding, which is referred to as matrix factorization. Other works explore using random walks on graphs to learn representation with the skip-gram model. DeepWalk <cit.> and Node2vec <cit.> are typically representative of these methods to model homogeneous graphs. Some others extend this to heterogeneous graphs, where different nodes are in distinct feature domains, such as MethPath2Vec <cit.> and PTE <cit.>. Although all these methods do not require node labels in their representation learning, they are shallow embedding approaches and have the following drawbacks. First, the nodes' features and graph structure are independent in the learning methods. Second, they are not efficient when applied to large- scale graphs. Third, the embeddings are transductive hence unseen nodes cannot be embedded with the model being learned so far.

As for supervised methods, the state-of-art graph-based neural networks have been used to learn node representation with the guide of node labels
<cit.>. In general, these methods perform a convolution by aggregating the neighbor nodes' information so that each node can learn a relationship between the nodes in the entire graph. However, these methods are task-specific: in another word, they require labels in downstream tasks to supervise the models. Some works <cit.> try to utilize GCN to do unsupervised learning on graphs by performing a random walk or matrix completion on the output of GCN embeddings. However, these approaches still face the same problems above. 









§ CONCLUSION


In this paper, we propose Cascade-BGNN, a self-supervised node representation learning framework for bipartite graphs. Cascade-BGNN is domain-consistent, self-supervised, and efficient. Within Cascaded-BGNN, we propose Inter-domain Message Passing (IDMP) as the encoder and Intra-domain Alignment (IDA) by adversarial learning to address the node feature inconsistency issue. We further designed the cascaded training method to capture the multi-hop relationships in local bipartite structure, as well as to improve the scalability. Extensive experiments and theoretical analysis confirmed the effectiveness and efficiency of our models. 
 
 




abbrv



§ APPENDIX






This supplementary material provides source code for reproductivity, more details of the dataset, hyper-parameter settings, more experiment results, the infrastructure, and the future extension to large-scale bipartite graph system.





§ SOURCE CODE FOR REPRODUCTIVITY

Source code. For experiment results reproductivity, we store this paper's source code at http://bit.ly/Cascade-BGNN. Since we may refactor our code for further research, we maintain the original version of our code in this URL. We also provide the data that we use in this paper for running experiments. Besides the BGNN model, we also provide baseline codes we use in our experiments. Each model's code is organized in an independent directory. In order to help reproduce our results efficiently, in the README.md file at the root directory, we organize a table of scripts for training procedure.



§ EFFICIENT TRAINING SYSTEM




We depict a detailed diagram to illustrate our cascaded training pipeline from the perspective of set U, shown in Fig. <ref>. The step order is shown as a circle within a number. In step 1, we sample a mini-batch of node feature vectors from group U (e.g., u_1 and u_2 with red color). In step 2, the QUERY operation takes the sampled node vectors as input and queries their neighbor node vectors from the opposite set V (e.g, the queried neighbor vectors are v_1, v_2, v_3, and v_5 with green color). The inter-domain message passing is in step 3 where neighbor vectors are aggregated to h_v → u. Then in step 4, the IDA (intra-domain alignment), taking sampled node vectors in U and their aggregated neighbor vectors h_v → u, as input is trained with an adversarial loss. After iterating all mini-batches with multiple epochs, the learned H_u is saved for (k+1)th depth cascaded training. This pipeline is consistent with Algorithm 1.



§ PROOF OF THEOREM 1

Here we give a proof of Theorem <ref>.

Note that for D(P_1, P_2) measuring the distance of two distributions we have:

    D(P_1, P_3) ≤ D(P_1, P_2) + D(P_2, P_3)

We then have:

    L_M, u - L_M, v→ u    = ∑_hp_u(h) · D(P_u(y|h;θ), P̂(y|h))
        - ∑_hp_v→ u(h) · D(P_v→ u(y|h;θ), P̂(y|h))
       ≤∑_h(p_u - p_v→ u)(h) · D(P_v→ u(y|h;θ), P̂(y|h))
        + ∑_hp_u(h) · D(P_u(y|h;θ), p_v→ u(y|h;θ)) 
        = ϵ L_M, v→ u + d






§ MORE EXPERIMENTAL EVALUATIONS

In this section, we provide more information related to our paper, including detailed analysis of datasets and models implementation details.



 §.§ Model Implementation Details


Logistic regression.  In order to evaluate our model output embedding performance, we use logistic regression to predict the nodes' label. We use the logistic SGDClassifier from scikit-learn Python package. We split the nodes into 80 percentage for training and the rest for testing (30% for validation).

Model Implementation. We use the code of baselines published by the author of the original paper. We summarize the baseline code we use in Table <ref>. We follow the parameter settings in their original papers and fine-tuned on our bipartite datasets. The Node2Vec is a high-performance version (C++), so its running time is comparable to ours. Since all the baselines are not designed for heterogeneous bipartite graph, in order to make a fair comparison with our models, we first transform the bipartite graph into a simple connected graph. We multiply the incidence matrix with its transpose to extract all two-hops connection. Since it is a bipartite graph, the two-hops connection of one set will only contain nodes in the exact same set. Through this simple transformation, the graph becomes to a single homogeneous graph, and all the baselines can achieve on it. 




Hyper-Parameters.  We use a grid-search to tune our model on every dataset to find the best hyperparameters. Here, we list all the final hyperparameters of BGNN for different datasets. 


As for epochs, we first search in a wide range and find that with small epochs size will achieve better performance. This also proves the reason why our model requires less training time. The BGNN-MLP model contains two dense layers with rectified activation layer and dropout layer in between. The output of the decoder is aligned in the range [-1, 1] using hyperbolic tangent, which is the same distribution as the input features. As for BGNN-Adv model, the discriminator also contains two dense layers but with leaky rectified activation layer, which can avoid sparse gradient problem.  




 §.§ More Experimental Results on Large-Scale Dataset

Training loss.
Here we further show the training loss of BGNN-MLP model versus iterations on Pubmed dataset in Fig. <ref>. The reason is that PubMed is a medium-size dataset with balanced degree distribution, so it is a great dataset to illustrate. The loss function converges after around 500 iterations. The detail parameter settings can be found in table <ref>.




