Last updated on October 3, 2024
Technique | Institution | Date of Publication | Paper | Code |
---|---|---|---|---|
Automatic Chain-of-Thought (Auto-CoT) Prompting | Amazon Science | Oct 2022 | Automatic Chain-of-Thought Prompting in Large Language Models | amazon-science/auto-cot |
Automatic Chain-of-Thought (Auto-CoT) is a prompting technique designed to enhance the reasoning capabilities of Large Language Models (LLMs). It does this by automatically generating intermediate reasoning steps, a key element of Chain-of-Thought (CoT) prompting.
CoT involves manually creating task-specific demonstrations, where each demonstration includes a question, intermediate reasoning steps, and the final answer. While CoT generally performs better, it's time-consuming and requires hand-crafted examples for each task. Auto-CoT addresses this by leveraging LLMs to automatically generate reasoning demonstrations.
Don't confuse Auto-CoT with Zero-Shot CoT. While Auto-CoT uses a procedure to generate reasoning chains for CoT prompting, Zero-Shot CoT provides no additional demonstrations and relies solely on the "Let's think step by step" prompt.
Auto-CoT vs. CoT: Unlike CoT, which relies on manually created demonstrations, Auto-CoT uses LLMs to generate them automatically, eliminating the need for human effort in designing task-specific examples.
Auto-CoT vs. Zero-Shot CoT: Zero-Shot CoT simply encourages reasoning but lacks the structure and diversity of curated demonstrations, leading to errors. Auto-CoT addresses this by automatically generating diverse and structured demonstrations, reducing the likelihood of reasoning mistakes.
Auto-CoT generates reasoning chains for CoT demonstrations in two key stages:
These automatically generated demonstrations are used for in-context learning, where the LLM uses the reasoning chains to solve new tasks step by step.
Auto-CoT involves generating CoT demonstrations without manual effort. Hereβs how you can implement it:
Auto-CoT uses Sentence-BERT to embed and cluster questions based on semantic similarity. The goal is to ensure the selected demonstrations cover a diverse range of reasoning patterns.
Once clusters are formed, Auto-CoT selects representative questions from each cluster and uses Zero-Shot CoT to generate reasoning chains for each. These chains are then used as demonstrations for the LLM to solve new tasks.
This process enables the LLM to reason step by step without human-designed demonstrations.
The code for Auto-CoT is open-sourced by Amazon Science and available for further research and implementation at amazon-science/auto-cot.
Auto-CoT was tested on ten public benchmark datasets across arithmetic, commonsense, and symbolic reasoning tasks. The results demonstrate that Auto-CoT matches or exceeds the performance of manually crafted CoT demonstrations.
Task | Zero-Shot CoT | CoT | Auto-CoT |
---|---|---|---|
Arithmetic Reasoning | 78.7% | 91.7% | 92.0% |
Commonsense Reasoning | 64.6% | 73.5% | 74.4% |
Symbolic Reasoning | 57.6% | 59.0% | 59.7% |
Auto-CoT is a powerful and scalable way to generate CoT demonstrations automatically without manual effort. It consistently matches or surpasses Chain-of-Thought, making it a highly effective approach for improving LLM reasoning capabilities across diverse tasks. The code is open-sourced and available for further research and implementation.
Zhang, Z., Zhang, A., Li, M., & Smola, A. (2023). Automatic Chain of Thought Prompting in Large Language Models. In The Eleventh International Conference on Learning Representations . https://openreview.net/forum?id=5NTt8GFjUHkr β©