Example-Based and Step-by-Step Prompting
Example-based prompting involves showing the AI one or more examples of the desired output. This is called few-shot prompting.
Few-shot prompting: supplying a few examples in the prompt to demonstrate the desired output.
For complex or multi-step tasks, chain-of-thought prompting encourages the AI to reason step by step.
Chain-of-thought prompting: encouraging the AI to reason through a problem step by step in its response.
Example comparison
- Few-shot:
Translate the following sentences to French. Example: "Good morning." β "Bonjour." Now translate: "How are you?"; - Chain-of-thought:
Solve this math problem step by step: If a train travels 60 miles in 1.5 hours, what is its average speed?.
Use few-shot prompting when you want the AI to mimic a specific style or format. Use chain-of-thought prompting for tasks that require logical steps or explanations.
Too many examples can overwhelm the AI or exceed its context window. Choose concise and relevant examples.
Thanks for your feedback!
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Awesome!
Completion rate improved to 11.11
Example-Based and Step-by-Step Prompting
Swipe to show menu
Example-based prompting involves showing the AI one or more examples of the desired output. This is called few-shot prompting.
Few-shot prompting: supplying a few examples in the prompt to demonstrate the desired output.
For complex or multi-step tasks, chain-of-thought prompting encourages the AI to reason step by step.
Chain-of-thought prompting: encouraging the AI to reason through a problem step by step in its response.
Example comparison
- Few-shot:
Translate the following sentences to French. Example: "Good morning." β "Bonjour." Now translate: "How are you?"; - Chain-of-thought:
Solve this math problem step by step: If a train travels 60 miles in 1.5 hours, what is its average speed?.
Use few-shot prompting when you want the AI to mimic a specific style or format. Use chain-of-thought prompting for tasks that require logical steps or explanations.
Too many examples can overwhelm the AI or exceed its context window. Choose concise and relevant examples.
Thanks for your feedback!