Learning to Plan for Retrieval-Augmented Large Language Models from Knowledge Graphs

Junjie Wang, Mingyang Chen, Binbin Hu, Dan Yang, Ziqi Liu, Yue Shen, Peng Wei, Zhiqiang Zhang, Jinjie Gu, Jun Zhou, Jeff Z. Pan, Wen Zhang, Huajun Chen

Introduction

Large Language Models (LLMs) have demonstrated remarkable capabilities in natural language understanding and generation. However, when faced with complex, multi-step questions, even state-of-the-art models can struggle to formulate a coherent reasoning plan. This is particularly evident in Retrieval-Augmented Generation (RAG) tasks, where a model must decompose a query into simpler sub-questions to retrieve relevant information. While massive models like GPT-4 possess inherent planning abilities, smaller models (under 10B parameters) often fail to maintain the necessary logical structure, frequently falling victim to hallucinations or reasoning errors.

The LPKG (Learning to Plan from Knowledge Graphs) framework addresses this gap by leveraging the structured nature of Knowledge Graphs (KGs) to teach smaller LLMs how to plan. By grounding reasoning chains in factual graph structures, LPKG provides a scalable and accurate alternative to manual annotation or error-prone knowledge distillation.

The LPKG Methodology

The LPKG framework consists of a three-step pipeline designed to transform raw knowledge into executable reasoning plans for smaller models.

The LPKG three-step pipeline: Data Construction, Planning LLM Tuning, and Plan Execution.

1. Data Construction via KG Patterns

The core innovation of LPKG is using Knowledge Graphs as blueprints for reasoning. The authors define several logical patterns—such as multi-hop paths, intersections, unions, and comparisons—that represent common types of complex queries. These patterns are "grounded" in Wikidata to find real-world instances. For example, a "2-hop" pattern might identify a director and their spouse, forming the basis for a question like "Who is the spouse of the person who directed Inception?"

Logical patterns used to generate structured training data from Knowledge Graphs.

2. Verbalization and Fine-tuning

Once KG instances are identified, they are verbalized into natural language using a high-capacity model (like GPT-4) acting as a formatter. Crucially, the logic is derived from the KG, ensuring the training data is grounded in fact. The resulting dataset, comprising 9,000 planning entries, is used to fine-tune smaller models like Llama-3-8B and CodeQwen-1.5-7B. The models are trained to output plans in a code-like format, defining functions such as Search, Get_Answer, and Intersection. This approach reduces parsing errors and makes the reasoning process transparent.

3. Decoupled Execution

At inference time, the system decouples planning from execution. The fine-tuned "Planner" generates the steps, a "Retriever" fetches documents, and a separate "QA LLM" answers the simplified sub-questions. This separation allows the Planner to focus purely on procedural logic rather than factual recall, avoiding the "distraction" of trying to memorize facts.

Benchmarking and Results

The authors evaluated LPKG on standard multi-hop benchmarks (HotPotQA, 2WikiMultiHopQA, MuSiQue, Bamboogle) and a new, more rigorous benchmark called CLQA-Wiki (Comprehensive Logical QA). CLQA-Wiki specifically tests a model's ability to handle diverse logical operations beyond simple multi-hop reasoning, including intersection, union, and comparison logic.

Key Findings

  • Superior Performance: LPKG (using Llama-3-8B) significantly outperformed GPT-3.5-based baselines. On HotPotQA, it achieved an Exact Match (EM) score of 0.376, compared to 0.211 for ReAct and 0.176 for Self-Ask.
  • Quality over Distillation: LPKG outperformed models fine-tuned on GPT-3.5's own generated plans (0.272 vs 0.216 EM on Bamboogle). This suggests that KG-derived data provides a higher-quality training signal than raw LLM distillation.
  • Logical Robustness: On the CLQA-Wiki benchmark, LPKG showed a 20%+ improvement over standard in-context learning methods, particularly in complex intersection and union queries that often baffle standard RAG pipelines.

Discussion and Future Work

The success of LPKG demonstrates that smaller models can achieve high-level reasoning capabilities when provided with structured, logically sound training data. However, challenges remain. Error analysis indicates that the "Retriever" remains a significant bottleneck; even with a perfect plan, incorrect document retrieval can lead to failure.

Future work may explore "curriculum learning" to gradually increase the complexity of training patterns or expanding the verbalization process to handle the messy, implicit logic often found in real-world user queries that do not perfectly map to a KG schema.

Conclusion

LPKG offers a scalable, grounded framework for enhancing the planning capabilities of smaller LLMs. By turning Knowledge Graphs into reasoning blueprints, it enables 7B-8B parameter models to rival and often surpass much larger models in complex retrieval-augmented tasks.

Summary updated

BibTeX
@inproceedings{wang2024learning,
  author = {Junjie Wang and Mingyang Chen and Binbin Hu and Dan Yang and Ziqi Liu and Yue Shen and Peng Wei and Zhiqiang Zhang and Jinjie Gu and Jun Zhou and Jeff Z. Pan and Wen Zhang and Huajun Chen},
  title = {{Learning to Plan for Retrieval-Augmented Large Language Models from Knowledge Graphs}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  doi = {10.18653/v1/2024.findings-emnlp.459},
}
Figure