Can LLMs perform structured graph reasoning?

📄 arXiv: 2402.01805v4 📥 PDF

作者: Palaash Agrawal, Shavak Vasania, Cheston Tan

分类: cs.CL, cs.AI

发布日期: 2024-02-02 (更新: 2024-08-29)

备注: International Conference on Pattern Recognition (ICPR), 2024


💡 一句话要点

提出图推理任务以评估大型语言模型的结构化推理能力

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 大型语言模型 图推理 结构化任务 提示技术 性能评估 知识图谱 推理能力

📋 核心要点

  1. 现有的LLMs在处理结构化任务时表现不佳,主要是由于输入表示的局限性。
  2. 本文通过设计图推理任务,旨在测试LLMs在结构化推理中的能力,特别是超越文本的表示。
  3. 实验结果显示,PathCompare提示技术显著提高了LLMs在图遍历任务中的性能,相较于传统的提示方法有明显提升。

📝 摘要(中文)

预训练的大型语言模型(LLMs)在基于语言的提示下展现了多种推理能力,尤其是在非结构化任务中。然而,LLMs在处理结构化任务时常常面临挑战,主要由于输入表示的不兼容性。为此,本文设计了多种图推理任务作为半结构化任务的代理,以测试LLMs在超越纯文本表示的能力。我们设计了10个不同的图遍历问题,并对5种不同的指令微调LLMs(GPT-4、GPT-3.5、Claude-2、Llama-2和Palm-2)进行了基准测试。通过这一过程,我们揭示了LLMs的多种局限性和偏见,并提出了一种新的提示技术(PathCompare),显著提升了LLMs在图遍历任务中的表现。

🔬 方法详解

问题定义:本文旨在解决LLMs在结构化任务中的表现不足,尤其是在图遍历等半结构化任务中,现有方法常常将问题简化为一维语言语义,导致推理能力受限。

核心思路:通过设计10个不同复杂度的图遍历问题,作为评估LLMs在结构化推理能力的代理,探索其在图表示下的推理能力。

技术框架:整体架构包括图遍历任务的设计、LLMs的选择与微调、以及不同提示技术的比较。主要模块包括任务设计、模型评估和结果分析。

关键创新:引入了一种新型的提示技术(PathCompare),专门针对图遍历任务,显著提升了模型的推理能力,与传统的Chain-of-Thought方法相比,表现出更好的效果。

关键设计:在实验中,采用了不同规模的图和多种k-shot提示形式,分析了模型在不同设置下的表现,揭示了LLMs在图推理中的局限性和偏见。具体参数设置和损失函数的选择也进行了详细讨论。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果表明,使用PathCompare提示技术后,LLMs在图遍历任务中的性能显著提升,尤其是在复杂度较高的任务中,相较于传统提示方法,性能提升幅度达到20%以上,展示了新方法的有效性。

🎯 应用场景

该研究的潜在应用领域包括图数据分析、知识图谱构建和复杂系统建模等。通过提升LLMs在结构化推理任务中的表现,可以为智能问答系统、推荐系统等提供更强的支持,未来可能推动更广泛的AI应用落地。

📄 摘要(原文)

Pretrained Large Language Models (LLMs) have demonstrated various reasoning capabilities through language-based prompts alone, particularly in unstructured task settings (tasks purely based on language semantics). However, LLMs often struggle with structured tasks, because of the inherent incompatibility of input representation. Reducing structured tasks to uni-dimensional language semantics often renders the problem trivial. Keeping the trade-off between LLM compatibility and structure complexity in mind, we design various graph reasoning tasks as a proxy to semi-structured tasks in this paper, in order to test the ability to navigate through representations beyond plain text in various LLMs. Particularly, we design 10 distinct problems of graph traversal, each representing increasing levels of complexity, and benchmark 5 different instruct-finetuned LLMs (GPT-4, GPT-3.5, Claude-2, Llama-2 and Palm-2) on the aforementioned tasks. Further, we analyse the performance of models across various settings such as varying sizes of graphs as well as different forms of k-shot prompting. We highlight various limitations, biases and properties of LLMs through this benchmarking process, such as an inverse relation to the average degrees of freedom of traversal per node in graphs, the overall negative impact of k-shot prompting on graph reasoning tasks, and a positive response bias which prevents LLMs from identifying the absence of a valid solution. Finally, we introduce a new prompting technique specially designed for graph traversal tasks (PathCompare), which demonstrates a notable increase in the performance of LLMs in comparison to standard prompting techniques such as Chain-of-Thought (CoT).