Large Language Models (LLMs) have shown potential in reasoning over structured environments, e.g., knowledge graph and table. Such tasks typically require multi-hop reasoning, i.e., match natural language utterance with instances in the environment. Previous methods leverage LLMs to incrementally build a reasoning path, where the LLMs either invoke tools or pick up schemas by step-by-step interacting with the environment. We propose Reasoning-Path-Editing (Readi), a novel framework where LLMs can efficiently and faithfully reason over structured environments. In Readi, LLMs initially generate a reasoning path given a query, and edit the path only when necessary. We instantiate the path on structured environments and provide feedback to edit the path if anything goes wrong. Experimental results on three KGQA datasets and two TableQA datasets show the effectiveness of Readi, significantly surpassing all LLM-based methods (by 9.1% on WebQSP, 12.4% on MQA-3H and 10.9% on WTQ), comparable with state-of-the-art fine-tuned methods (67% on CWQ and 74.7% on WebQSP) and substantially boosting the vanilla LLMs (by 14.9% on CWQ). Our code will be available upon publication.
翻译:大语言模型在知识图谱、表格等结构化环境下的推理展现出潜力。此类任务通常需要多跳推理,即将自然语言表述与环境中的实例相匹配。现有方法利用大语言模型逐步构建推理路径,通过与环境的逐步骤交互来调用工具或选取模式。我们提出推理路径编辑(Readi)——一种新型框架,使大语言模型能在结构化环境中实现高效且忠实的推理。在Readi框架中,大语言模型初始根据查询生成推理路径,仅在必要时进行路径编辑。我们在结构化环境中实例化该路径,并在出现错误时提供反馈以修正路径。在三个知识图谱问答数据集和两个表格问答数据集上的实验结果表明,Readi方法显著超越所有基于大语言模型的方法(在WebQSP上提升9.1%,MQA-3H提升12.4%,WTQ提升10.9%),与当前最优的微调方法性能相当(CWQ上67%,WebQSP上74.7%),并大幅提升原始大语言模型性能(CWQ上提升14.9%)。我们的代码将在论文发表后公开。