# Plan-and-Solve Prompting Improves Zero-Shot Chain-of-Thought Reasoning
- Lei Wang, Wanyu Xu, Yihuai Lan, Zhiqiang Hu, Yunshi Lan, Roy Ka-Wei Lee, Ee-Peng Lim
- Singapore Management University
- ACL 2023
# Introduction
In (Kojima et al., 2022), *zero-shot* **chain-of-thought (CoT)** eliminates the need for manually crafted examples in prompts by appending “Let’s think step by step” to the target problem fed to LLMs such as GPT-3.
- To tackle multi-step reasoning tasks, *few-shot* chain-of-thought (CoT) prompting includes a few manually crafted step-by-step reasoning demonstrations that enable LLMs to explicitly generate reasoning steps and improve their reasoning task accuracy.
- To eliminate the manual effort, zero-shot CoT concatenates the target problem statement with “Let’s think step by step” as an input prompt to LLMs.
- This simple prompting strategy surprisingly enables LLMs to yield performance similar to few-shot CoT prompting.
Despite the success of zero-shot CoT, it still suffers from three pitfalls: calculation errors, missing-step errors, and semantic misunderstanding errors.
- To address the *missing-step errors*, we propose **Plan-and-Solve (PS) Prompting**.
- To address the *calculation errors* and improve the quality of generated reasoning steps, we extend PS prompting with more detailed instructions and derive **PS+ Prompting**.
- This work does not explore how to address *semantic misunderstanding errors* by prompting instead of upgrading LLMs.
As opposed to prior few-shot CoT approaches where step-by-step few-shot demonstration examples are included in the prompt, the zero-shot PS prompting method does not require demonstration examples, and its prompt covers the problem itself and a simple trigger sentence
- The code can be found at https://github.com/AGIEdgerunners/Plan-and-Solve-Prompting
## Plan-and-Solve (PS) Prompting
**PS Prompting** consists of two components: first, devising a plan to divide the entire task into smaller subtasks, and then carrying out the subtasks according to the plan. In our experiments, we simply replace “Let’s think step by step” of Zeroshot-CoT with “Let’s first understand the problem and devise a plan to solve the problem. Then, let’s carry out the plan and solve the problem step by step”
1. In step 1, the prompt first makes an inference using the proposed prompting template to generate the reasoning process and the answer to a problem. Example inputs and outputs of GPT-3 with (a) Zero-shot-CoT prompting, (b) Plan-and-Solve (PS) prompting:

1. In step 2, it extracts the answer for evaluation by using the answer extraction prompting, such as “Therefore, the answer (arabic numerals) is”.

## PS+ Prompting
We extend PS Prompting with “extract relevant variables and their corresponding numerals” and “calculate intermediate results (pay attention to calculation and commonsense)” instructions.
This prompting variant is called the **PS+ Prompting** strategy

Ablation study:

## Evaluation
Evaluation on ten datasets across three types of reasoning problems shows PS+ Prompting outperforms the previous zero-shot baselines and performs on par with few-shot CoT prompting on multiple arithmetic reasoning datasets.

Although PS+ Prompting does not require manual demonstration examples, it has a performance similar to an 8-shot CoT prompting in arithmetic reasoning.

Self-consistency:

## Discussion
PS(+) prompting is a general idea that can be used for non-reasoning tasks, and refining the plan is also an interesting idea.
It takes effort to design prompts that guide LLMs to generate correct reasoning steps. The GPT-3 models are sensitive to the expressions in prompts. You need to be principled when designing prompts.
# Mindmap
