经过深思熟虑的(tot)提示,这是一种新的技术,借鉴了思想树框架,扩大并增强了良好的思想链促进的促进概念,从而使大型语言模型(如chatgpt)能够表现出卓越的推理能力。这种思想树的促进技术允许大型语言模型自主纠正其错误,同时逐步积累知识。
在一个示例中,TOT提示提高了Chatgpt 3.5的推理能力,可以回答以前只能通过ChatGpt 4回答的问题。
大型语言模型(LLM)通常很难回答某些类型的复杂问题。这是一个代表性的例子:
Bob is in the living room.
He walks to the kitchen, carrying a cup.
He puts a ball in the cup and carries the cup to the bedroom.
He turns the cup upside down, then walks to the garden.
He puts the cup down in the garden, then walks to the garage.
Where is the ball?
正确的答案是球在卧室里。尽管LLM是非确定性的,但我在几次尝试中收到的反应如下:
存在一个公认的概念,称为“经过思考的促进链”(简称COT),它鼓励大型语言模型(LLMS)阐明其思维过程,从而增加了正确响应的可能性。该概念的根源可以追溯到2022年1月起的一篇论文,标题为“经过思想链”,这促使大语模型引起了推理。
从本质上讲,可以通过在提示中添加类似于以下内容来实现COT技术:
Think carefully and logically, explaining your answer.
尽管其有效性有所不同,但这种方法在回答许多问题时提高了LLM的表现。
这是Chatgpt 3.5响应的一个示例:
Based on the given sequence of events, we can logically determine the location of the ball. Let's analyze each step:
1. Bob is in the living room.
- No mention of the ball in the living room.
2. Bob walks to the kitchen, carrying a cup.
- No mention of the ball in the kitchen yet.
3. Bob puts a ball in the cup.
- The ball is now inside the cup.
4. Bob carries the cup to the bedroom.
- The ball is still inside the cup.
5. Bob turns the cup upside down.
- If the ball was inside the cup, it would have fallen out when Bob turned it upside down.
6. Bob walks to the garden.
- Bob left the cup in the garden, but there is no mention of the ball being removed from the cup.
7. Bob puts the cup down in the garden.
- The ball, if it was in the cup, would still be in the cup in the garden.
8. Bob walks to the garage.
- No mention of the ball being taken to the garage.
Based on the given information, we can conclude that the ball is still inside the cup in the garden.
您可以看到Chatgpt如何意识到球在第5步中脱落,但仍然没有正确的答案。
我们可以做得更好,而无需求助于chatgpt 4吗?
最近的几周已经看到了几篇论文和Python存储库引入了思想树(TOT)的概念:
基本原则是为LLM提供一个机会,可以在随着时间的推移而自我评估的同时探索多个推理分支。根据引用论文,这种方法似乎在某些问题上非常有效。
讨论思想树框架的现有论文似乎是以通过Python进行多个呼叫来拨打LLM的。经过思考的推理的主要优点之一是,在一个句子提示中,Chatgpt可以实现它。
这导致我思考:我们能否通过使用tot式提示来改善COT的结果?
这是我使用的提示:
Imagine three different experts are answering this question.
All experts will write down 1 step of their thinking,
then share it with the group.
Then all experts will go on to the next step, etc.
If any expert realises they're wrong at any point then they leave.
The question is...
这是chatgtp 3.5的回应:
Expert 1: The ball is in the living room.
Expert 2: The ball is in the kitchen.
Expert 3: The ball is in the bedroom.
Expert 1: Bob carries the cup to the bedroom, so the ball must be in the cup.
Expert 2: Oh, I see my mistake. Yes, the ball is in the cup.
Expert 3: Agreed, the ball is in the cup in the bedroom.
Expert 1: Next, Bob turns the cup upside down in the bedroom.
Expert 2: After that, Bob walks to the garden and puts the cup down.
Expert 3: Therefore, the ball must have fallen out of the cup when Bob turned it upside down in the bedroom. So, the ball is in the bedroom, not in the cup anymore.
Expert 1: Oh, you're right. I made a mistake. The ball is in the bedroom, not in the cup.
Expert 2: Agreed, the ball is in the bedroom.
Expert 3: Bob then walks to the garage, so the ball remains in the bedroom. It is not in the garden or the garage.
Expert 1: Absolutely, the ball is still in the bedroom.
Expert 2: Yes, the ball hasn't moved from the bedroom.
Expert 3: Therefore, the ball is in the bedroom, not in the garden or the garage.
All three experts agree that the ball is in the bedroom.
您可以看到这段时间Chatgpt 3.5如何正确答案!
有空间可以完善提高性能的提示,并有可能导致更简洁的响应。
如果您在其他任何提示中都能找到成功,我们欢迎您提交PR并将其添加到tree-of-thought-prompts.txt 。
经过深思熟虑的框架与涉及多个利益相关者的组织决策过程相似。该结构试图模仿共识和思想多样性。
可以通过使用微调来处理任务不同部分的多个代理来扩展效果。 AutoGPT是一个很好的例子,它可以自我评估LLM计划违反目标。使用不同调整的LLM进行专业化,甚至完全不同的LLM将允许更多的思想多样性。这些LLM可以以不同的模式相互作用(使用团队拓扑术语):
高性能的团队在决策方面的表现通常超过个人。因此,采用其他组织结构和特征可以提高LLM的性能是合理的。除了多样化的思想,专业化和共和力之外,我们还可以效仿:
如果您使用代码,请引用此存储库。
@misc{tree-of-thought-prompting,
title = {Using Tree-of-Thought Prompting to boost ChatGPT's reasoning},
author = {Dave Hulbert},
year = 2023,
month = may,
journal = {GitHub repository},
publisher = {Zenodo},
doi = {10.5281/ZENODO.10323452},
url = {https://doi.org/10.5281/zenodo.10323452},
howpublished = {url{https://github.com/dave1010/tree-of-thought-prompting}}
}