通过排序与采样提升大模型理解图结构的能力
GraphSOS: Graph Sampling and Order Selection to Help LLMs Understand Graphs Better
- 设计顺序选择模块确保图的自然语言描述有序
- 采样子图并提升零样本任务准确率,最高达89.2%
- 适合需要图推理的大模型应用开发者
大型语言模型(LLM)在多个领域取得成功,研究人员尝试将图数据转化为自然语言文本以应用于图相关问题。然而,与图数据不同,自然语言具有固有的序列顺序。我们观察到一个反直觉现象:当图的节点或边的自然语言描述顺序被打乱时,尽管描述的是同一图,模型性能在高精度与随机猜测间波动。此外,由于LLM输入上下文长度有限,现有方法通常随机采样目标节点的邻居作为其邻域代表,这未必能支持准确推理。为此,我们提出GraphSOS(图采样与顺序选择),该框架包含顺序选择模块以确保图的正确序列化,以及子图采样模块以选择结构更优的子图用于推理。此外,我们通过蒸馏获得图式思维链(Graph CoT),并通过指令微调增强LLM在图任务中的推理与零样本学习能力。在多个节点分类和图问答数据集上的实验表明,GraphSOS显著提升了LLM在图任务上的性能与泛化能力。
原文摘要 · Abstract (English)
The success of Large Language Models (LLMs) in various domains has led researchers to apply them to graph-related problems by converting graph data into natural language text. However, unlike graph data, natural language inherently has sequential order. We observe a counter-intuitive fact that when the order of nodes or edges in the natural language description of a graph is shuffled, despite describing the same graph, model performance fluctuates between high performance and random guessing. Additionally, due to LLMs' limited input context length, current methods typically randomly sample neighbors of target nodes as representatives of their neighborhood, which may not always be effective for accurate reasoning. To address these gaps, we introduce GraphSOS (Graph Sampling and Order Selection). This novel model framework features an Order Selector Module to ensure proper serialization order of the graph and a Subgraph Sampling Module to sample subgraphs with better structure for better reasoning. Furthermore, we propose Graph CoT obtained through distillation, and enhance LLM's reasoning and zero-shot learning capabilities for graph tasks through instruction tuning. Experiments on multiple datasets for node classification and graph question-answering demonstrate that GraphSOS improves LLMs' performance and generalization ability on graph tasks.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。