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, thisoperation can be computationally expensive.
For example, the time complexityof two commonly adopted contrastive loss functions (i.e., InfoNCE and JSDestimator) for a node are O ( ND ) and O ( D ) , respectively, where N is the numberof nodes, and D is the embedding dimension.
Additionally, GCL normally requiresa large number of training epoches to be well-trained on large-scale datasets.
Inspired by an observation of a technical defect (i.e., inappropriate usage of Sigmoidfunction) commonly used in two representative GCL works, DGI and MVGRL,we revisit GCL and introduce a new learning paradigm for self-supervised GRL,namely, Group Discrimination (GD), and propose a novel GD-based method called G raph Group Discrimination ( GGD ).
Instead of similarity computation, GGD directlydiscriminates two groups of summarised node instances with a very simple binarycross-entropy loss.
As such, GGD only requires O (1) for the loss computation of anode.
In addition, GGD requires much less training epoches to obtain competitiveperformance compared with GCL methods on large-scale datasets.
These twoadvantages endows GGD with very efficient property.
Extensive experiments showthat GGD outperforms state-of-the-art self-supervised methods on eight datasets.
In particular, GGD can be trained in 0.18 seconds (6.44 seconds including datapreprocessing) on ogbn-arxiv, which is orders of magnitude (10,000+) fasterthan GCL baselines while consuming much less memory.
Trained with 9 hourson ogbn-papers100M with billion edges, GGD outperforms its GCL counterparts inboth 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 for self-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 informationwhile doing the opposite for negative counterparts as shown in Figure 1(a).
Nonetheless, sucha scheme relies on expensive similarity calculation in contrastive loss computation.
Taking twocommonly-adopted contrastive loss functions, InfoNCE and JSD estimator as examples, the timecomplexity of loss computation for a node is O ( ND ) and O ( D ) , respectively.
Here, N representsthe number of nodes, and D is the embedding dimension.
Additionally, GCL normally requires alarge number of training epoches 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 alleviate the training load of InfoNCE by removing negative nodepairs with specially designed schemes,e.g., BGRL [12] and GBT [13], thesemethods still require O ( D ) to compute the contrastiveness for a node.
Driven by the success of BYOL [14]in CV, BGRL [12] adopts a bootstrapping scheme, which only contrasts anode from the online network (i.e., updated with gradient) to its corresponding embedding from the target network(i.e.
, updated momentumly with stopgradient).
Based on Barlow-Twins [11], GBT [13] utilises a cross-correlation-based loss function to get rid of negative samples.
However,these two methods still require O ( D ) as they still need to conduct similarity computation.
Thus, thecomplexity of these two methods are only on par with the JSD estimator and still suffer from theinefficiency in model training.
[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).
Remarkably, with
GD, the time complexity of loss computationfor a node is only O (1) , endowing the schemewith the extremely efficient property.
Insteadof similarity computation, GD directly discriminates a group of positive nodes from a group ofnegative nodes, as shown in Figure 1(b).
Specifically, GD defines summarised node embeddingsgenerated with original graph as the positivegroup, where each node is summarised into asingle scalar, while embeddings obtained withcorrupted topology are regarded as the negativegroup.
Then, GD trains the model by classifyingthese embeddings into the correct group with a very simple binary cross-entropy loss.
By doing so,the model can extract valuable self-supervised signals from learning the edge distribution of a graph.
Compared with GCL, GD enjoys numerous merits including extremely fast training, fast convergence(e.g., 1 epoch to be well-trained on large-scale datasets), and high scalability while achieving SOTAor on par performance with existing GCL approaches.
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 are 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 of theopposing group.
Finally, the model is trained by discriminating the summarisation of these twogroups of nodes.
The contributions of this paper are three-folds: 1) We introduce a novel andefficient self-supervised GRL paradigm, namely, Group Discrimination (GD).
Notably, with GD,the time complexity of loss computation for a node is only O (1) .
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 epochesnumber [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].
Then, based on thetechnical defect, we show the learning methodbehind these two approaches is not contributedto Contrastive Learning, but a new paradigm,
Group Discrimination.
Finally, from the analysis, we provide the definition of this new concept.
2.1 Rethinking GCL Methods
DGI [7] is the first work introducing Contrastive
Learning into GRL.
However, due to a technical defect observed in their official open-sourcecode, we found it is essentially not working as the authors thought (i.e., learning via MI interaction).
The backbone that truly makes it work is a new paradigm, Group Discrimination.
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 shufflingthe node order of the input feature matrix to get ˜ G .
Then, generated embeddings of ˜ G are served asnegative samples, which are pulled apart from the summary vector s via MI minimisation.
[Table]
Nonetheless, in the implementation of DGI, a Sigmoidfunction is inappropriately applied on the summary vectorgenerated from a GNN whose weight is initialised with Xavier initialisation.
As a result, elements in the summaryvector are very close to the same value.
We have validatedthis finding on three datasets, Cora, CiteSeer and PubMed.
The experiment result is shown in Table 2, which showsthat summary vectors in all datasets are approximately a constant vector ϵI , where ϵ is a scalar and
I ∈
R D is an all-ones vector (i.e., ϵ =0.6225 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 () whose weight matrix is initialised with Xavier initialisation, we can obtain itsembedding H =
g ( G ) .
Then, when D increases, thedata range of the output matrix of the sigmoid function ( σ ( H ) ) converges to 0.
Based on this theorem, we can see if the dimension of input feature matrix X is large, then thesesummary vectors can lose variance and become constant vector.
The proof for the theorem anddetailed 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]
s,
[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 andthe summary vector only serves as an aggregationfunction (i.e., summation aggregation) to summariseinformation in z i .
To explore the effect of other aggregation functions, we replace the summation functionin Equation 1 with other aggregation methods suchas mean-, minimum-, and maximum- pooling, andpresent the experiment result 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
= sum ( z i ) :
[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 summarisation of node i ’s embedding.
As we include corrupted nodesas data samples, the size of nodes to be processed is doubled to 2 N (i.e., the number of corruptednodes is equal to the number of original nodes).
From the equation above, we can easily observethat what DGI truly does is discriminate a group of summarised original node embeddings fromthe other group of summarised corrupted node embeddings, as shown in Figure 1.
We name thisself-supervised learning paradigm " Group Discrimination ".
To validate the effectiveness of thisparadigm, we replace the original DGI loss with Equation 3, namely, DGI BCE and compare itwith DGI on three datasets in terms of training time, memory efficiency and model performanceas shown in Table 4.
Here, DGI BCE adopts the same parameter setting as DGI.
From this table,we can observe DGI BCE dramatically improves DGI in both memory- and time-efficiency while it slightly enhances the model performance of DGI.
This is contributed to the removal of multiplicationoperations between node pairs, which eases the burden of computation and memory consumption inboth forward and backward propagation.
In section A.2, we further explore GD and compare it withexisting contrastive losses.
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 injectadditional global information in model training, which enhances the model performance.
The detailedanalysis for MVGRL is presented in Appendix A.4.
2.2 Definition of Group Discrimination
As mentioned above, Group Discrimination is a self-supervised GRL paradigm, which learns bydiscriminating different groups of node embeddings.
Specifically, the paradigm assigns differentindicators to different groups of node embeddings.
For example, for binary group discrimination,one group is considered as the positive group with class 1 as its indicator, whereas the other group isthe negative group, having its indicator assigned as 0.
Given a graph G , the positive group usuallyincludes node embeddings generated with the original graph G or its augmented views (i.e., similargraph instances of G created by augmentation).
In contrast, the opposing group contains negativesamples obtained by corrupting G , e.g., changing its topology structure.
Methodology
[Figure]
We first define unsupervised node representation learning and then present the architecture of GGD ,which extends DGI BCE with additional augmentation and embedding reinforcement to reach bettermodel performance.
Given a graph G with attributes X ∈ R N × D ′ , where N is the number of nodes in 205 G , and D ′ is the number of dimensions of X , our aim is to train a GNN encoder without the relianceon labelling information.
With the trained encoder, taking G and X as input, it can output learnedrepresentations H ∈ R N × ˆ D , where ˆ D is the predefined output dimension.
H can then be used inmany 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 abinary cross-entropy loss.
The architecture of the proposed framework is presented in Figure 3.
Theframework mainly consists of four 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 ofedges, 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 is changing in every training iteration, which forces the modelto lessen the dependence on the fixed pattern (i.e., unchanged edge and feature distribution) ina monotonous graph.
However, in Contrastive Learning, augmentation creates augmented viewssharing similar semantic information for building contrastiveness.
Corruption.
ˆ G and ˆ X are then corrupted to build ˜ G and ˜ X for the generation of node embeddings in thenegative group.
We adopt the same corruption technique used in DGI [7] and MVGRL [3] as shownin Figure 5.
The corruption technique devastates the topology structure of ˆ G by randomly changingthe order of nodes in ˆ X .
The corrupted ˜ X and ˜ G can be used for producing node representations withincorrect 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 flexible network with a user-defined number of linear layers.
When generating node embeddingsof the positive group, the Siamese network takes ˆ G and ˆ X as input.
Using the same encoder andprojector, the Siamese network output the negative group with ˜ G and ˜ X .
These two groups of nodeembeddings are considered as a collection of data samples with a size of 2 N for discrimination.
Before conducting group discrimination, all data samples are summarised with the same aggregationtechnique, e.g., sum-, mean-, and linear aggregation.
Group Discrimination.
In the group discrimination process, we adopts a very simple binary crossentropy (BCE) loss to discriminate two groups of node embeddings 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 summarisation of anode i , i.e., a scalar, with its indicator y i .
With the ease of BCE loss computation, the training processof 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.
With the trained GNN encoder g θ , we can obtain thenode 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,they obtain the final embeddings by summing up embeddings from two views: the original viewcomprising local information and the diffused view with global information.
This operation reinforcesthe final embeddings and leads to model performance improvement.
Nonetheless, graph diffusionimpairs the scalability of a model [18] and hence cannot be directly applied in our embeddinggeneration.
To avoid the diffusion computation, we have come up with a workaround in the virtue ofgraph power to extract global information.
Graph power can extends 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.
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 JSD estimator.
To improve DGI, MVGRL [3] and GMI [8] extends the idea of DGI by introducingmulti-view contrastiveness with diffusion augmentation, and focusing on a local scope with thefirst-order neighbourhood, respectively.
Adopting InfoNCE loss, GRACE [9] applies augmentationtechniques to create two augmented views and inject contrastiveness between them.
Though these GCL methods have successfully outperformed some supervised baselines in benchmark datasets,these methods suffer from significant limitations, including time-consuming loss computation, a largenumber of training epoches and poor scalability.
For example, InfoNCE and JSD estimator require O ( ND ) and O ( D ) in loss computation of a node, respectively. On the contrast, our method GGDpresented in this paper reduces the time complexity of loss computation for a node to only O (1) andconverge fast.
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.
Themost close works to ours to handle large scale graph datasets under self-supervised settings are
BGRL [12] and GBT [11].
They try to reduce the time complexity of the contrastive losses byremoving negative samples.
However, they still require O ( D ) to calculate the loss for a node, incomparison with O (1) of our method GGD .
Experiments
Computers and
[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 these datasets are summarised in Appendix A.7.
To ensure reproducibility, the detailed experimentsettings and computing infrastructure are summarised in Appendix A.8. 5.1 Evaluating on Small- and Medium-scale Datasets
[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 reproduce BGRL [12], GBT [11] and GGD , while the other results are sourced fromprevious studies [27, 1].
Efficiency and Memory Consumption.
GGD is substantially more efficient than other self-supervisedbaselines in time and memory consumption as shown in Table 6 and Table 7.
Remarkably, GGD is19.2 times faster in Amazon Photos for training time per epoch, and consumes 64.5% less memoryin Amazon Computers for memory consumption than the most efficient baselines (i.e., GBT [11]).
The dramatic boost of time and memory efficiency of GGD is contributed to the exclusion of similaritycomputation in self-supervised signal extraction, which enables model training without multiplicationof 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.
[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, we reproduce BGRL [12] and found it fails to process ogbn-arxiv in full batch.
Thus, we only compare GGD and GBT in this dataset, which can successfully 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 GGDwith BGRL [12] and GBT [11] on ogbnpapers100M, the largest OGB dataset with billion scale edges.
Other self-supervised learningalgorithms such as DGI [7] and GMI [8] fail toscale to such a large graph with a reasonablebatch size (i.e., 256).
We only report the performance of each algorithm after a single epochof training in Table 10 due to the extreme scaleof the dataset and the limitation of our available resources.
From the table, we can observethat GGD outperforms the two GCL counterparts, BGRL [12] and GBT [11] in both accuracy and efficiency.
Specifically, GGD achieves 60.2 in accuracywhile BGRL and GBT reach 59.3 and 58.9 in test set, respectively.
With only one epoch, these twoalgorithms may not be well trained.
However, training each epoch of these two requires over 1 dayand if we would like to train them for 100 epochs, then we will need 100+ GPU days, which isprohibitively impractical for general practitioners.
In contrast, GGD can be trained in about 9 hours toachieve 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 resources consumption (i.e., training time andmemory).
Some limitations of this work arewe still have not explored some questions for GD.
For example, can we extend the current binary Group Discrimination scheme (i.e., classifying two groups of summarised node embeddings) todiscrimination among multiple groups?
Are there any other corruption technique to create a moredifficult negative group for discrimination?
More importantly, with the extremely efficient property, GD has the potential to be deployed to various real-world applications, e.g., recommendation systems,which have limited labelling 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’s contributions and scope?
[Yes] See Abstract and section 1.
(b) Did you describe the limitations of your work?
[Yes] See section
(c) Did you discuss any potential negative societal impacts of your work?
[N/A]
(d) Have you read the ethics review guidelines and ensured that your paper conforms to
them? [Yes]
If you are including theoretical results...
(a) Did you state the full set of assumptions of all theoretical results?
[Yes] Please refer tosection 2 and Appendix A.
(b) Did you include complete proofs of all theoretical results?
[Yes] Please refer to section2 and Appendix A.13.
If you ran experiments...
(a) Did you include the code, data, and instructions needed to reproduce the main ex-
perimental results (either in the supplemental material or as a URL)?
[Yes] See Ap- pendix A.8 and the source code in supplemental material.
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how theywere chosen)?
[Yes] See section 5 and Appendix A.8.
(c) Did you report error bars (e.g., with respect to the random seed after running experi- ments multiple times)?
[No]
(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.
If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
(a) If your work uses existing assets, did you cite the creators?
[Yes] See section 5 andAppendix A.8.
(b) Did you mention the license of the assets?
[Yes] See section 5 and Appendix A.8.(c)
Did you include any new assets either in the supplemental material or as a URL? [No]We do not use any new datasets in this paper. (d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating?
[No] The datasets used in this paper are publicly available.
(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, ifapplicable?
[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 amountspent on participant compensation?
[N/A]
A Appendix A
A.1 Proof of Theorem 1
Proof.
To prove Theorem 1, given a graph G =
( X , A ) , where X ∈ R N × D and a GNN encoder g () ,for simiplicity, 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 i ∈ Z is the normalised x i ∈ X , i denotes the column-entry of the matrix, min () is thefunction to get the minimum value, and max () is the function for getting the maximum value.
Then, we input Z to g whose weight matrix W is initialised with Xavier initialisation: [Equation]
[Equation]
where H is the output embedding, σ is the non-linear Sigmoid 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, as the Sigmoid function σ ( x ) = 1 1+ e − x is a monotonic increasing function, we can derivethat the data range of H ∈ [
[Equation]
Finally,we apply the Sigmoid function σ () again as DGI[7] did to H and obtain:
[Equation]
Similarily, as the Sigmoid function is a monotonic increasing function, we can easily derive thatthe data range for σ ( H ) is in [
[Equation]
Then, when D → ∞ , for the lower bound e
[Equation]
, we can obtain:
[Equation]
Also, for the upper bound e
[Equation]
{+√ D +
 ++} , when D → ∞ , we can obtain:
[Equation]
[Equation]
Finally, we can easily observe that lim D →∞ ( e e 1 √ D +1 + ) =
lim D →∞ ( e e − 1 √ D +1 + )
and thus prove
Theorem 1.
A.2 Exploring Group Discrimination
[Figure]
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 distill valuable signals from learning how to identifynodes generated with correct topology and output effective node embeddings.
A.2.1 Benefits of Group Discrimination
Compared with contrastive learning, Group Discrimination enjoys advantages in computation efficiency, memory efficiency and convergence speed.
To compare Group Discrimination with GCL, wefirst analyse the complexity of two commonly-adopted contrastive loss functions, InfoNCE and JSDestimator.
These two contrastive losses of an anchor node i can be formulated as follows:
[Equation]
where z i ∈ R 1 × D represents node embedding of node i , τ is the temperature coefficient, D is thediscriminator,
˜ z i is the corrupted negative counterpart, and c i ∈ R 1 × D is the positive counterpartsharing similar semantic information with node i .
In InfoNCE, the loss computation conductssimilarity computation for positive (i.e, the numerator of Equation 10) and negative counterparts(i.e.
, the denominator) once and N times, respectively.
As the time complexity of a node-to-nodesimilarity computation is O ( D ) (e.g., vector multiplication between z i and c i ), the overall complexityfor InfoNCE is O ( ND ) .
Though the JSD estimator does not require a size of N negative samples foreach node, it still needs O ( D ) for the loss computation of an anchor node because the discriminatorrequires vector multiplication between embeddings of node i and c i .
[-Lemma 
-]
To alleviate the computation burden of InfoNCE loss, BGRL [12] and GBT [11] attempt to getrid of the reliance on negative samples with customised losses.
BGRL [12] utilises a simple lossto minimise the cosine similarity between the online node embedding z ( G 1 ,i ) and the target nodeembedding h
( G 2 ,i ) for node i :
[Equation]
where z ( G 1 ,i ) and h ( G 2 ,i ) are generated from two augmented views G 1 and G 2 .
Different from 586 BGRL [12], GBT [11] adopts a correlation-based loss as follows:
[Equation]
where i and j are two indices for the embedding dimension.
From the losses shown above, we can see these two losses still involve vector multiplication betweentwo node embeddings.
Thus, even though these two methods reduce the time complexity of InfoNCE(i.e.
, O ( ND ) )
to O
( D ) , they are still on par with the JSD estimator.
Different from the aforementioned contrastive learning loss, to actuate a Group Discrimination learning paradigm, our methoduses an effortless binary cross-entropy loss as shown in Equation 3.
In Group Discrimination, theloss computation of a node i requires only O (1) as it conducts multiplication between scalars (i.e.,h i and y i ) in lieu of vectors.
Thus, Group Discrimination has great advantages in computation and memory efficiency. Another merit of the proposed paradigm is fast convergence as shown in section5.2.
We conjecture this is contributed to the concentration of Group Discrimination on the generaledge distribution of graphs instead of node-specific information as GCL methods do. Thus, it wouldnot be distracted from too-detailed information. [Figure]
A.3 Evaluation on aggregation function
[Figure]
[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 function with other aggregation methods still works, while summation andlinear aggregation achieve comparatively better per-
[Figure]
formance.
[Figure]
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 615 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.
However, MVGRL has the same technical error in their official JSD-based implementation as DGI,which makes it also becomes an 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]
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, [Table] we replace the original MVGRL loss with Equation 14 and conduct ablation study of MV GRL bceby removing different set of data samples in Equation 14, 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 with N nodes and M edges in the sparse format, taking a GCN [16]encoder as an example, the time complexity of it is O ( N + M ) .
As we need to process both theaugmented graph ˆ G and the corrupted graph ˜ G , GGD requires the encoder computation twice.
Then,the projector network (i.e., MLP) with L linear layers will be applied to the encoder output, whichtakes O ( ND ) for each layer in computation.
Here D is a parameter defining the hidden size.
Beforegroup discrimination, we aggregate the generated embedding with simple summation consuming
O ( ND ) .
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 group).
Ignoring the computation cost of the augmentation,the overall time complexity of GGD for computing a graph G is O (2( N + M + LND + ND + N ))
→
O ( N + M + LND + ND ) , where we can see the time complexity is mainly contributed by thesiamese GNN.
More importantly, we compress the self-supervised learning loss computation to O ( N )for a whole graph.
A.6 Graph Power
To show the easiness of graph power computation, we conduct an experiment to evaluate the timeconsumption 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.
Theexperiment 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 have 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
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 tunes four parameters for GGD ,whichare learning 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 10 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, samplesize, 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 number of hops determines the scope of the neighbourhood for sampling.
In GGD implementation, the batch size, sample size, and number of hops are fixed to 2048, 12 and 3,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]
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.