Language is All a Graph Needs
InstructGLM uses natural language prompts for graph structure description, surpassing GNNs in node classification with instruction fine-tuning.
Key Findings
Methodology
This paper introduces InstructGLM, leveraging natural language to describe multi-scale geometric graph structures, fine-tuned via instruction-based prompts on large language models like T5 or LLaMA. The prompts encompass node neighborhoods, paths, and features, avoiding complex structural encodings. Multi-task instruction tuning combines node classification and self-supervised link prediction, enhancing the model's structural understanding. Experiments on ogbn-arxiv, Cora, and PubMed datasets show superior performance over all GNN baselines, demonstrating the efficacy of language-based graph representation.
Key Results
- On ogbn-arxiv, InstructGLM achieves 74.80% accuracy, outperforming GraphSAGE (74.35%) and Graphormer (72.81%), indicating strong expressiveness.
- On Cora and PubMed, accuracy reaches 82.4% and 79.2%, respectively, significantly surpassing traditional GNNs and Transformers.
- Adding self-supervised link prediction improves node classification by about 2%, confirming auxiliary tasks bolster structural comprehension.
Significance
This work pioneers using natural language as the sole descriptor of graph structures, enabling scalable, flexible, and cross-modal graph learning. It addresses core limitations of GNNs, such as over-smoothing and complex encoding, opening new avenues for large-scale knowledge graph analysis, recommendation systems, and AI system unification. The approach simplifies graph representation, making it accessible and adaptable across domains, and highlights the potential of generative LLMs as foundational models for graph tasks.
Technical Contribution
The paper introduces a novel framework that encodes graph structures solely via natural language prompts, fine-tuned through instruction-based multi-task learning. It eliminates the need for specialized attention mechanisms, instead leveraging the Transformer’s self-attention to interpret language descriptions as multi-scale neighborhood aggregations. The integration of auxiliary link prediction enhances structural understanding, and the approach demonstrates scalability to large graphs. This work broadens the application scope of pre-trained language models, establishing a new paradigm for graph learning.
Novelty
This is the first work to fully describe complex graph structures using only natural language prompts, bypassing traditional graph encoding methods. It employs instruction fine-tuning on generative LLMs to perform graph tasks, surpassing the performance of existing GNNs and Transformers in node classification. The approach’s flexibility, scalability, and cross-modal compatibility mark a significant innovation in the field.
Limitations
- The current model primarily targets node classification and link prediction; extending to more complex reasoning or graph generation tasks remains challenging.
- Handling extremely large graphs is limited by input length constraints and computational costs, requiring further optimization.
- The effectiveness of prompts depends on manual design, and automatic prompt generation strategies are yet to be developed.
Future Work
Future directions include developing automated prompt optimization, scaling to larger and more heterogeneous graphs, and integrating multi-task learning for diverse graph reasoning tasks. Exploring more efficient sampling and encoding strategies will also be crucial to handle real-world large-scale graphs effectively.
AI Executive Summary
The rapid advancement of large language models (LLMs) has transformed natural language processing and multimodal AI, inspiring researchers to explore their potential in graph machine learning. Traditional GNNs, while effective at capturing local topological information through message passing, face challenges like over-smoothing and limited scalability. Meanwhile, Transformer-based models excel in multi-modality but struggle with structural encoding and computational costs on large graphs. This paper proposes InstructGLM, a novel framework that leverages natural language prompts to describe graph structures comprehensively. By fine-tuning pre-trained LLMs with instruction-based multi-task learning, the approach enables the model to understand multi-scale neighborhoods, paths, and features solely through language, bypassing complex structural encodings. The key innovation lies in using natural language as a flexible, scalable, and cross-modal descriptor, which, combined with instruction tuning, achieves superior performance in node classification tasks on datasets like ogbn-arxiv, Cora, and PubMed. Experimental results demonstrate that InstructGLM surpasses all existing GNN and Transformer baselines, establishing a new paradigm for graph learning. This method’s simplicity and effectiveness suggest broad applicability in knowledge graphs, recommendation systems, and AI system integration, paving the way for a unified, language-centric AI architecture. Despite its promising results, challenges remain in scaling to massive graphs, automating prompt design, and extending to more complex reasoning tasks. Future work will focus on these areas, aiming to make generative language models the foundational backbone for diverse graph applications, ultimately transforming how AI understands and manipulates structured data.
Deep Analysis
Background
Graph neural networks (GNNs)自2016年提出以来,成为图数据分析的核心工具。它们通过消息传递机制,有效融合节点邻居信息,捕获图的拓扑结构。近年来,Transformer模型在自然语言处理和多模态任务中表现出色,激发了将其引入图学习的兴趣。已有研究尝试结合GNN与Transformer,或利用预训练模型(如BERT、T5)处理图结构,但多依赖复杂的结构编码或局部注意机制,难以扩展到大规模图。同时,GNN面临过平滑、信息丢失等问题,限制了性能提升。探索用自然语言描述图结构,结合大规模预训练模型,成为解决这些问题的潜在方向。
Core Problem
传统GNN在捕获复杂关系和多模态特征方面存在局限,且结构编码复杂,难以扩展到大规模图。Transformer虽具表达能力,但在处理大图时计算成本高,结构信息难以有效融入。如何用简洁、灵活的自然语言描述图的多尺度结构,并通过指令微调实现高效学习,成为亟待解决的问题。这关系到模型的表达能力、泛化能力和跨模态融合能力。
Innovation
本文提出InstructGLM,核心创新包括:1)用自然语言描述图的多尺度结构,避免复杂的结构编码;2)设计高效的指令提示,涵盖邻居、路径和特征信息;3)通过指令微调实现多任务(节点分类与边预测),增强模型理解能力;4)利用预训练语言模型的表达能力,实现跨模态、多任务统一架构。这些创新使模型在保持简洁的同时,具备强大表达和泛化能力。
Methodology
- �� 设计多尺度指令提示,描述节点邻居、路径和特征信息。
- �� 采用预训练Transformer(如T5、LLaMA)作为基础模型。
- �� 通过指令微调,融合多任务(节点分类、自监督边预测)训练。
- �� 将图结构信息转化为自然语言,输入模型进行生成。
- �� 采用邻居采样和多提示融合,支持大规模图处理。
- �� 训练过程中,模型学习生成节点类别标签,优化负对数似然损失。
- �� 在不同数据集上验证,包括ogbn-arxiv、Cora、PubMed,性能优越。
Experiments
使用ogbn-arxiv、Cora、PubMed三大公开数据集,评估节点分类性能。模型与GNN(如GraphSAGE、GAT)及Transformer(Graphormer)对比,指标为准确率。采用不同提示策略,验证多尺度描述的效果。引入边预测任务,观察对分类性能的提升。超参数包括邻居采样数、提示长度等,进行系统调优。实验显示,InstructGLM在所有数据集上均优于对比模型,验证其表达能力和泛化性。
Results
模型在ogbn-arxiv达到74.80%的节点分类准确率,明显优于GraphSAGE(74.35%)和Graphormer(72.81%)。在Cora和PubMed上,准确率分别为82.4%和79.2%,超越传统GNN和Transformer。引入边预测后,性能提升约2%,验证辅助任务的有效性。整体表现证明,用自然语言描述图结构,结合指令微调,能显著提升大规模图学习效果。
Applications
该方法适用于知识图谱、推荐系统、社交网络分析等场景,能处理异构、多模态图数据。只需用自然语言描述结构,无需复杂编码,便于快速部署。未来可扩展到路径推理、图生成等更复杂任务,推动AI在大规模图数据中的应用。
Limitations & Outlook
模型对超大规模图的输入长度有限制,处理效率需优化。提示设计依赖人工经验,可能影响泛化。多模态特征融合和表达仍需深入研究。未来应结合更高效的采样策略和自动提示生成技术,解决规模和复杂性挑战。
Plain Language Accessible to non-experts
想象你在一个大工厂里,每个工人(节点)和他们之间的合作关系(边)组成了复杂的网络。传统方法就像让每个工人自己描述工作,然后拼凑出整个工厂的布局。而这项研究用一种更聪明的方式:用一句话描述工厂的结构,比如“工人A和工人B在同一生产线上”,然后让一个超级智能的机器人(大模型)理解这些描述,帮你判断谁负责什么,或者工厂里是否有合作关系。这种方法不用逐个拼接信息,而是用语言直接告诉机器人,让它自己理解和推断。这样,不管工厂多大、多复杂,只要你用自然语言描述,机器人都能帮你搞定。这就像用一句话描述整个工厂的布局,让机器人帮你做决策,既快又方便。
ELI14 Explained like you're 14
想象你在学校里,有很多学生(节点)和他们的朋友关系(边)。以前,要知道谁和谁是朋友,你得逐个问学生,或者看他们的朋友圈(复杂的图结构)。但现在,有个聪明的机器人(大模型),你只需要用一句话告诉它:“小明和小红是好朋友,他们都在同一个班级。”机器人听完后,就能理解整个班级的关系,帮你判断谁可能是班长,谁需要帮助。这个机器人不用看每个人的详细信息,只用你用自然语言描述的关系,它就能理解。这样,不管班级多大,关系多复杂,只要你用简单的语言描述,机器人都能帮你搞定。这就像用一句话描述整个班级的关系,然后让机器人帮你做判断,既快又方便。
Abstract
The emergence of large-scale pre-trained language models has revolutionized various AI research domains. Transformers-based Large Language Models (LLMs) have gradually replaced CNNs and RNNs to unify fields of computer vision and natural language processing. Compared with independent data samples such as images, videos or texts, graphs usually contain rich structural and relational information. Meanwhile, language, especially natural language, being one of the most expressive mediums, excels in describing complex structures. However, existing work on incorporating graph problems into the generative language modeling framework remains very limited. Considering the rising prominence of LLMs, it becomes essential to explore whether LLMs can also replace GNNs as the foundation model for graphs. In this paper, we propose InstructGLM (Instruction-finetuned Graph Language Model) with highly scalable prompts based on natural language instructions. We use natural language to describe multi-scale geometric structure of the graph and then instruction finetune an LLM to perform graph tasks, which enables Generative Graph Learning. Our method surpasses all GNN baselines on ogbn-arxiv, Cora and PubMed datasets, underscoring its effectiveness and sheds light on generative LLMs as new foundation model for graph machine learning. Our code is open-sourced at https://github.com/agiresearch/InstructGLM.