让大模型像专家一样编程分析图数据,突破小规模限制
Can Large Language Models Analyze Graphs like Professionals? A Benchmark, Datasets and Models
- 设计编程式图任务基准,要求模型写代码而非直接推理
- 当前最佳模型仅36%准确率,表明大模型处理结构化数据能力不足
- 提供代码数据集和微调方案,提升模型性能11%-32%
图数据分析在社交网络、生物研究和推荐系统等领域广泛应用。当前大语言模型(LLMs)的图分析基准通常要求模型直接基于描述图拓扑的提示进行推理,仅适用于节点数仅几十个的小规模图。而人类专家通常使用流行库编写程序来解决问题,可应对不同规模的图。因此,一个关键问题是:大模型能否像专业人士一样分析图?本文提出ProGraph,一个手动构建的基准,包含三类图任务,要求解决方案以编程形式给出,而非直接处理原始输入。实验发现,当前最先进模型仅达到36%准确率。为弥补差距,我们构建了LLM4Graph数据集,包含从6个主流图库爬取的文档和自动生成的代码。通过引入文档检索增强闭源模型,并在代码上微调开源模型,实现11%-32%的准确率提升。结果表明,大模型处理结构化数据的能力仍待开发,且LLM4Graph有效提升了其图分析能力。基准、数据集与优化后的开源模型已开源。
原文摘要 · Abstract (English)
The need to analyze graphs is ubiquitous across various fields, from social networks to biological research and recommendation systems. Therefore, enabling the ability of large language models (LLMs) to process graphs is an important step toward more advanced general intelligence. However, current LLM benchmarks on graph analysis require models to directly reason over the prompts describing graph topology, and are thus limited to small graphs with only a few dozens of nodes. In contrast, human experts typically write programs based on popular libraries for task solving, and can thus handle graphs with different scales. To this end, a question naturally arises: can LLMs analyze graphs like professionals? In this paper, we introduce ProGraph, a manually crafted benchmark containing 3 categories of graph tasks. The benchmark expects solutions based on programming instead of directly reasoning over raw inputs. Our findings reveal that the performance of current LLMs is unsatisfactory, with the best model achieving only 36% accuracy. To bridge this gap, we propose LLM4Graph datasets, which include crawled documents and auto-generated codes based on 6 widely used graph libraries. By augmenting closed-source LLMs with document retrieval and fine-tuning open-source ones on the codes, we show 11-32% absolute improvements in their accuracies. Our results underscore that the capabilities of LLMs in handling structured data are still under-explored, and show the effectiveness of LLM4Graph in enhancing LLMs' proficiency of graph analysis. The benchmark, datasets and enhanced open-source models are available at https://github.com/BUPT-GAMMA/ProGraph.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。