Unifying Graph Contrastive Learning with Flexible Contextual Scopes

Yizhen Zheng, Yu Zheng, Xiaofei Zhou, Chen Gong, Vincent C. S. Lee, Shirui Pan

Introduction

Graph Contrastive Learning (GCL) has emerged as a dominant paradigm for self-supervised representation learning on graphs. By teaching models to recognize similarities between a node and its surrounding context, GCL avoids the need for expensive manual labeling. However, the field has historically been fragmented between "local" methods focusing on immediate neighbors and "global" methods targeting the entire graph structure. This paper introduces UGCL (Unifying Graph Contrastive Learning), a framework that demonstrates how these disparate approaches are actually points on a single spectrum of "contextual scope."

The Problem of Rigid Scopes

Existing GCL methods typically suffer from two primary limitations:

  1. Fixed Scopes: Models are often hard-coded to look at a specific hop distance (e.g., 1-hop neighbors). In practice, optimal context varies by dataset; a social network might require a narrow scope, whereas a citation network benefits from a broader view.
  2. Component Blindness: Global methods often contrast nodes against a summary of the entire graph. In graphs with multiple disconnected components, this mixing of signals introduces noise, as nodes in unrelated "islands" should not necessarily share contextual features.

A Unified Framework for Contrastive Scopes

The core innovation of UGCL is the use of the $n$-th power of the adjacency matrix ($A^n$) to define a node's context. In graph theory, $A^n$ represents the number of paths of length $n$ between nodes. By varying $n$, UGCL can seamlessly transition between local and global scopes, effectively unifying several popular models into one elegant mathematical framework.

Comparison of existing GCL methods within the UGCL framework, demonstrating how varying the adjacency power $n$ recovers specific models.

As illustrated in the figure above, specific values of $n$ recreate established baselines:

  • $n=0$: Recovers GRACE, where a node is compared only to an augmented version of itself.
  • $n=1$: Recovers GMI, focusing on the immediate 1-hop neighborhood.
  • $n \to \infty$: Recovers DGI or MVGRL, where representations converge to a global summary of the connected component.

Architecture and Implementation

UGCL operates by maximizing the Mutual Information (MI) between two distinct views of the graph: a "patch view" and a "contextual view."

The UGCL framework architecture, highlighting the contrast between the local patch view and the contextual view.
  1. Augmentation and Sampling: To maintain scalability, UGCL trains on randomly sampled subgraphs. This subsampling acts as a form of data augmentation while keeping the calculation of $A^n$ computationally efficient (often taking less than 1ms).
  2. Dual Views: The model generates a Patch View (local node features) and a Contextual View (features aggregated via the $A^n$ power mechanism).
  3. Contrastive Loss: The objective function encourages the representation of a node to be similar to its own contextual summary while remaining distinct from the summaries of other nodes within the same connected component.

Theoretical Insights and Results

The authors provide a mathematical proof (the Convergence Theorem) showing that as $n$ increases, node representations within a connected component converge toward a shared subspace. This justifies $A^n$ as a valid proxy for global context. However, the paper also identifies "Homophily Dominance" as a constraint: if $n$ is too large, the scope may include semantically unrelated nodes, degrading performance.

Empirically, UGCL achieved state-of-the-art results on 6 out of 7 standard small-to-medium datasets, including Cora, CiteSeer, and PubMed. On the large-scale ogbn-arxiv dataset, it remained competitive with top-tier baselines while offering a significantly simpler conceptual architecture.

Conclusion and Future Work

UGCL provides a much-needed theoretical bridge between local and global graph contrastive learning. While the framework currently requires some domain knowledge to select the optimal $n$ based on graph homophily, it sets the stage for more flexible, adaptive self-supervised learning. Future research may extend this power-based logic to heterogeneous graphs and broader tasks like link prediction.

Summary updated

BibTeX
@inproceedings{zheng2022unifying,
  author = {Yizhen Zheng and Yu Zheng and Xiaofei Zhou and Chen Gong and Vincent C. S. Lee and Shirui Pan},
  title = {{Unifying Graph Contrastive Learning with Flexible Contextual Scopes}},
  booktitle = {ICDM},
  year = {2022},
  url = {https://openreview.net/forum?id=5AnJ5MUFiQj},
}
Figure