Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
学ぶ Example-Based and Step-by-Step Prompting | Techniques and Strategies
Prompt Engineering Basics

bookExample-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.

Note
Definition

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.

Note
Definition

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.

Note
Note

Too many examples can overwhelm the AI or exceed its context window. Choose concise and relevant examples.

question mark

When should you use chain-of-thought prompting?

正しい答えを選んでください

すべて明確でしたか?

どのように改善できますか?

フィードバックありがとうございます!

セクション 2.  2

AIに質問する

expand

AIに質問する

ChatGPT

何でも質問するか、提案された質問の1つを試してチャットを始めてください

セクション 2.  2
some-alt