ToG  by DataArcTech

Research paper code for knowledge graph reasoning with LLMs

created 1 year ago
538 stars

Top 59.8% on sourcepulse

GitHubView on GitHub
Project Summary

This repository provides the official implementation for "Think-on-Graph" (ToG), a method for enhancing Large Language Model (LLM) reasoning capabilities by integrating Knowledge Graphs (KGs). It targets researchers and practitioners working with LLMs and KGs, offering a framework for deep and responsible reasoning.

How It Works

ToG integrates LLMs with KGs to improve reasoning accuracy and responsibility. The pipeline involves leveraging KG structures to guide LLM responses, potentially through techniques like graph traversal or embedding-based retrieval, to ensure more grounded and factual outputs. The specific mechanisms for this integration are detailed within the project's source code and documentation.

Quick Start & Requirements

  • Installation: Install dependencies via requirements.txt.
  • Prerequisites: Requires a local installation of either Freebase or Wikidata. Detailed setup instructions are provided in the respective Freebase/README.md and Wikidata/README.md files. For Wikidata usage, copy client.py and server_urls.txt from Wikidata/ to the ToG/ directory.
  • Running: Refer to ToG/README.md for execution details.
  • Evaluation: Convert output files (e.g., ToG_cwq.jsonl) to JSON format using tools/jsonl2json.py, then use scripts in the eval/ directory.

Highlighted Details

  • Official implementation for the ICLR 2024 paper "Think-on-Graph: Deep and Responsible Reasoning of Large Language Model with Knowledge Graph".
  • Supports reasoning over both Freebase and Wikidata knowledge graphs.
  • Includes separate modules for different KG backends and Chain-of-Thought (CoT) methods.

Maintenance & Community

The project is associated with IDEA (Shenzhen) and is actively seeking interns interested in LLMs and KGs. Contact email: xuchengjin@idea.edu.cn.

Licensing & Compatibility

  • License: Apache 2.0.
  • Compatibility: The project disclaims legal responsibility for model output and any resulting damages.

Limitations & Caveats

The project requires significant setup for local KG installations (Freebase or Wikidata), which can be resource-intensive and time-consuming. The README does not detail specific hardware requirements beyond the KG setup.

Health Check
Last commit

1 year ago

Responsiveness

1 week

Pull Requests (30d)
0
Issues (30d)
1
Star History
33 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.