Enhance Graph Alignment for Large Language Models

Haitong Luo, Xuying Meng, Suhang Wang, Tianxiang Zhao, Fali Wang, Hanyun Cao, Yujun ZhangarXiv 2024 · DOI

Introduction

Large Language Models (LLMs) have revolutionized natural language processing, yet their application to graph-structured data remains a significant challenge. Unlike linear text, graphs possess complex structural dependencies that are difficult to represent as simple token sequences. Current methodologies often employ a two-stage tuning process: self-supervised pre-training followed by supervised fine-tuning. However, this approach frequently suffers from "negative transfer," where the generative nature of pre-training tasks (e.g., node description) conflicts with the discriminative requirements of downstream tasks (e.g., node classification). This paper introduces GALLM (Graph Alignment Large Language Models), a framework designed to mitigate negative transfer by aligning instruction templates across both tuning stages.

The GALLM Framework

The core innovation of GALLM lies in reframing graph understanding as a discriminative text-matching problem. The framework operates in two distinct stages to ensure structural and semantic alignment.

Stage 1: Self-Supervised Instruction Tuning

Instead of traditional generative tasks, GALLM utilizes a text-matching objective. The model is tasked with matching a specific graph structure (e.g., a citation neighborhood) to its corresponding textual attribute (e.g., a paper title) from a set of candidates. By incorporating "hard negatives"—titles from neighboring nodes—the model is forced to learn fine-grained structural features rather than relying on broad semantic keywords.

Stage 2: Task-Specific Instruction Tuning

To bridge the gap to downstream applications, GALLM employs category-enhanced prompting. This includes Manual Prompts, which provide natural language definitions for class labels, and Soft Prompts, which utilize learnable "virtual tokens" to capture category-specific embeddings without requiring manual text.

The GALLM two-stage instruction tuning pipeline, illustrating the transition from self-supervised text matching to task-specific classification.

Experimental Evaluation

The framework was evaluated on standard text-attributed graph datasets, including Cora, Pubmed, Arxiv, and Instagram. These datasets cover a range of tasks from topic classification in citation networks to anomaly detection in social media. The architecture utilizes a frozen Vicuna-7B backbone, with only a lightweight MLP projector and soft prompt embeddings being updated during training, ensuring computational efficiency.

Key Results and Discussion

GALLM demonstrates superior performance in both supervised and zero-shot settings. In supervised tasks, GALLM-mp (manual prompt) achieved state-of-the-art accuracies of 0.8965 on Cora and 0.9115 on Pubmed, outperforming both traditional Graph Neural Networks (GNNs) and existing graph-LLM hybrids.

Performance metrics (Accuracy and F1 score) for the GALLM framework across the Cora and Pubmed datasets.

The model's zero-shot capabilities are particularly noteworthy. While previous models like GraphGPT struggled with a 0.0776 accuracy on Cora in a zero-shot context, GALLM achieved 0.5804. This suggests that the aligned instruction templates allow the model to generalize its learned structural understanding to unseen tasks and datasets effectively. Furthermore, GALLM exhibits strong cross-dataset generalization, maintaining high performance when trained on multiple datasets simultaneously without the catastrophic forgetting typical of smaller GNN architectures.

Conclusion

GALLM addresses the critical issue of negative transfer in graph-LLM alignment by synchronizing the format of pre-training and fine-tuning instructions. While highly effective for text-attributed graphs, future research is needed to extend this approach to non-textual domains, such as molecular modeling, and to more complex multi-hop reasoning tasks.

Summary updated

BibTeX
@misc{luo2024enhance,
  author = {Haitong Luo and Xuying Meng and Suhang Wang and Tianxiang Zhao and Fali Wang and Hanyun Cao and Yujun Zhang},
  title = {{Enhance Graph Alignment for Large Language Models}},
  year = {2024},
  eprint = {2410.11370},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.11370},
}
Figure