TL;DR
This paper introduces ConGraT, a novel self-supervised method for learning joint embeddings of text and nodes in text-attributed graphs (TAGs). By leveraging a contrastive learning objective inspired by CLIP, ConGraT effectively aligns representations from language models and graph neural networks, leading to significant improvements across various downstream tasks like node classification, link prediction, and language modeling.
What Problem Does This Paper Address?
Many real-world datasets involve both textual information and graph structures (e.g., social media posts and user connections, academic papers and citation networks). Effectively modeling these "text-attributed graphs" (TAGs) is challenging. Existing approaches often make strong assumptions about specific downstream tasks, rely on labeled data, or fail to balance the importance of both text and graph representations. This leads to models that excel at one modality but neglect the other, or require task-specific fine-tuning. The authors aim to bridge this gap by proposing a general, self-supervised pretraining method that learns unified representations for both text and graph nodes.
Methods
The core of ConGraT is a self-supervised contrastive learning framework. It uses separate encoders for text (a pre-trained language model, PLM) and graph nodes (a graph neural network, GNN). These encoders are trained to align their output embeddings into a common latent space. The training objective is inspired by CLIP, using a batch-wise contrastive loss. A key innovation is an extension to the CLIP objective that incorporates graph structure information. This extension uses graph-based similarity functions (like SimRank) to create "soft" targets, allowing the model to learn more nuanced relationships between texts and nodes, going beyond simple positive/negative pairs. This approach is inductive, meaning it can generalize to unseen graphs.
Datasets
The authors evaluate ConGraT on three diverse datasets:
- Pubmed: A citation network dataset where nodes are research papers and texts are their titles and abstracts.
- T-REx: A dataset of Wikipedia articles, using introductory paragraphs as text and hyperlinks as graph edges.
- Twitter: A novel dataset of influential users, their tweets, and their follow graph, including demographic information. This dataset was specifically curated to explore social network TAGs.
Key Insights and Ideas
- Graph Structure Enhances Text Embeddings: Incorporating graph similarity into the contrastive loss (using the parameter $\alpha > 0$) consistently improves performance on various tasks, demonstrating that graph structure provides valuable context for understanding text.
- Unified Latent Space is Powerful: The joint embedding space learned by ConGraT shows significantly increased alignment between text-text distances and node-node distances compared to separately trained unimodal models. This suggests a more holistic understanding of the data.
- Inductive Learning is Key: ConGraT's encoders are trained in a way that allows them to generalize to unseen graphs, which is crucial for real-world applications where new data is constantly generated.
- Textually Grounded Communities: ConGraT can identify communities in social networks that are more aligned with textual content and discussion, offering a new perspective beyond purely graph-based community detection.
Key Results
- Node Classification: ConGraT models consistently outperform strong unimodal and cross-modal baselines on node classification tasks across all three datasets, achieving the highest performance in most cases.
- Link Prediction: ConGraT models show significant improvements in link prediction, with the best model on Twitter achieving an AUC of 0.806, a relative increase of 11.5% over the best baseline.
- Language Modeling: ConGraT's text encoder, when used for language modeling, achieves consistently lower average perplexity compared to a unimodal LM baseline, indicating that joint pretraining enhances language understanding.
- Geometric Alignment: Analysis shows that ConGraT significantly increases the correlation between distances in the embedding space and graph-based similarity metrics, indicating better integration of modalities.
Limitations and Future Work
- Directed Graphs: The authors note that choosing and validating a directed similarity function for texts remains an open area for future work. Experiments with $\alpha > 0$ for directed graphs were omitted.
- Batch Size Sensitivity: The contrastive objective is quadratically more difficult with increasing batch size. Future work could explore returns to scale and more efficient batching strategies.
- Hyperparameter Tuning: While $\alpha = 0.1$ is suggested as a reasonable default, tuning this parameter can further improve performance, especially for language modeling tasks where $\alpha = 1.0$ showed promise.
- Computational Cost: Training all models together required a significant amount of GPU time, highlighting the need for efficient training strategies.
Summary updated