Skip to content

Commit 23629f6

Browse files
committed
update readme.md
1 parent 733b009 commit 23629f6

File tree

1 file changed

+40
-22
lines changed

1 file changed

+40
-22
lines changed

readme.md

Lines changed: 40 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,44 +2,49 @@
22
[![DOI](https://zenodo.org/badge/642099326.svg)](https://zenodo.org/badge/latestdoi/642099326)
33

44
<details>
5-
<summary>Note: https://github.com/kyegomez/tree-of-thoughts is NOT the correct implementation to replicate paper results. </summary>
6-
5+
<summary>Note: https://github.com/kyegomez/tree-of-thoughts CANNOT replicate paper results. </summary>
6+
77
In fact, people have reported that his code [cannot](https://github.com/kyegomez/tree-of-thoughts/issues/52) [properly](https://github.com/kyegomez/tree-of-thoughts/issues/41) [run](https://github.com/kyegomez/tree-of-thoughts/issues/60), and is [probably automatically generated by ChatGPT](pics/fake.png), and [kyegomez has done so for other popular ML methods](https://twitter.com/qbitium/status/1663954096741814272), while intentionally refusing to link to official implementations for his own interests (see https://github.com/kyegomez/tree-of-thoughts/issues/54, https://github.com/kyegomez/tree-of-thoughts/issues/55, https://github.com/kyegomez/tree-of-thoughts/issues/56).
88
Unfortunately, Google/Github searches go to kyegomez's malicious repo by default as it has more stars. **Please DE-STAR his repo and STAR this to help other people avoid being misled, thanks!**
99
</details>
1010

1111

12-
13-
14-
1512
![teaser](pics/teaser.png)
1613

1714
Official implementation for paper [Tree of Thoughts: Deliberate Problem Solving with Large Language Models](https://arxiv.org/abs/2305.10601) with code, prompts, model outputs.
1815
Also check [its tweet thread](https://twitter.com/ShunyuYao12/status/1659357547474681857) in 1min.
1916

2017

21-
Please cite the paper and star this repo if you use ToT and find it interesting/useful. Thanks!
2218

23-
```bibtex
24-
@misc{yao2023tree,
25-
title={{Tree of Thoughts}: Deliberate Problem Solving with Large Language Models},
26-
author={Shunyu Yao and Dian Yu and Jeffrey Zhao and Izhak Shafran and Thomas L. Griffiths and Yuan Cao and Karthik Narasimhan},
27-
year={2023},
28-
eprint={2305.10601},
29-
archivePrefix={arXiv},
30-
primaryClass={cs.CL}
31-
}
32-
```
3319

3420

3521

3622
## Setup
37-
You need to first have an OpenAI API key and store it in the environment variable ``OPENAI_API_KEY`` (see [here](https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety)). If you use custom base url, set it by environment variable ``OPENAI_API_BASE`` (e.g. https://api.openai.com/v1).
23+
- Set up OpenAI API key and store in environment variable ``OPENAI_API_KEY`` (see [here](https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety)).
24+
25+
- Install dependencies and `tot` package:
26+
```bash
27+
pip install -r requirements.txt
28+
pip install -e . # install `tot` package
29+
```
3830

39-
Package requirement: ``pip install openai backoff sympy numpy``
4031

32+
## Quick Start
33+
The following minimal script will attempt to solve the game of 24 with `4 5 6 10`:
34+
```python
35+
import argparse
36+
from tot.methods.bfs import solve
37+
from tot.tasks.game24 import Game24Task
4138

42-
## Experiments
39+
args = argparse.Namespace(backend='gpt-4', temperature=0.7, task='game24', naive_run=False, prompt_sample=None, method_generate='propose', method_evaluate='value', method_select='greedy', n_generate_sample=1, n_evaluate_sample=3, n_select_sample=5)
40+
41+
task = Game24Task()
42+
43+
solve(args, task, 900)
44+
```
45+
46+
47+
## Paper Experiments
4348

4449
Run experiments via ``sh scripts/{game24, text, crosswords}/{standard_sampling, cot_sampling, bfs}.sh``, except in crosswords we use a DFS algorithm for ToT, which can be run via ``scripts/crosswords/search_crosswords-dfs.ipynb``.
4550

@@ -55,13 +60,26 @@ The very simple ``run.py`` implements the ToT + BFS algorithm, as well as the na
5560

5661

5762

58-
## Trajectories
63+
## Paper Trajectories
5964
``logs/`` contains all the trajectories from the paper's experiments, except for ``logs/game24/gpt-4_0.7_propose1_value3_greedy5_start900_end1000.json`` which was reproduced after the paper (as the original experiment was done in a notebook) and achieved a 69\% score instead of the original 74\% score due to randomness in GPT decoding. We hope to aggregate multiple runs in the future to account for sampling randomness and update the paper, but this shouldn't affect the main conclusions of the paper.
6065

66+
## How to Add New Tasks/Methods
67+
TBA.
68+
6169

6270

63-
## Questions
64-
Feel free to contact shunyuyao.cs@gmail.com or open an issue if you have any questions.
6571

6672

73+
## Citations
74+
Please cite the paper and star this repo if you use ToT and find it interesting/useful, thanks! Feel free to contact shunyuyao.cs@gmail.com or open an issue if you have any questions.
6775

76+
```bibtex
77+
@misc{yao2023tree,
78+
title={{Tree of Thoughts}: Deliberate Problem Solving with Large Language Models},
79+
author={Shunyu Yao and Dian Yu and Jeffrey Zhao and Izhak Shafran and Thomas L. Griffiths and Yuan Cao and Karthik Narasimhan},
80+
year={2023},
81+
eprint={2305.10601},
82+
archivePrefix={arXiv},
83+
primaryClass={cs.CL}
84+
}
85+
```

0 commit comments

Comments
 (0)