arXiv:2604.01610cs.AI2026-04

让大模型通过工具化图遍历实现复杂推理,突破上下文长度限制。

GraphWalk: Enabling Reasoning in Large Language Models through Tool-Based Graph Navigation

  • 用少量通用图操作工具引导模型逐步导航知识图谱。
  • 在12种查询类型上显著超越传统提示方法,规模越大优势越明显。
  • 适合需要可解释多跳推理的工业级知识应用,如企业问答系统。

将知识图谱用于真实世界问答应用日益普遍。复杂问题通常需要多跳推理和对庞大关系结构的导航。现有方法依赖提示技术引导大模型在原始图上下文中推理,或检索增强生成流程将相关子图注入上下文。然而,这些方法在无法放入当前最大上下文窗口的企业级知识图谱面前面临严重局限。本文提出GraphWalk,一种无需训练、与任务无关的工具化框架,使现成的大语言模型能够通过序列化图遍历实现推理,显著提升各类任务表现。不同于将领域知识编码进专用工具的任务特定代理框架,GraphWalk仅提供一组正交的最小图操作,足以遍历任意图结构。我们评估配备GraphWalk的模型能否将这些操作组合成正确多步推理链,每一步工具调用均可验证并形成透明执行轨迹。首先在迷宫遍历问题上验证,非推理模型完全无法解决;随后在模拟企业级知识图谱的真实图上测试。为隔离结构推理与常识知识,我们在标签随机、无语义的合成图上进行评估。基准涵盖从基础检索到复合一阶逻辑查询的12种查询模板。结果表明,工具化遍历相比上下文基线在所有测试模型家族中均带来显著且一致的提升,且随着模型规模增大,优势愈发明显,恰是上下文方法彻底失效之处。

原文摘要 · Abstract (English)

The use of knowledge graphs for grounding agents in real-world Q&A applications has become increasingly common. Answering complex queries often requires multi-hop reasoning and the ability to navigate vast relational structures. Standard approaches rely on prompting techniques that steer large language models to reason over raw graph context, or retrieval-augmented generation pipelines where relevant subgraphs are injected into the context. These, however, face severe limitations with enterprise-scale KGs that cannot fit in even the largest context windows available today. We present GraphWalk, a problem-agnostic, training-free, tool-based framework that allows off-the-shelf LLMs to reason through sequential graph navigation, dramatically increasing performance across different tasks. Unlike task-specific agent frameworks that encode domain knowledge into specialized tools, GraphWalk equips the LLM with a minimal set of orthogonal graph operations sufficient to traverse any graph structure. We evaluate whether models equipped with GraphWalk can compose these operations into correct multi-step reasoning chains, where each tool call represents a verifiable step creating a transparent execution trace. We first demonstrate our approach on maze traversal, a problem non-reasoning models are completely unable to solve, then present results on graphs resembling real-world enterprise knowledge graphs. To isolate structural reasoning from world knowledge, we evaluate on entirely synthetic graphs with random, non-semantic labels. Our benchmark spans 12 query templates from basic retrieval to compound first-order logic queries. Results show that tool-based traversal yields substantial and consistent gains over in-context baselines across all model families tested, with gains becoming more pronounced as scale increases, precisely where in-context approaches fail catastrophically.

大模型推理知识图谱多跳推理工具调用

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。