Skip to main content
QUICK REVIEW

[Paper Review] KG-Agent: An Efficient Autonomous Agent Framework for Complex Reasoning over Knowledge Graph

Jinhao Jiang, Kun Zhou|arXiv (Cornell University)|Feb 17, 2024
AI-based Problem Solving and PlanningComputer Science12 citations
TL;DR

KG-Agent presents an autonomous LLM-based agent that reasons over knowledge graphs using a multifunctional toolbox and memory, enabling a small 7B model to outperform larger baselines on KGQA and ODQA tasks with minimal tuning data.

ABSTRACT

In this paper, we aim to improve the reasoning ability of large language models (LLMs) over knowledge graphs (KGs) to answer complex questions. Inspired by existing methods that design the interaction strategy between LLMs and KG, we propose an autonomous LLM-based agent framework, called KG-Agent, which enables a small LLM to actively make decisions until finishing the reasoning process over KGs. In KG-Agent, we integrate the LLM, multifunctional toolbox, KG-based executor, and knowledge memory, and develop an iteration mechanism that autonomously selects the tool then updates the memory for reasoning over KG. To guarantee the effectiveness, we leverage program language to formulate the multi-hop reasoning process over the KG, and synthesize a code-based instruction dataset to fine-tune the base LLM. Extensive experiments demonstrate that only using 10K samples for tuning LLaMA-7B can outperform state-of-the-art methods using larger LLMs or more data, on both in-domain and out-domain datasets. Our code and data will be publicly released.

Motivation & Objective

  • Motivate improving reasoning over knowledge graphs (KGs) for complex questions beyond standard prompting of LLMs.
  • Propose an autonomous LLM-based agent that iteratively selects tools and updates memory to reason over KGs without human input.
  • Leverage code-based instruction tuning data synthesized from KGQA datasets to train a compact LLM (7B) for KG reasoning.
  • Demonstrate strong performance on in-domain KGQA datasets and competitive zero-shot results on out-of-domain open-domain QA tasks.
  • Highlight generalizability across different KGs and transferability to new domains.

Proposed method

  • Introduce a multifunctional toolbox with extraction, logic, and semantic tools to manipulate KG data and intermediate results.
  • Synthesize KG reasoning programs from KGQA datasets by grounding SQL-like queries into a chain of function calls that map to toolbox operations.
  • Fine-tune a small LLM (LLaMA-2-7B) with code-based instruction data derived from reasoning programs to perform KG reasoning steps.
  • Develop an autonomous reasoning loop where an LLM-based planner selects tools, an executor runs tool invocations on the KG, and knowledge memory stores question, toolbox, current KG info, and reasoning history.
  • Integrate memory updation to update histories and KG information after each tool execution, enabling step-by-step autonomous reasoning over KG.

Experimental results

Research questions

  • RQ1Can an autonomous, toolbox-driven LLM-based agent perform complex, multi-hop reasoning over knowledge graphs without human-designed plans?
  • RQ2How much instruction-tuning data and model size are needed for a small LLM to outperform larger LLM baselines on KGQA tasks?
  • RQ3Does integrating a knowledge memory and iterative tool selection improve reasoning reliability over KG-based tasks?
  • RQ4To what extent does the KG-Agent transfer to different knowledge graphs and domains (in-domain vs out-of-domain tasks)?

Key findings

  • With 10K instruction-tuning samples, a 7B LLM (LLaMA-2-7B) using KG-Agent outperforms baselines on in-domain KGQA datasets.
  • KG-Agent achieves improvements on CWQ and GrailQA datasets and shows usable zero-shot performance on out-of-domain QA benchmarks.
  • The autonomous tool-selection and memory-updating loop enables multi-hop KG reasoning without reliance on strong closed-source LLM APIs.
  • The proposed workflow yields robust transferability to another KG (MetaQA/Wikidata-based) and demonstrates domain transferability.
  • Limited instruction data (10K) suffices for competitive performance, while increasing beyond a threshold yields diminishing returns, suggesting data diversity is important.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.