Automatic Chain of Thought Prompting in Large Language Models

Zhuosheng Zhang, Aston Zhang, Mu Li, Alex Smola
10/7/2022
cs.CLcs.AI

Official code: amazon-science/auto-cot (2,051 stars, Apache-2.0, last commit 2024-03-13).

Abstract

Large language models (LLMs) can perform complex reasoning by generating intermediate reasoning steps. Providing these steps for prompting demonstrations is called chain-of-thought (CoT) prompting. CoT prompting has two major paradigms. One leverages a simple prompt like "Let's think step by step" to facilitate step-by-step thinking before answering a question. The other uses a few manual demonstrations one by one, each composed of a question and a reasoning chain that leads to an answer. The superior performance of the second paradigm hinges on the hand-crafting of task-specific demonstrations one by one. We show that such manual efforts may be eliminated by leveraging LLMs with the "Let's think step by step" prompt to generate reasoning chains for demonstrations one by one, i.e., let's think not just step by step, but also one by one. However, these generated chains often come with mistakes. To mitigate the effect of such mistakes, we find that diversity matters for automatically constructing demonstrations. We propose an automatic CoT prompting method: Auto-CoT. It samples questions with diversity and generates reasoning chains to construct demonstrations. On ten public benchmark reasoning tasks with GPT-3, Auto-CoT consistently matches or exceeds the performance of the CoT paradigm that requires manual designs of demonstrations. Code is available at https://github.com/amazon-research/auto-cot

View on arXivView PDF

Code Implementations(1)

Apache-2.0

Official implementation for "Automatic Chain of Thought Prompting in Large Language Models" (stay tuned & more will be updated)

2,051193Python, Jupyter NotebookOct 5, 20222 years agoApache-2.0
chain-of-thoughtgpt-3gpt3-promptsgpt3-resourceslarge-language-models+2 more

Similar Papers

Cite this paper

@article{zhang2022automatic,
  title  = {Automatic Chain of Thought Prompting in Large Language Models},
  author = {Zhuosheng Zhang and Aston Zhang and Mu Li and Alex Smola},
  year   = {2022},
  eprint = {2210.03493},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2210.03493}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2210.03493.svg)](https://codeofpaper.com/paper/2210.03493)

Discussion