Rethinking and Scaling Up Graph Contrastive Learning: An Extremely Efficient Approach with Group Discrimination
Abstract
Graph contrastive learning (GCL) alleviates the heavy reliance on label informationfor graph representation learning (GRL) via self-supervised learning schemes.
The core idea is to learn by maximising mutual information for similar instances,which requires similarity computation between two node instances.
However, GCL is inefficient in both time and memory consumption.
In addition, GCLnormally requires a large number of training epochs to be well-trained on largescale datasets.
Inspired by an observation of a technical defect (i.e., inappropriateusage of Sigmoid function) commonly used in two representative GCL works,
DGI and MVGRL, we revisit GCL and introduce a new learning paradigm forself-supervised graph representation learning, namely, Group Discrimination (GD),and propose a novel GD-based method called Graph Group Discrimination ( GGD ).
Instead of similarity computation, GGD directly discriminates two groups of nodesamples with a very simple binary cross-entropy loss.
In addition, GGD requiresmuch fewer training epochs to obtain competitive performance compared with GCL methods on large-scale datasets.
These two advantages endow GGD with veryefficient property.
Extensive experiments show that GGD outperforms state-of-theart self-supervised methods on eight datasets.
In particular, GGD can be trained in0.18 seconds (6.44 seconds including data preprocessing) on ogbn-arxiv, whichis orders of magnitude (10,000+) faster than GCL baselines while consumingmuch less memory.
Trained with 9 hours on ogbn-papers100M with billion edges, GGD outperforms its GCL counterparts in both accuracy and efficiency.
Introduction
Graph Neural Networks (GNNs) have been widely-adopted in learning representations for graphstructured data.
With message-passing to utilise the topology of a graph, GNNs can learn effectivelow-dimensional node embeddings, which can be used for a variety of downstream tasks such as nodeclassification [1], link prediction [2], and graph classification [3].
GNNs have been further applied indiverse domains, e.g., social networks [4], recommendation system [4], and anomaly detection [5, 6].
However, many GNNs adopt a supervised learning manner to train models with label information,which is expensive and labour-intensive to collect in real-world.
To address this issue, a few studies(e.g.
, DGI [7], MVGRL [3], GMI [8], GRACE [9], and Subg-Con [10]) borrow the idea of contrastivelearning from computer vision (CV), and introduce Graph contrastive learning (GCL) methods forself-supervised GRL.
The core idea of these methods is to maximise the mutual information (MI)between an anchor node and its positive counterparts, sharing similar semantic information whiledoing the opposite for negative counterparts as shown in Figure 1(a).
Nonetheless, such a schemerelies on similarity calculation in contrastive loss computation.
Additionally, GCL normally requires a large number of training epochs to be well-trained on large-scale datasets.
Thus, when the size of thedataset is large, these methods require a significant amount of time and resources to be well-trained.
[Figure]
Though a few GCL works attemptto improve graph contrastive learningwith specially designed schemes, e.g.,
BGRL [12] and GBT [13], they arestill inefficient and require high timeconsumption for model training.
Inspired by BYOL [14], BGRL [12]adopts a bootstrapping scheme and remove negative node pairs.
It only contrasts a node from the online network(i.e.
, updated with gradient) to its corresponding embedding from the target network (i.e., updated momentumlywith stop gradient).
Based on BarlowTwins [11], GBT [13] borrows the ideaof redundancy-reduction principle andutilises a cross-correlation-based loss to build contrastiveness between embedding dimensions.
total training time, which is ( Epo × Tr ). ‘Imp(E)’ and ‘Imp(T)’ indicate how many times GGD improve on ‘Total(E)’ and ‘Total(T)’. ‘Acc’ is averaged accuracy result on test set over five runs.
[Table]
To boost training efficiency of self-supervised
GRL, inspired by an observation of a technicaldefect (i.e., inappropriate application of Sigmoidfunction) in two representative GCL studies, weintroduce a novel learning paradigm, namely,
Group Discrimination (GD).
Instead of similarity computation, GD directly discriminates agroup of positive nodes from a group of negative nodes, as shown in Figure 1(b).
Specifically, GD defines node samples generated withoriginal graph as the positive group, while nodesamples obtained with corrupted topology areregarded as the negative group.
Then, GD trainsthe model by classifying these node samplesinto the correct group with a very simple binary cross-entropy loss.
By doing so, the modelcan extract valuable self-supervised signals fromlearning the edge distribution of a graph.
Compared with GCL, GD enjoys numerous meritsincluding extremely fast training, fast convergence (e.g., 1 epoch to be well-trained on large-scaledatasets), and high scalability while achieving SOTA or on par performance with existing GCLapproaches.
Using GD as backbone, we design a new self-supervised GRL model with the Siamese structurecalled Graph Group Discrimination (GGD).
Firstly, we can optionally augment a given graph withaugmentation techniques, e.g., feature and edge dropout.
Then, the augmented graph is fed into a
GNN encoder and a projector to obtain embeddings for the positive group.
After that, the augmentedfeature is corrupted with node shuffling (i.e., disarranging the order of nodes in the feature matrix)to disrupt the topology of a graph and input to the same network for obtaining embeddings ofthe opposing group.
Finally, the model is trained by discriminating the these two groups of nodesamples.
The contributions of this paper are three-fold: 1) We introduce a novel and efficientself-supervised GRL paradigm, namely, Group Discrimination (GD).
Based on GD, we proposea new self-supervised GRL model, GGD, which is fast in training and convergence, and possesshigh scalability.
We conduct extensive experiments on eight datasets, including an extremelylarge dataset, ogbn-papers100M with billion edges.
The experiment results show that our proposedmethod reaches state-of-the-art performance while consuming much less time and memory thanbaselines, e.g., 10783 × faster than the most efficient GCL baseline with its best selected epochsnumber [13], as shown in Table 1.
Rethinking Representative GCL Methods
[Figure]
In this section, we analyse a technical defectobserved in two representative GCL methods,
DGI [7] and MVGRL [3].
Based on the technical defect, we show the learning method behindthese two approaches is not contributed to Contrastive Learning, but a new paradigm, Group
Discrimination.
Finally, from the analysis, weprovide the definition of this new concept.
2.1 Rethinking GCL Methods
[Figure] DGI [7] is the first work introducing Contrastive [Figure]
Learning into GRL.
However, due to a techni-
[Figure]
cal defect observed in their official open-source
[Figure] code, we found it is essentially not working as [Figure] the authors thought (i.e., learning via MI interaction).
The backbone that truly makes it work is a new paradigm, Group Discrimination.
[Figure]
Constant Summary Vector.
As shown in Figure 2, the original idea of DGI is to maximise the MI(i.e.
, the red line) between a node a and the summary vector s , which is obtained by averaging allnode embeddings in a graph G .
Also, to regularise the model training, DGI corrupts G by shuffling thenode order of the input feature matrix to get ˜ G .
Then, generated embeddings of ˜ G serve as negativesamples, which are pulled apart from the summary vector s via MI minimisation. [Figure] [Table] [Figure]
[Table]
[Figure]
[Table]
Nonetheless, in the implementation of
DGI, a Sigmoid function is inappropriately applied on the summary vectorgenerated from a GNN whose weightis initialised with Xavier initialisation.
As a result, elements in the summaryvector are very close to the same value.
We have validated this finding on threedatasets, Cora, CiteSeer and PubMed.
The experiment result is shown in Table 2, which shows that summary vectors in all datasets are approximately a constant vector ϵI , where ϵ is a scalar and
I ∈
R D is anall-ones vector (i.e., ϵ =0.50 with ReLU/LReLU/PReLU and ϵ =0.62 with Sigmoid as non-linearactivation in these datasets).
[Table]
To theoretically explain this phenomenon, we presentthe theorem below:
Theorem 1 Given G =
( X ∈ R N × D , A ∈ R N × N ) ,and a GCN encoder g () initialised with Xavier initialisation, we can obtain its embedding H =
g ( G ) .
Then, when D increases, the value in H converges to0.5 with ReLU/LReLU/PReLU or 0.62 with Sigmoidas non-linear activation for g () at the initialisation stage.
Based on this theorem, we can see if the feature dimension D is large, these summary vectors canlose variance and become a constant vector at the initialisation stage.
Based on Table 3, we can seethe constant in the summary vector remain unchanged, and the information loss still occurs even ifthe GNN encoder is trained.
Thus, we conjecture the training process won’t affect the constant valuemuch in the summary vector of DGI.
The proof for the theorem is presented in Appendix A.1.
To evaluate the effect of ϵ to constant summary vector, we vary the scalar ϵ (from 0 to 1 incrementby 0.2) to change the constant summary vector and report the model performance (i.e., averagedaccuracy on five runs) in Table 3.
From this table, we can see, except for 0, the model performance is trivially affected by ϵ for constantsummary vector.
When the summary vector is set to 0, the model performance plummets becausenode embeddings become all 0 when multiplying with such vector and the model converges to thetrivial solution.
As the summary vector only has a trivial effect on model training, the hypothesis of
DGI [7] on learning via contrastiveness between anchor nodes and the summary instance does nothold, which raises a question to be investigated: What truly leads to the success of DGI?
Simplifying DGI.
To answer the question, we predigest the loss proposed in DGI by using an all-onesvector as the summary vector s (i.e., setting s = ϵI
= I ) and simplifying the discriminator D (i.e.,removing the learnable weight vector).
Then, we rewrite the loss to the following form:
[Equation]
where · is the vector multiplication operation, N is the number of nodes in a graph, z i ∈ R 1 × D and˜ z i ∈ R 1 × D are the original and corrupted embedding for node i , sum () is the summation function,and D is a discriminator for bilinear transformation, which can be formulated as follows:
[Equation]
[Table]
where w is a learnable weight vector.
Specifically, asshown in Equation 2, by removing the weight vectorw , z i is directly multiplied with s .
As s is a vectorcontaining only one, the multiplication of z i and s isequivalent to summing z i itself directly.
From thisform, we can see that the multiplication of z i and thesummary vector only serves as an aggregation function (i.e., summation aggregation) to aggregate z i .
Toexplore the effect of other aggregation functions, wereplace the summation function in Equation 1 withother aggregation methods such as mean-, minimum-,and maximum- pooling, and present the experimentresult in Appendix A.3.
Based on Equation 1, we can rewrite it to a very simple binary cross entropy loss if we also includecorrupted nodes as data samples and setting h i =
agg ( z i ) , where agg () stands for aggregation:
[Equation]
[Equation]
where y i ∈ R 1 × 1 means the indicator for node i (i.e., if node i is corrupted, y i is 0, otherwise it is
1),and h i ∈
R 1 × 1 represents the prediction for a node sample i .
As we include corrupted nodes as datasamples, the size of nodes to be processed is doubled to 2 N (i.e., the number of corrupted nodes isequal to the number of original nodes).
From the equation above, we can easily observe that what
DGI truly does is discriminate between a group of nodes generated with correct topology and nodesgenerated with corrupted topology, as shown in Figure 1.
We name this self-supervised learningparadigm " Group Discrimination ".
To validate the effectiveness of this paradigm, we replace theoriginal DGI loss with Equation 3, namely, DGI BCE and compare it with DGI on three datasetsin terms of training time, memory efficiency and model performance as shown in Table 4.
Here,
DGI BCE adopts the same parameter setting as DGI.
From this table, we can observe DGI BCEdramatically improves DGI in both memory- and time-efficiency while it slightly enhances the modelperformance of DGI.
This may be contributed to the removal of multiplication operations betweennode pairs, which eases the burden of computation and memory consumption.
Similar to DGI, the same technical defect is observed in MVGRL [3], which makes it become a
GD-based method.
Extended on DGI, MVGRL [3] incorporates diffusion augmentation to inject additional global information into model training, which enhances the model performance.
Thedetailed analysis for MVGRL is presented in Appendix A.4.
2.2 Definition of Group Discrimination
[Figure]
As mentioned above, Group Discrimination is a self-supervised GRL paradigm, which learns by discriminating different groups of node samples.
Specifically, the paradigm assigns different indicatorsto different groups of node samples.
For example, for binary group discrimination, one group isconsidered as the positive group with class 1 as its indicator, whereas the other group is the negativegroup, having its indicator assigned as 0.
Given a graph G , the positive group usually includes nodesamples generated with the original graph G or its augmented views (i.e., similar graph instances of Gcreated by augmentation).
In contrast, the opposing group contains negative samples obtained bycorrupting G , e.g., changing its topology structure.
Based on our theoretical analysis, group discrimination is learning to avoid making ‘mistakes’ (i.e.,bias the encoder towards avoiding mistaken samples), thus improving the quality of generated nodeembeddings.
The detailed analysis and an intuitive explanation are presented in Appendix A.2.1.
Methodology
[Figure]
We first define unsupervised node representation learning and then present the architecture of GGD ,which extends DGI BCE with additional augmentation, the projector and embedding reinforcementto reach better model performance.
Given a graph G with attributes X ∈ R N × D , where N is thenumber of nodes in G , and D is the number of dimensions of X , our aim is to train a GNN encoderwithout the reliance on labelling information.
With the trained encoder, taking G and X as input, itcan output learned representations H ∈ R N × ˆ D , where ˆ D is the predefined output dimension.
H canthen be used in many downstream tasks such as node classification.
3.1 Graph Group Discrimination
Based on the proposed self-supervised GRL paradigm, Group Discrimination, we have designed anovel method, namely GGD , to learn node representations using a Siamese network structure and a
BCE loss.
The architecture of the GGD is presented in Figure 3.
The framework mainly consists offour components: augmentation, corruption, a Siamese GNN network, and Group Discrimination.
Augmentation.
With a given graph G and feature matrix X , optionally, we can augment it withaugmentation techniques such as edge and feature dropout to create ˆ G and ˆ X .
In practice, we follow theaugmentation proposed in GraphCL [15].
Specifically, edge dropout removes a predefined fraction of edges, while we use node dropout to mask a predefined proportion of feature dimension, i.e., assigning0 to replace values in randomly selected dimensions.
This step is optional in implementation.
Notably, the motivation of using augmentation in our framework is distinct from contrastive learningmethods.
In our study, augmentation is used to increase the difficulty of the self-supervised trainingtasks.
With augmentation, ˆ G and ˆ X change in every training iteration, which forces the model to lessenthe dependence on the fixed pattern (i.e., unchanged edge and feature distribution) in a monotonousgraph.
However, in Contrastive Learning, augmentation creates augmented views sharing similarsemantic information for building contrastiveness.
Corruption.
ˆ G and ˆ X are then corrupted to build ˜ G and ˜ X for the generation of node embeddings inthe negative group.
We adopt the same corruption technique used in DGI [7] and MVGRL [3] (asshown in Figure 5 in Appendix A.2.
The corruption technique devastates the topology structure of ˆ Gby randomly changing the order of nodes in ˆ X .
The corrupted ˜ X and ˜ G can be used for producingnode representations with incorrect network connections.
The Siamese GNN.
We have designed a Siamese GNN network to output node representations givena graph and its attribute.
The Siamese GNN network is made up of two components, which are a
GNN encoder and a projector.
The backbone GNN encoder is replaceable with a variety of choicesof GNNs, e.g., GCN [16] and GAT [17].
In our work, we adopt GCN as the backbone.
The projectoris a multi-layer perceptron network, whose number of layers can be adjusted.
When generating nodeembeddings of the positive group, the Siamese network takes ˆ G and ˆ X as input.
Using the sameencoder and projector, the Siamese network output the negative group with ˜ G and ˜ X .
These twogroups of node embeddings are considered as a collection of data samples with a size of 2 N fordiscrimination.
Before conducting group discrimination, in the “aggregation” phase, all data samplesare aggregated with the same aggregation technique, e.g., sum-, mean-, and linear aggregation.
Group Discrimination.
In the group discrimination process, we adopt a very simple binary crossentropy (BCE) loss to discriminate two groups of node samples as shown in Equation 3.
In ourimplementation, y i is 0 and 1 for node embeddings in negative and positive groups.
During modeltraining, the model is optimised by categorising node embeddings in the collection of data samplesinto their corresponding class correctly.
The loss is computed by comparing the prediction of a nodei , i.e., a scalar, with its indicator y i .
With the ease of BCE loss computation, the training process of
GGD is very fast and memory efficient.
3.2 Model Inference
During training, the model is optimised via loss minimisation with Equation 3.
The time complexityanalysis of GGD is provided in Appendix A.5.
In the inference phase, we freeze the trained GNNencoder g θ and obtain node embeddings H θ with the input G .
Inspired by MVGRL [3], which strengthens the output embeddings by including additional globalinformation, we adopt a conceptually similar embedding reinforcement approach.
Specifically, theyobtain the final embeddings by summing up embeddings from two views: the original view comprisinglocal information and the diffused view with global information.
This operation reinforces the finalembeddings and leads to model performance improvement.
Nonetheless, graph diffusion impairs thescalability of a model [18] and hence cannot be directly applied in our embedding generation.
Toavoid the diffusion computation, we have come up with a workaround in the virtue of the power of agraph to extract global information.
The power of a graph can extend the message passing scope of
H θ to n-hop neighbourhood, which encodes global information from distant neighbours.
It can beformulated as follows:
[Equation]
where H globalθ is the global embedding, and A is the adjacency matrix of the graph G .
It is notable thatthis operation can be easily decomposed with the associative property of matrix multiplication and iseasy to compute.
To show the easiness of such computation, we conduct an experiment showing itstime consumption on various datasets in Appendix A.6.
Finally, the final embedding can be achievedby H =
H globalθ + H θ , which can be used for downstream tasks.
In our experiment, we conduct nodeclassification tasks.
Following the common practice of GCL methods [7, 9, 12, 8, 11], these tasks areperformed by using the final embeddings H to train and test a simple logistic regression classifier.
Related Work
Graph Neural Networks (GNNs) are generalised deep neural networks for graph-structured data.
GNNs mainly have two categories, spectral-based GNNs and spatial-based GNNs.
Spectral GNNsattempt to use eigen-decomposition to obtain the spectral-based representation of graphs, whereasspatial GNNs focus on using spatial neighbours of nodes for message passing.
Extending spectralbased methods to the spatial domain, GCN [16] utilises first-order Chebyshev polynomial filters toapproximate spectral-based graph convolution.
Taking the weight of spatial neighbours in consideration, GAT [17], improves GCN by introducing the attention module in message passing.
To decouplemessage passing from neural networks, SGC [19] simplifies GCN by removing the non-linearity andweight matrices in graph convolution layers.
However, these studies cannot handle datasets withlimited or no labels.
Graph contrastive learning has been recently exploited to address this issue.
Graph Contrastive Learning (GCL) aims to alleviate the reliance on labelling information inmodel training based on the concept of mutual information (MI).
Specifically, GCL approachesmaximise MI between instances with similar semantic information, and minimise the MI betweendissimilar instances.
For example, DGI [7] builds contrastiveness between node embeddings and asummary vector (i.e., a graph level embedding obtained by averaging all node embeddings) with a JSDestimator.
To improve DGI, MVGRL [3] and GMI [8] extends the idea of DGI by introducing multiview contrastiveness with diffusion augmentation, and focusing on a local scope with the first-orderneighbourhood, respectively.
Adopting InfoNCE loss, GRACE [9] applies augmentation techniquesto create two augmented views and inject contrastiveness between them.
Though these GCL methodshave successfully outperformed some supervised baselines in benchmark datasets, these methodssuffer from significant limitations, including time-consuming training, memory inefficiency, andpoor scalability.
In contrast, our method GGD requires much less time in training and posses highscalability.
Scalable GNNs.
Efficiency is a bottleneck for most existing GNNs to handle large graphs.
Toaddress this challenge, there are mainly three categories of approaches: layer-wise sampling (e.g.,
GraphSage [20]), graph sampling methods such as Cluster-GCN [21] and GraphSAINT [22], andlinear models, e.g., SGC [19] and PPRGo [23].
GraphSage [20] introduces a neighbour-samplingapproach, which creates fixed-size subgraphs for each node.
Underpinned by graph sampling,
Cluster-GCN [21] decomposes a large-scale graph into multiple subgraphs based on clustering, while
GraphSAINT [22] utilises light-weight graph samplers along with a normalisation technique forbiases elimination in mini-batches.
Linear models, SGC [19] and PPRGo [23], decouple graphconvolution from embedding transformation (i.e., matrix multiplication with weight matrices), andleverage Personalised PageRank to encode multi-hop neighbourhood, respectively.
However, all thesemethods only focus on supervised learning on graphs.
For unsupervised/self-supervised learningsettings where no labelled supervision signal is available, these frameworks are not applicable.
The closest works to ours to handle large scale graph datasets under self-supervised settings are BGRL [12] and GBT [11].
They try to improve the contrastive losses by removing negative samples.
However, BGRL [12] and GBT [11] still require much more time in training compared with GGD .
Experiments
[Table]
We evaluate the effectiveness of our model using eight benchmark datasets of different sizes.
These datasets include five small- and mediumscale datasets: Cora, CiteSeer, PubMed [24],
Amazon Computers, and Amazon Photos [25],as well as large-scale datasets ogbn-arxiv, ogbnproducts and ogbn-papers100M.
Notably, ogbnpapers100M is the largest dataset provided by
Open Graph Benchmark[26] for node propertyprediction tasks.
It has over 110 million nodesand 1 billion edges.
The statistics of thesedatasets are summarised in Appendix A.7.
Toensure reproducibility, the detailed experimentsettings and computing infrastructure are summarised in Appendix A.8.
[Table]
We compare GGD with ten baselines including four supervised GNNs (i.e., GCN [16],
GAT [17], SGC [19], and CG3 [27]) andsix GCL methods (i.e., DGI [7], GMI [8],
MVGRL [3], GRACE [9], BGRL [12] and
GBT [11]) on five small- and medium scalebenchmark datasets.
In the experiment, wefollow the same data splits as [28] for Cora,
CiteSeer and PubMed.
For Amazon Computers and Photos, we adopt the semi-supervisedexperiment setting, which includes 30 randomlyselected nodes per class in the training and validation set.
The remaining nodes are used as thetest set.
The model performance is measured using the averaged classification accuracy with fiveresults along with standard deviations and reported in Table 5.
[Table]
Accuracy.
From Table 5, we can observe that
GGD generally outperforms all baselines inall datasets.
The only exception is on CiteSeer dataset, where the semi-supervised method,
CG3[27], slightly outperforms GGD , which stillprovides the 2nd best performance.
In this experiment, we use the officially released code of
GraphCL [15], BGRL [12] and GBT [11] to reproduce the result, while the other results aresourced from previous studies [27, 1].
Efficiency and Memory Consumption.
GGD issubstantially more efficient than other self-supervised baselines in time and memory consumption asshown in Table 6 and Table 7.
Remarkably, GGD is 19.2 times faster in Amazon Photos for trainingtime per epoch, and consumes 64.5% less memory in Amazon Computers for memory consumptionthan the most efficient baseline (i.e., GBT [11]).
The dramatic boost of time and memory efficiency of GGD is contributed to the exclusion of similarity computation, which enables model training withoutmultiplication of node embeddings.
5.2 Evaluating on Large-scale datasets
To evaluate the scalability of GGD , we choose three large-scale datasets from Open Graph Benchmark [26], which are ogbn-arxiv, ogbn-products, and ogbn-papers100M. ogbn-papers100M is themost challenging large-scale graph available in Open Graph Benchmark for node property predictionwith over 1 billion edges and 110 million nodes.
Extending to extremely large graphs (i.e., ogbnproducts and ogbn-papers100M), we adopt a Neighbourhood Sampling strategy, which is describedin Appendix A.8.
means time ‘Total’ is total training time (Number of epochs × ‘Time’
[Table]
ogbn-arxiv & ogbn-products.
For ogbnarxiv, we compare GGD against four selfsupervised baselines (i.e., DGI [7], GRACE [9],
BGRL [12]and GBT [11]), whereas BGRL [12]and GBT [11] are selected to be compared forogbn-products.
In addition, we include the performance of MLP, Node2vec [29], and supervised GCN [16] sourced from [26] in Table 8and Table 9.
For memory and training timecomparison, we only compare GGD with the twomost efficient baselines (i.e., BGRL and GBTaccording to Tables 6 and 7).
In ogbn-arxiv, wereproduce BGRL [12] and found it fails to process ogbn-arxiv in full batch.
Thus, we only compare GGD and GBT in this dataset, which cansuccessfully train in full-graph processing mode.
[Table]
From Table 8 and Table 9, we can see GGD remarkably achieves the state-of-the-art perfor- [Table] mance using only one epoch to train.
As a result, GGD is 10,783 times faster than the mostefficient baseline, i.e., GBT [11], on total training time to reach the desirable performance inogbn-arxiv.
Please be noted that the number ofepoches in our experiment is consistent with theoptimal choice of this hyperparameter specifiedin GBT [11].
For ogbn-products, we are 381 × faster than GBT [11] on total training time.
Notably,our performance is significantly higher than GCL baselines using 100 epochs (i.e., 6% and 5.2%improvement on GBT [11] in validation and test set) with only one epoch training in this dataset.
Inaddition, we compare the convergence speed among GGD , BGRL [12] and GBT [11] on ogbn-arxivand ogbn-products, which are shown in Figure 4.
For ogbn-arxiv, BGRL [11] is running using batchedprocessing with neighbour sampling.
This figure shows the preeminence of our GGD in convergencespeed as GGD can be well-trained with only one epoch (i.e., reaching the peak model performance inthe first epoch and staying stable with increased epochs).
In contrast, the other two baselines requirecomparatively much more epochs to gradually improve their performance.
Compared with GCLbaselines, GGD achieves much faster convergence via Group Discrimination.
We conjecture this isbecause GD-based method focuses on the general edge distribution of graphs instead of node-specificinformation.
Inversely, GCL methods can suffer from convergence inefficiency as they may be easilydistracted from too-detailed node-specific information during training.
[Figure]
ogbn-papers100M. We further compare GGD with BGRL [12] and GBT [11] on ogbn-papers100M, thelargest OGB dataset with billion scaleedges.
Other self-supervised learning algorithms such as DGI [7] and GMI [8] fail to scale to such a largegraph with a reasonable batch size(i.e.
We only report the performance of each algorithm after a singleepoch of training in Table 10 due tothe extreme scale of the dataset andthe limitation of our available resources.
From the table, we can observe that GGD outperforms thetwo GCL counterparts, BGRL [12] and GBT [11] in both accuracy and efficiency.
Specifically, GGDachieves 60.2 in accuracy while BGRL and GBT reach 59.3 and 58.9 in test set, respectively.
Withonly one epoch, these two algorithms may not be well trained.
However, training each epoch of thesetwo requires over 1 day and if we would like to train them for 100 epochs, then we will need 100+ GPU days, which is prohibitively impractical for general practitioners.
In contrast, GGD can be trainedin about 9 hours to achieve a good result for this dataset, which is more appealing in practice.
Future Work
[Table]
In this paper, we have introduced a new selfsupervised GRL paradigm: Group Discrimination, which achieves the same level of performance as GCL methods with much less resourceconsumption (i.e., training time and memory).
Some limitations of this work are we still havenot explored some questions for GD.
For example, can we extend the current binary Group Discrimination scheme (i.e., classifying nodes generated with different topology) to discrimination amongmultiple groups?
Are there any other corruption technique to create a more difficult negative groupfor discrimination?
More importantly, with the extremely efficient property, GD has the potential tobe deployed to various real-world applications, e.g., recommendation systems, which have limitedlabelling information and desire fast computation with limited resources.
Checklist
For all authors...(
a) Do the main claims made in the abstract and introduction accurately reflect the paper’scontributions and scope?
[Yes] See Abstract and section 1.
[Table]
(b) Did you describe the limitations of your work?
[Yes] See section
[Table]
(c) Did you discuss any potential negative societal impacts of your work?
[N/A]
[Table]
(d) Have you read the ethics review guidelines and ensured that your paper conforms tothem?
[Yes]
[Table]
If you are including theoretical results...
[Table]
(a) Did you state the full set of assumptions of all theoretical results?
[Yes] Please refer tosection 2 and Appendix A.
[Table]
(b) Did you include complete proofs of all theoretical results?
[Yes] Please refer to section2 and Appendix A. [Table]
If you ran experiments...
[Table]
(a) Did you include the code, data, and instructions needed to reproduce the main ex-
[Table]
perimental results (either in the supplemental material or as a URL)?
[Yes] See Ap- [Table] pendix A.8 and the source code in supplemental material.
[Table]
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how theywere chosen)?
[Yes] See section 5 and Appendix A.8. [Table]
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)?
[No]
[Table]
(d) Did you include the total amount of compute and the type of resources used (e.g., typeof GPUs, internal cluster, or cloud provider)?
[Yes] See section 5 and Appendix A.8.
[Table]
If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
[Table]
(a) If your work uses existing assets, did you cite the creators?
[Yes] See section 5 andAppendix A.8.
[Table]
(b) Did you mention the license of the assets?
[Yes] See section 5 and Appendix A.8.
[Table]
(c) Did you include any new assets
(e) Did you discuss whether the data you are using/curating contains personally identifiable
information or offensive content?
[N/A]
If you used crowdsourcing or conducted research with human subjects...
(a) Did you include the full text of instructions given to participants and screenshots, if
applicable?
[N/A]
(b) Did you describe any potential participant risks, with links to Institutional Review
Board (IRB) approvals, if applicable?
[N/A]
(c) Did you include the estimated hourly wage paid to participants and the total amount
spent on participant compensation?
[N/A]
A Appendix A
A.1 Proof of Theorem
Proof.
To prove Theorem 1, given a graph G =
( X , A ) , where X ∈ R N × D and a GNN encoder g () ,for simplicity, we consider g () as a one-layer GCN and conduct the following normalisation to X tomake its value to be within the range [0 , 1] :
[Equation]
where z ij ∈ Z is the normalised x ij ∈ X , i denotes the row-entry of the matrix, j indicates thecolumn-entry of the matrix, min () is the function to get the minimum value, and max () is thefunction for getting the maximum value.
Then, we input Z to g whose weight matrix W is initialised with Xavier initialisation:
[Equation]
(6) where H is the output embedding, σ is non-linear activation function, ˆ A
=
A + I , ˆ D is the degreematrix for ˆ A , W is the learnable weight matrix.
As multiplying the normalised adjacency matrix willnot change the output data range, the output of ˆ D 12 ˆ A
ˆ D 12 Z is still within the range [0 , 1] .
Then, as theelement in Xavier initialised W is in between − 1 √ D and 1 √ D , we can easily derive that the output datarange of the matrix multiplication of ˆ D 12 ˆ
A ˆ D 12 Z
and W still stay in the same range [ − 1 √ D , 1 √ D ] as W .
After that, we need to apply σ to the multiplication output.
Here, we analyse four commonly adoptednon-linear activation functions: Sigmoid, ReLu, LeakyReLu and PReLu.
We first consider the
Sigmoid function σ ( x ) = 1 1+ e − x , as it is a monotonic increasing function, we can derive that the datarange of H ∈ [
[Equation] [Equation]
D ] .
Then, we apply the Sigmoid function S () again as DGI[7] did to
H and obtain:
[Equation]
Similarily, as the Sigmoid function is a monotonic increasing function, we can easily derive that thedata range for S ( H ) is in [
[Equation]
Then, when D → ∞ , for the upper bound
e −
[Equation]
− [Equation] √ D
[Equation]
, we can obtain:
[Equation]
Also, for the upper bound e
[Equation]
, when D → ∞ , we can obtain:
[Equation]

[Equation] = e − e [Equation] √∞
[Equation]
= [Equation] Finally, we can easily observe that lim D →∞ ( e − e 1 √ D +1 + ) =
lim D →∞ ( e − e − 1 √ D +1 + ) ≈ 0 .
62and thus prove Theorem 1 when σ is Sigmoid function.
For the other three non-linear activationfunctions ReLu σ ( x ) = max (0 , x ) , Leaky ReLu σ ( x ) = max (0 .
01 ∗ x, x ) and PReLu σ ( x ) =max (0 , x ) + a ∗ min (0 , x ) , where a ≤ 1 is a learnable parameter, we can also derive the data rangeof these functions for H are [0 , 1 √ D ] , [ − 0 .
01 √ D , 1 √ D ] and [ − a √ D , 1 √ D ] , respectively.
Here, we can seethese functions share the same upper bound 1 √ D .
The only difference for their lower bound is thecoefficient c ∈ [0 , 1] for − 1 √ D , i.e., 0 for ReLu, 0.01 for Leaky ReLu and a for PReLu.
By inputting Hwith these activation functions to the Sigmoid function, we can derive the output data range of thefunction is S ( H ) ∈
[ 1+ e c √ D , 1+ e − 1 √ D ] .
For the lower bound 1+ e c √ D , we can obtain:
[Equation]
For the lower bound 1+ e − 1 √ D , we can obtain:
[Equation]
Finally, we can easily observe that lim D →∞
[Equation]
and thus prove Theorem 1when σ is ReLu, LeakyReLu or PReLu.
A.2 Exploring Group Discrimination
Firstly, we explore the corruption techniqueused in DGI [7] and MVGRL [3], which isshown in Figure 5.
These two studies corrupt the topology of a given graph G by shuffling the feature matrix X .
This is becauseby changing the node order of X , the neighbouring structure of G is completely changed,e.g., neighbours of node a become node bneighbours.
With the corruption technique, negative samples in the negative group are generated with incorrectedges.
Thus, by discriminating the positive group (i.e., nodes generated with ground truth edges) andthe negative group, we conjecture the model can distil valuable signals by learning how to identifynodes generated with correct topology and output effective node embeddings.
A.2.1 Theoretical Analysis of Group Discrimination
Group discrimination is learning to avoid making ‘mistakes’ (i.e., bias the encoder towards avoidingmistaken samples).
To explain this point, we first present the theorem below and its proof. Then, weprovide an intuitive explanation for group discrimination.
Theorem 2 Given a graph G , a corrupted graph ˜ G , and a encoding network f θ () , we considerthe distribution of positive embeddings f θ ( G ) as P pos and negative embeddings f θ (˜ G ) as P neg .
Optimising the group discrimination loss is equivalent to maximising the Jensen-Shannon divergencebetween P pos and P neg .
Proof.
The following proof is inspired by the theoretical proof in GAN [30].
During training, we canrewrite the group discrimination loss in Equation 3 into the following form:
[Equation]
where agg () is the aggregation function to turn z into the 1 × 1 prediction, P pos are the distributionof positive embeddings, P neg are the distribution of negative embeddings.
As our objective hereis to maximise L , and P pos ( z ) > 0; P neg ( z ) > 0 , we can obtain the optimal solution for agg ( z )is P pos
[Equation]
z ) P [Equation] z )+ P neg ( z ) .
This is because for any ( a, b ) ∈ R 2 \{ 0 , 0 } , the maximum of a function y =alog ( x )+ blog (1 − x ) is achieved at aa + b [30].
By replacing agg ( z ) with
P [Equation] neg
[Equation]
z ) in Equation12, we can obtain:
[Equation]
From the equation above, we can see it looks similar to the Jensen-Shannon divergence between twodistribution P 1 and P 2 : [Equation]
[Equation]
Thus, we can rewrite Equation 13 as:
[Equation]
where we can see maximising L is the same asmaximising JS ( P pos ∥ P neg ) .
Thus, by optimising L , P pos and P neg tend to be separated.
Based on the Theorem above, we can see groupdiscrimination intuitively is learning to avoidmaking ‘mistakes’ (i.e., bias the encoder towards avoiding mistaken samples) as shown in
Figure 6.
This is because optimising the group discrimination loss can separate P pos and P neg .
As P optimal , the optimal distribution for nodeembeddings, is disjoint with P neg , if the generated embeddings can avoid being similar toout-of-distribution samples, i.e., negative samples, it can be more close to P optimal .
Therefore,the trained model can improve the quality of generated node embeddings for node samples.
A.3 Evaluation on aggregation function
[Table]
To explore the effect of other aggregation functions,we replace the summation function in Equation 1with other aggregation methods, including mean-,minimum-, maximum- pooling and linear aggregation.
We report the experiment results (i.e., averagedaccuracy on five runs) in Table 11.
The table showsthat replacing the summation with other aggregationmethods still works, while summation and linear aggregation achieve comparatively better performance.
A.4 Rethinking MVGRL
[Figure]
Extending the architecture of DGI, MVGRL resorts to multi-view contrastiveness via additionalaugmentation.
Specifically, as shown in Figure 7, it first uses the diffusion augmentation to create G aug .
Then, it corrupts G and G aug to generate negative samples
˜ G and ˜ G aug .
To build contrastiveness, MVGRL also generates two summary vectors S aug and S by averaging all embeddings in G aug and 634 G , respectively.
Based on the design of MVGRL, the model training is driven by mutual informationmaximisation between an anchor node embedding and its corresponding augmented summary vector
[Table]
However, MVGRL has the same technical error in their official JSD-based implementation as DGI,which makes it also becomes a group-discrimination-based approach.
Similar to Equation 3 of DGI, the proposed loss in MVGRL can also be rewritten as a binary crossentropy loss:
[Equation] [Equation]
here the number of nodes is increased to 4 N as we include nodes in G aug and ˜
G aug as data samples.
The indicator y i for G and G aug are 1, while ˜ G and ˜ G aug are considered as negative samples (i.e., theindicator y
i for them are 0).
To explore why MVGRL can achieve a better performance than DGI,we replace the original MVGRL loss with Equation 16 and conduct ablation study of MV GRL bceby removing different set of data samples in Equation 16, and report the experiment result in Table12.
From the table, the performance of MV GRL bce is on par with MV GRL , which reconfirms theeffectiveness of using the BCE loss.
Also, we can observe that including G aug and ˜ G aug is the key of
MVGRL surpassing DGI.
With G aug and ˜ G aug , the model performance of MV GRL bce w/o G aug and˜ G aug is improved from 82.2 to 83.1.
We conjecture this is because, with the diffusion augmentation,
MVGRL is trained with the additional global information provided by the diffused view G aug .
However, the diffusion augmentation involves expensive matrix inversion computation and significantlydensifies the given graph, which requires much more memory and time to store and process than theoriginal view.
This can hinder the model from extending to large-scale datasets [18].
A.5 Complexity Analysis
The time complexity of our method consists of two components: the siamese GNN and the losscomputation .
Existing self-supervised baselines share similar time complexity for the first component.
In GGD , Given a graph G = ( X ∈ R N × D , A ∈ R N × N ) in the sparse format, taking a L -layer
GCN [16] encoder as an example, the time complexity of it is O ( LMD + LND 2 ) .
As we need toprocess both the augmented graph ˆ G and the corrupted graph ˜ G , GGD requires the encoder computationtwice.
Then, the projector network (i.e., MLP) with K linear layers will be applied to the encoderoutput, which takes O ( ND 2 ) for each layer in computation.
Here D is a parameter defining thehidden size.
Before group discrimination, we aggregate the generated embedding with aggregationtechniques.
Here we take the simple summation, which consumes O ( ND ) as example.
For the loss computation, we use the BCE loss, i.e., Equation 3, to category summarised nodeembeddings, i.e., scalars.
The time complexity of this final step is O (2 N ) (i.e., processing all datasamples from the positive and negative groups).
Ignoring the computation cost of the augmentation,the overall time complexity of GGD for computing a graph G is O (2( LMD + LND 2 + KND 2 +
ND + N ))
→ O ( LMD + LND 2 + KND 2 + ND + N ) , where we can see the time complexityis mainly contributed by the siamese GNN.
A.6 The power of Graphs
To show the easiness of computation for the power of graphs, we conduct an experiment to evaluatethe time consumption for graph power computation on eight datasets, whose statistics are shown in
Appendix A.7.
Specifically, we set the hidden size of H θ to 256, and n is fixed to 10 for all datasets.
The experiment results are shown as below:
[Table]
This table shows that the computation of graph power is very trivial on small and medium sizegraphs, e.g., ogbn-arxiv, which has million of edges, consuming only 0.22 seconds.
Extending to anextremely large graph, ogbn-papers100M, which has over 1 billion edges and 11 million nodes, thecomputation only requires 209 seconds (i.e., around three minutes), which is acceptable consideringthe sheer size of the dataset.
A.7 Dataset Statistics
[Table] The following table presents the statistics of eight benchmark datasets including five small to medium-scale datasets and three large-scale datasets from OGB Graph Benchmark[26].
[Table]
A.8 Experiment Settings & Computing Infrastructure
Extending to Extremely Large Datasets.
Extending to extremely large graphs (i.e., ogbn-productsand ogbn-papers100M), we adopt a simple Neighbourhood Sampling strategy introduced in GraphSage [20] to decouple model training from the sheer size of graphs.
Specifically, we create a fixedsize subgraph for each node, which is created by sampling a predefined number of neighbours in eachconvolution layer for sampled nodes.
The same approach is employed in the testing phase to obtainfinal embeddings.
General Parameter Settings.
In our experiment, we mainly tune four parameters for GGD ,which arelearning rate, hidden size, number of convolution layers in the GNN encoder, and number of linearlayers in the projector.
For simplicity, we set the n-th graph power for final embedding generationfixed to 5 for all datasets.
The parameter setting for each dataset is shown below:
[Table]
Large-scale Datasets Parameter Settings.
To decouple model training from the scale of graphs,we adopt the neighbouring sampling technique, which has three parameters: batch size, sample size,and number of hops to be sampled.
Batch size refers to the number of nodes to be processed inone parameter optimisation step.
Sample size means the number of nodes to be sampled in eachconvolution layer, and the number of hops determines the scope of the neighbourhood for sampling.
In GGD implementation, the batch size, sample size, and the number of hops are fixed to 2048, 12 and3, respectively.
Memory and Training Time Comparison.
As memory and training time are very sensitive to hyperparameters related to the structure of GNNs, including hidden size, number of convolution layers,and batch processing for large-scale datasets, e.g., batch size and number of neighbours sampled ineach layer.
Thus, in memory and training comparison, to be fair, we set all these parameters to be thesame for all baselines and GGD .
The specific parameter setting for each dataset is shown below:
[Table]
neigh
[Table]
Computing Infrastructure.
For experiments in section 3, 5 and 6.1, they are conducted using
Nvidia GRID T4 (16GB memory) and Intel Xeon Platinum 8260 with 8 core.
For experiments onlarge-scale datasets (i.e.,ogbn-arxiv, ogbn-products and ogbn-papers100M), we use NVIDIA A40(48GB memory) and Intel Xeon Gold 5320 with 13 cores.
A.9 Algorithm
We have summarised the overall procedure of GGD in Algorithm 1 as follows:
Specifically, we first conduct augmentation on G to obtain ˆ G .
Then, ˆ G is corrupted to generate thecorrupted graph ˜ G .
In the encoding phase, we feed ˆ G and ˜ G to GNN encoder g θ and projector f θ togenerate embeddings ˆ H θ for positive samples and ˜ H θ for negative samples.
After that, we obtainthe binary classification result by aggregating the concatenation of ˆ H θ and ˜ H θ .
The result is a 2 Ndimension vector, which can be used for calculating the loss with a BCE loss.
Finally, based on thecalculated loss, trainable parameters in g θ and f θ can be updated.
This training process will continueiteratively until we reach the predefined number of epochs E .
When the training process is completed,we freeze the g θ and f θ and feed G to these two encoding components to obtain the local embedding,
H θ .
Then, we obtain global embedding H globalθ with a global information injection operation.
Bysumming H θ and H globalθ , we can get the final embeddings H .
A.10 Ablation Study
In this section, we conduct an ablation study to evaluate the effectiveness of different components in GGD .
Specifically, we evaluate three variants of GGD , including GGD w/o aug , GGD w/o proj ,
GGD w/o power , which represent GGD without augmentation, the projector and the global informationinjection process respectively.
The experiment results on five small to medium size datasets arepresented in Table 17.
From the table, we can see without any mentioned component, the performanceof GGD degrades, which validates the effectiveness of these components.
It is worth noting that evenwithout the global information injection in the inference phase, GGD w/o power still achieves thehighest performance in 4 out of 5 datasets compared with six self-supervised baselines.
This indicatesthat even without global information injection, GGD is still effective.
[Table]