NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Deep Graph Contrastive Representation Learning

Yanqiao Zhu, Yichen Xu, Feng Yu, Qiang Liu, Shu Wu, Liang WangarXiv 2020

Abstract

Graph Neural Networks (GNNs) have transformed the analysis of structured data but typically rely on extensive labeled datasets, which are often expensive or unavailable. We present GRACE (GRAph Contrastive rEpresentation learning), a novel unsupervised framework that learns node embeddings by maximizing the agreement between two stochastically corrupted views of the same graph. By contrasting node-level representations directly—rather than comparing nodes to a global graph summary—GRACE achieves state-of-the-art performance across multiple benchmarks. Notably, GRACE occasionally outperforms supervised models, demonstrating the power of contrastive learning in capturing intrinsic graph properties.

Introduction

The reliance on labeled data is a significant bottleneck for GNN applications. While unsupervised methods aim to mitigate this, existing approaches have notable drawbacks. Proximity-based methods like DeepWalk focus primarily on local topology, often ignoring rich node attributes. Contrastive methods, such as Deep Graph Infomax (DGI), attempt to maximize mutual information between local node embeddings and a global graph summary. However, creating an effective global summary requires complex mathematical properties like injectivity, which are difficult to realize in practice. Furthermore, common corruption techniques like feature shuffling often fail to provide diverse enough contexts for learning, particularly in sparse graph settings.

Methodology: The GRACE Framework

GRACE simplifies the contrastive learning process by focusing entirely on node-to-node comparisons across augmented views. The framework operates through a three-step pipeline:

1. Hybrid View Generation

The model generates two augmented versions of the original graph, $\tilde{\mathcal{G}}_1 = (\tilde{\mathbf{X}}_1, \tilde{\mathbf{A}}_1)$ and $\tilde{\mathcal{G}}_2 = (\tilde{\mathbf{X}}_2, \tilde{\mathbf{A}}_2)$, using two stochastic "corruption" techniques:

  • Removing Edges (RE): Randomly dropping a portion of the edges to alter the graph's topology.
  • Masking Features (MF): Randomly zeroing out dimensions of node feature vectors to perturb the attribute space.

This hybrid approach ensures the model learns representations that are robust to both structural and attributive noise.

2. Shared Encoding

A shared GNN encoder $f$ processes both views to generate node embeddings. By using a single encoder for both views, the model is forced to map different augmentations of the same node to a consistent representation space.

3. Contrastive Objective

For any given node $i$, its embedding in View 1 acts as the "anchor." Its embedding in View 2 is the "positive sample." All other nodes in both views are treated as "negative samples." The model is trained to minimize a contrastive loss that pulls the anchor and positive sample together while pushing all negative samples away.

The GRACE framework: generating two corrupted views and contrasting node embeddings.

The authors provide a theoretical foundation for this objective, proving it serves as a lower bound for the Mutual Information between input features and learned representations. Furthermore, they demonstrate that this objective mathematically coincides with the classical triplet loss, providing a bridge between modern contrastive learning and established metric learning techniques.

Experimental Results

The researchers evaluated GRACE on six widely-used benchmarks across two learning paradigms:

  • Transductive (Citation Networks): Cora, Citeseer, Pubmed, and DBLP.
  • Inductive (Social & Biological Networks): Reddit and PPI (Protein-Protein Interactions).

Performance in Transductive Settings

GRACE consistently outperformed existing unsupervised methods such as GAE, VGAE, and DGI across all citation networks. A key finding was that GRACE actually outperformed supervised GCN models on the Cora and DBLP datasets. This suggests that the contrastive objective may capture more fundamental structural information than traditional label-driven training.

Performance comparison on transductive tasks (Cora, Citeseer, Pubmed, DBLP).

Performance in Inductive Settings

On the PPI dataset, which is characterized by complex biological interactions and sparse features, GRACE achieved a 66.2 F1 score. This significantly outperformed DGI’s 63.8, proving GRACE's effectiveness in domains where simple feature shuffling is insufficient to create distinct negative examples.

Key Insights and Discussion

The primary insight of GRACE is that a global graph summary is not a prerequisite for high-quality representation learning. By ensuring a node "recognizes itself" across different corrupted environments, the model captures the essential structural and attributive essence of that node.

The combination of topology and attribute corruption is vital. Many previous models focused on one or the other; GRACE shows that corrupting both connections (RE) and content (MF) is necessary to force the model to learn robust, multi-faceted embeddings.

Limitations and Future Work

While effective, GRACE's contrastive loss involves comparing every node against every other node in the batch, leading to $O(N^2)$ complexity. This could become a bottleneck for massive graphs without the implementation of sophisticated sampling techniques. Additionally, the current augmentation strategies (RE and MF) are random; future research could explore adaptive strategies, such as using graph centrality to intelligently select which edges to drop.

Conclusion

GRACE represents a significant advancement in unsupervised graph representation learning. By focusing on node-level contrastive objectives and hybrid augmentations, it provides a robust and high-performing alternative to both traditional unsupervised methods and, in some cases, supervised models.

Summary updated

BibTeX
@misc{zhu2020deep,
  author = {Yanqiao Zhu and Yichen Xu and Feng Yu and Qiang Liu and Shu Wu and Liang Wang},
  title = {{Deep Graph Contrastive Representation Learning}},
  year = {2020},
  eprint = {2006.04131},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2006.04131},
}
Figure