diff --git a/guides/prompts-advanced-usage.md b/guides/prompts-advanced-usage.md index e65165f..d9420db 100644 --- a/guides/prompts-advanced-usage.md +++ b/guides/prompts-advanced-usage.md @@ -52,9 +52,11 @@ That didn't work. It seems like basic standard prompting is not enough to get re More recently, chain-of-thought (CoT) prompting has been popularized to address more complex arithmetic, commonsense, and symbolic reasoning tasks. So let's talk about CoT next and see if we can solve the above task. -## Chain-of-thought Prompting +--- -Introduced in [Wei et al. (2022)](https://arxiv.org/abs/2201.11903), chain-of-thought prompting uses few chain of thought demonstrations are provided as exemplars in prompting to improve the ability of large language models to perform complex reasoning. +## Chain-of-Thought Prompting + +Introduced in [Wei et al. (2022)](https://arxiv.org/abs/2201.11903), chain-of-thought (CoT) prompting uses few chain of thought demonstrations are provided as exemplars in prompting to improve the ability of large language models to perform complex reasoning. ``` The odd numbers in this group add up to an even number: 4, 8, 9, 15, 12, 2, 1. @@ -93,4 +95,37 @@ Output Adding all the odd numbers (15, 5, 13, 7, 1) gives 41. The answer is False. ``` -... \ No newline at end of file +Keep in mind that the authors claim that this is an emergent ability that arises with sufficiently large language models. + +--- + +## Zero-Shot CoT + +One recent idea that came out more recently is the idea of CoT that essentially involves adding "Let's think step by step" to the the original prompt. Let's try a simple problem and see how the model performs: + +``` +I went to the market and bought 10 apples. I gave 2 apples to the neighbor and 2 to the repairman. I then went and bought 5 more apples and ate 1. How many apples did I remain with? +``` + +Output +``` +11 apples +``` + +The answer is incorrect Now Let's try with the special prompt. + +``` +I went to the market and bought 10 apples. I gave 2 apples to the neighbor and 2 to the repairman. I then went and bought 5 more apples and ate 1. How many apples did I remain with? + +Let's think step by step. +``` + +Output +``` +First, you started with 10 apples. +You gave away 2 apples to the neighbor and 2 to the repairman, so you had 6 apples left. +Then you bought 5 more apples, so now you had 11 apples. +Finally, you ate 1 apple, so you would remain with 10 apples. +``` + +It's actually impressive that this simple prompt is effective at this task. This is particularly useful where you don't too many examples to use in the prompt. \ No newline at end of file