GNN-Transformer Cooperative Architecture for Trustworthy Graph Contrastive Learning

Jianqing Liang, Xinkai Wei, Min Chen, Zhiqiang Wang, Jiye Liang · DOI

Introduction

Graph Contrastive Learning (GCL) has emerged as a powerful paradigm for self-supervised representation learning on graphs. Typically, GCL relies on creating multiple "views" of a graph through random data augmentations—such as node dropping or edge perturbation—and training the model to maximize agreement between these views. However, unlike images where cropping or color jittering preserves core semantics (e.g., a cat remains a cat), graphs are structurally fragile.

Semantic disturbance: random augmentations in images vs. molecular graphs.

In domains like chemistry, removing a single atom or bond can fundamentally alter a molecule's properties, a phenomenon known as semantic disturbance. Furthermore, traditional Graph Neural Networks (GNNs) often struggle with "over-smoothing" and "over-squashing," limiting their ability to capture long-range dependencies. To address these challenges, the authors propose the GNN-Transformer Cooperative Architecture (GTCA), a framework that leverages architectural diversity to generate trustworthy views without manual perturbations.

Methodology: The GTCA Framework

GTCA moves away from risky random augmentations by utilizing two distinct encoders that provide naturally diverse perspectives of the graph: a Graph Convolutional Network (GCN) for local structural features and a NodeFormer (a linear Graph Transformer) for global dependencies.

Overview of the GTCA framework, illustrating the intersection of GNN, Transformer, and topological views to identify trustworthy positive pairs.

1. Dual Encoders and Architectural Bias

By using both a GNN and a Transformer, GTCA exploits their inherent inductive biases. The GNN focuses on the immediate neighborhood, while the Transformer captures long-range interactions. This "architectural augmentation" provides two different but semantically consistent views of the same node without breaking the graph's structure.

2. Trustworthy Node Sampling

Instead of treating all nodes as potential negatives, GTCA identifies "trustworthy" positive pairs by finding the intersection of three sets:

  • GNN $k$-NN: Neighbors in the GNN's embedding space.
  • Transformer $k$-NN: Neighbors in the Transformer's embedding space.
  • Topological $k$-NN: Neighbors within a certain number of hops in the original graph.

This intersection ensures that the selected positive pairs are structurally, globally, and topologically related, significantly reducing the risk of pulling together semantically unrelated nodes.

3. Multi-Positive Contrastive Loss

Standard contrastive losses like InfoNCE often assume a single positive pair per anchor. GTCA introduces a multi-positive loss function that accommodates multiple trustworthy neighbors, preventing the model from erroneously pushing away nodes that belong to the same semantic class.

Experimental Results

The model was evaluated on five benchmark datasets: Cora, Wiki-CS, Coauthor-CS, Amazon-Computers, and Amazon-Photo.

  • State-of-the-Art Performance: GTCA achieved the highest node classification accuracy on three of the five datasets (Cora, Coauthor-CS, and Amazon-Photo) and ranked second on the remaining two.
  • High-Quality Positive Pairs: A key metric, the "correct ratio" (the percentage of positive pairs sharing the same label), reached over 80% for GTCA. In contrast, methods using single encoders or random augmentations often fell below 40%, highlighting the effectiveness of the "trustworthy intersection" strategy.
  • Ablation Success: Experiments confirmed that removing any of the three views (GNN, Transformer, or Topology) leads to a performance drop, validating the necessity of the cooperative design.

Conclusion

GTCA represents a significant step toward more reliable Graph Contrastive Learning. By replacing random augmentations with architectural cooperation, it mitigates semantic disturbance and improves the quality of learned representations. While the dual-encoder setup increases computational complexity, the use of linear Transformers like NodeFormer helps maintain scalability. Future work will focus on further optimizing the architecture for massive-scale graphs and exploring distributed training strategies.

Summary updated

BibTeX
@inproceedings{liang2025gnn,
  author = {Jianqing Liang and Xinkai Wei and Min Chen and Zhiqiang Wang and Jiye Liang},
  title = {{GNN-Transformer Cooperative Architecture for Trustworthy Graph Contrastive Learning}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i18.34054},
}
Figure