What is Chain-of-Thought Prompting?

June 7, 2023 /Technology/ — Chain-of-thought (CoT) prompting is a method for improving the performance of large language models (LLMs) on reasoning tasks. CoT prompts encourage LLMs to explain their reasoning process by providing them with a few examples of how to do so.

CoT prompting was first introduced in the paper “Chain-of-Thought Prompting Elicits Reasoning in Large Language Models” by Wei et al. (2022). In this paper, the authors showed that CoT prompting can significantly improve the performance of LLMs on a range of reasoning tasks, including arithmetic, commonsense, and symbolic reasoning.

The CoT prompting method works by first providing the LLM with a few examples of how to reason about a particular problem. For example, if the LLM is asked to solve the following arithmetic problem:

Code snippet

What is 5 + 7?

the CoT prompt might provide the following examples:

Code snippet

1. We can add 5 and 7 to get 12.
2. We can think of 5 + 7 as 5 + (7 - 7) = 5 + 0 = 12.
3. We can use a calculator to add 5 and 7 to get 12.

Here is another example of how CoT prompting can be used to improve the performance of an LLM on a math word problem:

Code snippet

Prompt: What is the sum of 1, 2, 3, 4, and 5?

CoT: Here is one way to solve this problem:

1. Add 1 and 2 to get 3.
2. Add 3 and 4 to get 7.
3. Add 7 and 5 to get 12.
4. The answer is 12.

Now, try to solve this problem on your own:

What is the sum of 10, 11, 12, 13, and 14?

By providing the LLM with a few examples of how to solve math word problems, CoT prompting can help the LLM to learn how to solve these problems on its own.

Once the LLM has been provided with these examples, it is then asked to solve the problem on its own. The CoT prompt encourages the LLM to use the same reasoning process that was used in the examples.

CoT prompting has been shown to be an effective way to improve the performance of LLMs on reasoning tasks. However, it is important to note that CoT prompting is not a silver bullet. CoT prompting can only improve the performance of LLMs on tasks that are amenable to reasoning. For example, CoT prompting is unlikely to be effective for tasks that require creativity or common sense.

CoT prompting can also be used to improve the performance of LLMs on other types of reasoning tasks, such as commonsense and symbolic reasoning. For example, CoT prompting can be used to help LLMs to learn how to make inferences, to draw conclusions, and to solve problems that require multiple steps of reasoning.

Search related topics

Chain-of-Thought Prompting