Description
Tree of Thoughts is an implementation of the Tree of Thoughts method, which makes a language model reason by search instead of a single pass. The model proposes several candidate next steps, scores each one, prunes weak branches and backtracks when a line of reasoning fails. The paper reports that GPT-4 with chain-of-thought prompting solved 4 percent of Game of 24 puzzles, and with Tree of Thoughts it solved 74 percent. The README notes that this implementation now ships as TreeOfThoughts in the Swarms framework, and its examples use that version. The search works in steps: generate candidate thoughts either all in one call or one call per step, evaluate them on their own or by comparing and voting, then explore with a breadth-first beam or a depth-first search with backtracking. Every model output is a function call checked against a Pydantic schema, and calls at the same level run concurrently. The configuration table lists options such as the model, search algorithm, number of thoughts, beam width and maximum depth. Any LiteLLM model that supports function calling can be used. The project is on GitHub.…
Highlights
- Search-based reasoning with pruning and backtracking
- Breadth-first and depth-first search options
- Propose or sample generation, value or vote evaluation
- Schema-checked model outputs with concurrent calls
Ratings & Reviews
No ratings yet
Be the first to rate Tree Of Thoughts.
People also visit
Tree Of Thoughts FAQ
What is Tree of Thoughts?
A method that lets a language model reason by searching a tree of candidate steps, scoring them, pruning weak ones and backtracking, instead of answering in one pass.
What results does the paper report?
The README says GPT-4 with chain-of-thought prompting solved 4 percent of Game of 24 puzzles, and with Tree of Thoughts it solved 74 percent.
Which models can I use?
Any LiteLLM model string that supports function calling, such as models from OpenAI, Anthropic or Groq, with the matching API key.
What does the search setting change?
The bfs option keeps the best nodes per level, and dfs follows the best child first and backtracks. Breadth sets the beam width for bfs.
Where does the code live now?
The README says it ships as TreeOfThoughts in the Swarms framework, and its examples and docs use that implementation.
Is it free?
The source is public on GitHub, so it is open source.
What are the best Tree Of Thoughts alternatives?
Popular alternatives to Tree Of Thoughts include Diagram Of Thought, Type Think AI and Thoughtdag. See all Tree Of Thoughts alternatives







