Call Me When Necessary: LLMs can Efficiently and Faithfully Reason over Structured Environments

Sitao Cheng, Ziyuan Zhuang, Yong Xu, Fangkai Yang, Chaoyun Zhang, Xiaoting Qin, Xiang Huang, Ling Chen, Qingwei Lin, Dongmei Zhang, Saravan Rajmohan, Qi Zhang

Abstract

Reasoning over large-scale structured environments (SEs), such as knowledge graphs and relational tables, remains a significant challenge for Large Language Models (LLMs). Current approaches typically oscillate between iterative, step-by-step interactions—which are faithful but computationally expensive—and end-to-end generation, which is efficient but prone to hallucination. This paper introduces Reasoning-Path Editing (Readi), a framework that shifts the paradigm to a "plan-then-verify-then-edit" workflow. By generating a complete reasoning path upfront and invoking the LLM only when symbolic grounding fails, Readi achieves state-of-the-art accuracy while requiring significantly fewer model calls. Our evaluations across KGQA and TableQA benchmarks demonstrate that Readi-GPT4 outperforms existing methods by up to 12.4% while maintaining high efficiency.

Introduction

Structured Environments (SEs) like Knowledge Graphs (KGs) and relational databases serve as the bedrock of factual information. However, bridging the gap between natural language queries and rigid database schemas is non-trivial. Existing solutions generally fall into two categories: iterative agents and end-to-end fine-tuning. Iterative agents interact with the environment step-by-step, ensuring faithfulness but suffering from high latency and "greedy" errors. Conversely, end-to-end models are fast but often hallucinate paths that do not exist in the underlying data.

The authors observe that LLMs possess strong planning capabilities; approximately 46-60% of reasoning paths generated by LLMs are correct on the first attempt. Readi is designed to exploit this planning ability while providing a safety net through symbolic grounding and targeted editing.

The Readi Framework

The Readi framework operates through a three-stage process: generation, instantiation, and editing. This workflow treats LLM interaction as an "exception handling" task, minimizing unnecessary compute.

  1. Reasoning Path Generation: Given a query, the LLM generates a complete reasoning path using Chain-of-Thought (CoT). For example, a query about a person's education might result in the path [Entity] -> father_of -> college.
  2. Path Instantiation: A symbolic module attempts to ground this path in the environment. This involves Relation Binding, where natural language relations are mapped to schema elements (using BM25 or Contriever), and Path Connecting, which uses Breadth-First Search (BFS) to find actual data instances.
  3. Path Editing: If instantiation fails—for instance, if a path leads to a dead end—the system generates an error message. This "traceback" includes the point of failure and valid candidate relations. The LLM is then called to edit only the problematic segment.
The Readi framework workflow: (a) Reasoning Path Generation, (b) Path Instantiation with symbolic grounding, and (c) Reasoning Path Editing triggered by failures.

Experimental Setup and Results

Readi was evaluated on five diverse benchmarks, including WebQuestionsSP (WebQSP), ComplexWebQuestions (CWQ), and MetaQA for KGs, as well as WikiTableQuestions (WTQ) and WikiSQL for tables. These datasets encompass varying levels of complexity, from single-hop to multi-hop reasoning over large-scale environments like Freebase.

Readi-GPT4 demonstrated superior performance, outperforming previous LLM-based methods by 9.1% on WebQSP and 12.4% on MetaQA-3H. Notably, it achieved results comparable to state-of-the-art fine-tuned models on CWQ (67.0% Hit@1). Beyond accuracy, Readi proved highly efficient; while iterative methods often require 4 to 8 LLM calls per query, Readi averaged only 1.55 calls for the editing phase.

Comparative analysis of Readi against state-of-the-art baselines across multiple metrics.

Discussion and Insights

The success of Readi stems from its global perspective. By planning the entire path first, the LLM avoids the local optima that often trap iterative agents. Furthermore, the error feedback mechanism mimics human-like debugging, providing the LLM with the necessary context to correct its mistakes effectively. Ablation studies confirmed that even when initial paths were intentionally corrupted, the editing module could recover the correct reasoning logic, highlighting the robustness of the feedback loop.

Conclusion and Future Work

Readi presents a compelling middle ground for reasoning over structured data, offering both the faithfulness of symbolic methods and the efficiency of plan-based generation. Future research will explore the framework's performance on smaller open-source models and the integration of robust entity linking systems. Additionally, addressing the computational cost of BFS for high-degree nodes through more sophisticated pruning remains a priority for scaling Readi to even larger environments.

Summary updated

BibTeX
@inproceedings{cheng2024call,
  author = {Sitao Cheng and Ziyuan Zhuang and Yong Xu and Fangkai Yang and Chaoyun Zhang and Xiaoting Qin and Xiang Huang and Ling Chen and Qingwei Lin and Dongmei Zhang and Saravan Rajmohan and Qi Zhang},
  title = {{Call Me When Necessary: LLMs can Efficiently and Faithfully Reason over Structured Environments}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.findings-acl.254},
}
Figure