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.
フィードバックありがとうございます!
AIに質問する
AIに質問する
何でも質問するか、提案された質問の1つを試してチャットを始めてください