TL;DR
This paper introduces G-CENSOR, a novel framework for graph contrastive learning that automatically generates "task-oriented counterfactual views" of graph data. By focusing on subgraphs that are causally related to a specific downstream task, G-CENSOR significantly improves the performance and generalizability of graph neural networks compared to existing methods.
What Problem Does This Paper Address?
Graph Contrastive Learning (GCL) has shown great promise in learning useful representations from graph data without explicit labels. However, a key challenge is how to generate the "contrastive views" (positive and negative examples) that are most beneficial for a specific downstream task. Current GCL methods often generate these views independently of the task, which can lead to suboptimal performance. Furthermore, some methods that try to incorporate task information might inadvertently learn spurious correlations between graph structures and task labels, hurting their generalizability. This paper addresses the problem of creating optimal, task-specific contrastive views for graph data, particularly for node property prediction tasks, to overcome these limitations.
Methods
G-CENSOR proposes a model-agnostic framework that generates task-oriented counterfactual views. The core idea is to ask: "Would a prediction for a given task change if a part of the graph's structure were removed?"
- Counterfactual Transformation Module (CTM): This module learns to decompose an ego-graph (a subgraph centered around a specific node) into two parts:
- Positive View (G+): Contains the subgraph structures that are causally correlated with the downstream task's label. Removing these would likely change the prediction.
-
Negative View (G-): Contains the subgraph structures that are spuriously correlated with the task's label. Removing these would likely not change the prediction. This is achieved by estimating the probability of an edge belonging to the positive view using MLPs, incorporating node features and structural information like random walk probabilities.
-
Contrastive Objective: G-CENSOR then trains a Graph Neural Network (GNN) using a contrastive loss that encourages the GNN's representations of the original ego-graph to be similar to its positive view (G+) and dissimilar to its negative view (G-). This objective is designed to be scalable and avoids the need for in-batch negative sampling.
- Joint Learning: The GNN and the CTM are trained jointly by optimizing a combined loss function that includes a standard prediction loss, a counterfactual loss (based on the CTM and contrastive objective), and a regularization term to encourage sparsity in the positive view.
Datasets
The paper evaluates G-CENSOR on eight real-world datasets across three domains:
- Citation Networks: CoraFull, CoraML, CiteSeer, DBLP, PubMed.
- Product Networks: Computers, Photo.
- Image Network: Flickr.
Key Insights and Ideas
- Causality is Key: The paper highlights that focusing on the causal relationship between graph substructures and task labels is crucial for effective GCL, rather than just learning correlations.
- Counterfactuals as a Tool: Using counterfactual reasoning (what-if scenarios) provides a principled way to identify these causally relevant substructures.
- Task-Specific Views: The ability to automatically generate views tailored to a specific task is a significant improvement over generic augmentation strategies.
- Generalizability Boost: By learning from causally relevant structures, G-CENSOR demonstrably improves model robustness to distribution shifts, a critical aspect for real-world applications.
- Scalability: The proposed contrastive loss design avoids in-batch negative sampling, addressing a common scalability bottleneck in GCL.
Key Results
- Performance Improvement: G-CENSOR consistently outperforms existing state-of-the-art GCL methods on node classification tasks, achieving the best performance in 23 out of 24 settings across the evaluated datasets. Average accuracy gains were significant, with improvements up to 20.67% for base GNNs and 1.87% over SOTA GCL methods.
- Generalizability Enhancement: G-CENSOR significantly improves performance on out-of-distribution (OOD) test sets, showing an average improvement of 6.02% for base GNNs and 1.62% over SOTA methods. This indicates better robustness to shifts in data distribution.
- Efficiency: The paper notes that G-CENSOR achieves a very fast runtime, comparable to or faster than many baseline methods, attributed to its simple edge probability estimator and lack of in-batch negative sampling.
Limitations and Future Work
- Counterfactual Inference: The authors suggest that future work could further improve counterfactual data synthesis by incorporating more advanced counterfactual inference techniques, such as those based on structural causal models (abduction, action, and prediction).
- Hyperparameter Sensitivity: While G-CENSOR shows robustness to some hyperparameters (like β), it is sensitive to others (like α), which controls the sparsity of the positive view. The optimal values for these parameters can vary across datasets, suggesting potential for automated tuning or adaptive strategies.
- Focus on Structure: The current work focuses on structure transformation for view generation. The authors note that it could be enhanced by considering node feature transformation as well.
Summary updated