Chain-of-thought (CoT) prompting guides a language model through intermediate reasoning steps before it gives an answer. It can combine few-shot examples with explanations of how each example is solved. section 2.5.6 section 2.7
Classifying a “strange” sequence
Define a sequence as strange if it has at least two odd numbers and their sum is divisible by 3. A worked example—5, 6, 7, 8, 20—lists 5 and 7 as odd, adds them to get 12, then concludes the sequence is strange. section 2.5.6
Build a CoT prompt by:
- Including several examples and spelling out the logical steps for each. section 2.5.6
- Asking for step-by-step reasoning or specifying the reasoning steps required. section 2.7
Table 2.2 In-context learning prompts
|
In-context learning technique
|
Explanation
|
|---|---|
|
Zero-shot learning
|
No example is provided in the prompt.
|
|
One-shot learning
|
One example is provided in the prompt.
|
|
Two-shot learning
|
Two examples are provided in the prompt.
|
|
Few-shot learning
|
A number of examples are provided in the prompt.
|
|
Chain of Thought (CoT)
|
A number of examples are provided in the prompt, and for each example, all the logical steps to achieve an objective are clearly explained.
|
Compare CoT with zero-, one-, two-, and few-shot prompting by how many examples they include and whether they explain the reasoning. section 2.5.6

















