tree-of-thoughts  by kyegomez

Plug-and-play implementation of Tree of Thoughts for LLM reasoning

created 2 years ago
4,522 stars

Top 11.1% on sourcepulse

GitHubView on GitHub
Project Summary

This repository provides a plug-and-play implementation of the Tree of Thoughts (ToT) framework, designed to enhance the reasoning capabilities of Large Language Models (LLMs). It targets developers and researchers seeking to improve LLM performance on complex tasks by enabling deliberate problem-solving strategies. The primary benefit is a significant uplift in model reasoning, claimed to be at least 70%.

How It Works

The implementation leverages a Tree of Thoughts approach, allowing LLMs to explore multiple reasoning paths. It supports a Depth-First Search (DFS) algorithm for traversing these thought trees, with parameters like threshold for evaluating thought quality, max_loops for controlling search depth, and prune_threshold for pruning less promising branches. This structured exploration enables more systematic and robust problem-solving compared to standard sequential generation.

Quick Start & Requirements

  • Install via pip: pip3 install -U tree-of-thoughts
  • Requires an .env file with WORKSPACE_DIR and OPENAI_API_KEY.
  • Example usage and detailed prompts are provided in the README.
  • Official documentation and demo links are not explicitly provided, but the README serves as a primary guide.

Highlighted Details

  • Claims to elevate model reasoning by at least 70%.
  • Offers a plug-and-play interface for integrating custom models.
  • Implements a DFS agent with configurable search parameters.
  • Includes example prompts demonstrating multi-expert, collaborative reasoning simulation.

Maintenance & Community

The project acknowledges contributions from researchers at Princeton University and Google DeepMind, indicating a strong academic foundation. There are no explicit links to community channels like Discord or Slack, nor a public roadmap.

Licensing & Compatibility

The project is licensed under the Apache License 2.0, which permits commercial use and modification.

Limitations & Caveats

The project is marked with several "Todo" items, including finishing the implementation of max_loops in the DFS class, implementing BFS and Monte Carlo search algorithms, and developing a visualization tool. This suggests the project is still under active development and may have incomplete features.

Health Check
Last commit

4 days ago

Responsiveness

Inactive

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

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), John Yang John Yang(Author of SWE-bench, SWE-agent), and
7 more.

tree-of-thought-llm by princeton-nlp

0.3%
5k
Research paper implementation for Tree of Thoughts (ToT) prompting
created 2 years ago
updated 6 months ago
Feedback? Help us improve.