[论文解读] Can Language Models Solve Graph Problems in Natural Language?
论文引入 NLGraph,一个大型自然语言图推理基准,展示大语言模型具备初步的图推理能力,并提出 Build-a-Graph 与 Algorithmic prompting 来提升在更简单任务上的表现。结果显示取得提升但复杂的图推理仍具挑战。
Large language models (LLMs) are increasingly adopted for a variety of tasks with implicit graphical structures, such as planning in robotics, multi-hop question answering or knowledge probing, structured commonsense reasoning, and more. While LLMs have advanced the state-of-the-art on these tasks with structure implications, whether LLMs could explicitly process textual descriptions of graphs and structures, map them to grounded conceptual spaces, and perform structured operations remains underexplored. To this end, we propose NLGraph (Natural Language Graph), a comprehensive benchmark of graph-based problem solving designed in natural language. NLGraph contains 29,370 problems, covering eight graph reasoning tasks with varying complexity from simple tasks such as connectivity and shortest path up to complex problems such as maximum flow and simulating graph neural networks. We evaluate LLMs (GPT-3/4) with various prompting approaches on the NLGraph benchmark and find that 1) language models do demonstrate preliminary graph reasoning abilities, 2) the benefit of advanced prompting and in-context learning diminishes on more complex graph problems, while 3) LLMs are also (un)surprisingly brittle in the face of spurious correlations in graph and problem settings. We then propose Build-a-Graph Prompting and Algorithmic Prompting, two instruction-based approaches to enhance LLMs in solving natural language graph problems. Build-a-Graph and Algorithmic prompting improve the performance of LLMs on NLGraph by 3.07% to 16.85% across multiple tasks and settings, while how to solve the most complicated graph reasoning tasks in our setup with language models remains an open research question. The NLGraph benchmark and evaluation code are available at https://github.com/Arthur-Heng/NLGraph.
研究动机与目标
- 评估大语言模型在以自然语言描述时,是否能够对图进行推理。
- 量化提示策略对不同难度的基于图的任务的影响。
- 识别LLMs的局限性,包括对虚假的相关性易脆性,以及在复杂任务上收益降低。
- 提出基于指令的提示方法以提升图推理能力。
提出的方法
- 开发 NLGraph,涵盖八个从易到难的图任务,总共 29,370 道题。
- 使用随机图生成器为每个任务创建题目实例和自然语言提示。
- 评估大语言模型(GPT-3/4 家族)在零样本、少量样本、链式思维、零-shot-CoT、由最少到最多(least-to-most)和自一致性 prompts 下的表现。
- 为若干任务引入部分分数指标,以捕捉近似正确的推理。
- 提出 Build-a-Graph 提示,将图描述置于概念空间中以便求解,并提出 Algorithmic prompting 来回忆特定于题目的算法。

实验结果
研究问题
- RQ1当问题以自然语言描述时,LLMs 能否进行显式的图算法推理?
- RQ2提示策略如何影响 LLM 在简单与复杂图任务上的表现?
- RQ3上下文内示例和高级提示在更难的图推理问题上是否有帮助?
- RQ4基于指令的提示是否能够降低对图问题中虚假相关性的依赖?
主要发现
- LLMs 展现出初步的图推理能力,在简单任务上通过链式思维提示相对于随机基线的提升幅度为 37.33% 到 57.82%。
- 在更复杂的图问题上,进阶提示的收益减弱,链式思维(CoT)、由少到多(LtM)和自一致性(SC)在如拓扑排序和哈密尔顿路径等任务上常常逊于少样本提示。
- 上下文学习在复杂的图推理上可能适得其反,在某些任务上零样本有时甚至优于少样本。
- LLMs 对虚假相关性(如连通性中的链和团体情形)表现出脆弱性,可能显著降低性能。
- Build-a-Graph 提示和 Algorithmic 提示在若干任务上带来 3.07% 至 16.85% 的提升,尽管最复杂的问题仍是待解的研究问题。

阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。