Suppose you want a language model to translate a sentence. Instead of giving only an instruction, you put a few translations in the prompt before the new sentence. This is few-shot learning: examples in the input show the model the task and the output format to follow. section 2.14 section 7.3
A translation prompt
“Hello” → “Hola”; “Goodbye” → “Adiós”; now translate “How are you?” The first two pairs demonstrate the pattern; the last sentence is the request. section 7.3
The number of examples distinguishes related approaches. Zero-shot prompting gives an instruction without examples; one-shot gives one example; few-shot gives a small set. These examples are part of the prompt, not a fine-tuning step. They can help with tasks such as classification, summarization, and code generation, but the response still needs checking. Clear instructions, relevant examples, and revision based on results remain important. section 2.14 section 7.3
Examples can also show an AI agent when and how to call a tool. Some agents place sample instructions and tool invocations in a system prompt without additional model training. For complex multistep tasks, prompting alone may not be the best approach. section 8.11 section 7.13
Table 7.2 Foundational prompting techniques
| Technique |
Description |
Example use case |
Example prompt |
| Zero-shot |
Provide an instruction without examples |
Language translation, Q&A |
Translate the following sentence into Spanish: “Good morning, how are you?” |
| Few-shot |
Include a small set of examples in the prompt |
Summarization, classification, language translation, code generation |
Translate: “Hello” → “Hola”; “Goodbye” → “Adiós”; Now translate: “How are you?” |
| Multi-turn |
Carry information forward across multiple exchanges |
Customer support, tutoring agents |
User: My internet isn’t working. Model: What device are you using? User: MacBook Pro. Model: Let’s run a few tests. |
Compare the example translation prompt with zero-shot instructions and multi-turn conversation in the table of foundational prompting techniques. section 7.3

















