[Paper Review] Leveraging Contrastive Learning for Enhanced Node Representations in Tokenized Graph Transformers
This paper proposes GCFormer, a novel graph Transformer that enhances node representations by generating both positive (high-similarity) and negative (low-similarity) token sequences for each node, leveraging contrastive learning to improve representation quality. The method achieves state-of-the-art performance on node classification across diverse graphs, including homophily and heterophily settings, by capturing both commonalities and disparities in node features.
While tokenized graph Transformers have demonstrated strong performance in node classification tasks, their reliance on a limited subset of nodes with high similarity scores for constructing token sequences overlooks valuable information from other nodes, hindering their ability to fully harness graph information for learning optimal node representations. To address this limitation, we propose a novel graph Transformer called GCFormer. Unlike previous approaches, GCFormer develops a hybrid token generator to create two types of token sequences, positive and negative, to capture diverse graph information. And a tailored Transformer-based backbone is adopted to learn meaningful node representations from these generated token sequences. Additionally, GCFormer introduces contrastive learning to extract valuable information from both positive and negative token sequences, enhancing the quality of learned node representations. Extensive experimental results across various datasets, including homophily and heterophily graphs, demonstrate the superiority of GCFormer in node classification, when compared to representative graph neural networks (GNNs) and graph Transformers.
Motivation & Objective
- To address the limitation of existing tokenized graph Transformers that only use high-similarity nodes for token sequences, ignoring valuable information from dissimilar nodes.
- To improve node representation learning by capturing both commonalities (via positive tokens) and disparities (via negative tokens) in graph structures.
- To enhance model performance in node classification by integrating contrastive learning with a hybrid token generation strategy.
- To investigate the impact of sampling strategies and feature fusion on node representation quality in graph Transformers.
Proposed method
- GCFormer introduces a hybrid token generator that creates two distinct token sequences per node: positive tokens from high-similarity nodes and negative tokens from low-similarity nodes in both attribute and topology spaces.
- The model employs a tailored Transformer-based backbone to process both positive and negative token sequences, enabling the model to learn from diverse node relationships.
- Contrastive learning is applied between positive and negative token sequences to optimize node representations by maximizing similarity between positive pairs and minimizing it between negative pairs.
- A learnable fusion parameter α dynamically combines attribute-aware and topology-aware token representations, allowing adaptive weighting based on graph characteristics.
- The model uses a dual-sampling strategy with separate hyperparameters np (positive samples) and nk (negative samples), enabling control over representation diversity and relevance.
- The contrastive loss is formulated to align positive token sequences while pushing negative ones apart, improving the discriminative power of learned node embeddings.
Experimental results
Research questions
- RQ1How does incorporating negative node tokens alongside positive ones affect node representation quality in tokenized graph Transformers?
- RQ2What is the optimal balance between positive and negative token sequences in terms of model performance across different graph types?
- RQ3How does the fusion of attribute and topology features influence the discriminative capability of learned node representations?
- RQ4To what extent does contrastive learning improve node classification accuracy when applied to diverse token sequences in graph Transformers?
- RQ5How sensitive is GCFormer’s performance to hyperparameters such as np, nk, and α across heterogeneous graphs?
Key findings
- GCFormer achieves state-of-the-art performance on node classification across multiple datasets, including citation networks (Cora, PubMed, Citeseer), social networks (Photo, BlogCatalog, Flickr), and heterogeneous graphs (ACM), outperforming representative GNNs and graph Transformers.
- The inclusion of negative token sequences significantly improves model performance, with GCFormer-C (with contrastive learning but without negative tokens) underperforming GCFormer on most datasets, demonstrating the value of negative sampling.
- Optimal performance is achieved when α ∈ (0,1), indicating that jointly modeling attribute and topology features is essential for learning distinguishable representations.
- The model is sensitive to sampling size: np performs best with small values on social networks (e.g., BlogCatalog, Flickr), while larger np values are preferred on citation networks, suggesting domain-specific optimization is needed.
- Experiments show that increasing nk beyond six improves performance on most datasets by enhancing the model’s ability to capture disparities, indicating that negative tokens contribute meaningfully to representation learning.
- Abllation studies confirm that both negative token generation and contrastive learning are critical components, as removing either leads to consistent performance drops across all datasets.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.