> ## Documentation Index
> Fetch the complete documentation index at: https://www.adaline.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Multi-shot prompting

> Teach the model how to respond by providing example input/output pairs in your prompt

Multi-shot prompting (also called few-shot prompting) teaches the model how to respond by providing examples directly in the prompt. Instead of relying on instructions alone, you show the model concrete input/output pairs — and it learns to follow the same pattern for new inputs.

This technique uses the [role-based message structure](/docs/iterate/use-roles-in-prompt) to alternate between **User** messages (example inputs) and **Assistant** messages (expected outputs), preceded by a **System** message that sets the overall behavior.

## When to use multi-shot prompting

| Scenario                     | Why it helps                                                                     |
| ---------------------------- | -------------------------------------------------------------------------------- |
| **Consistent output format** | Examples demonstrate the exact structure, length, and style you expect.          |
| **Domain-specific tasks**    | Examples ground the model in your specific terminology or classification scheme. |
| **Complex reasoning**        | Step-by-step examples guide the model through multi-part logic.                  |
| **Reducing ambiguity**       | Showing rather than telling eliminates guesswork about your intent.              |

<Tip>
  Start with a zero-shot prompt (no examples). If the model's output format or quality is inconsistent, add one or two examples. More examples generally improve consistency, but each one adds to the token count.
</Tip>

## Walkthrough: multi-shot image description

Here is a step-by-step walkthrough of building a multi-shot prompt that describes images in a consistent format:

<Steps>
  <Step title="Add a System message">
    Write the instructions that set the model's behavior and context.

    <img src="https://mintcdn.com/adaline/-Bsa4BuK4fSdmy67/images/iterate/multi-prompt-image-system.png?fit=max&auto=format&n=-Bsa4BuK4fSdmy67&q=85&s=803658c4beb0e571bb6c034f4edb442c" alt="System message in a multi-shot prompt" title="System message in a multi-shot prompt" style={{ width: "100%" }} width="1540" height="274" data-path="images/iterate/multi-prompt-image-system.png" />
  </Step>

  <Step title="Add a User message with an example input">
    Add a User message containing an example image (or text) that the model should process.

    <img src="https://mintcdn.com/adaline/-Bsa4BuK4fSdmy67/images/iterate/multi-prompt-image-user-dog.png?fit=max&auto=format&n=-Bsa4BuK4fSdmy67&q=85&s=8ff6b21afb5552b1a46af2b444f504fd" alt="User message with example image" title="User message with example image" style={{ width: "100%" }} width="2100" height="1018" data-path="images/iterate/multi-prompt-image-user-dog.png" />
  </Step>

  <Step title="Add an Assistant message with the expected output">
    Add an Assistant message demonstrating exactly how you want the model to respond.

    <img src="https://mintcdn.com/adaline/-Bsa4BuK4fSdmy67/images/iterate/multi-prompt-image-assistant-dog.png?fit=max&auto=format&n=-Bsa4BuK4fSdmy67&q=85&s=fb4f0f48c666068d9abdc2f138f7c879" alt="Assistant message with expected output" title="Assistant message with expected output" style={{ width: "100%" }} width="2118" height="284" data-path="images/iterate/multi-prompt-image-assistant-dog.png" />
  </Step>

  <Step title="Add more example pairs">
    Repeat the User/Assistant pattern to provide additional examples. More examples generally improve consistency.

    <img src="https://mintcdn.com/adaline/-Bsa4BuK4fSdmy67/images/iterate/multi-prompt-image-user-person.png?fit=max&auto=format&n=-Bsa4BuK4fSdmy67&q=85&s=9acef79308b2de3842d0b6b44cbdfc6f" alt="Additional example input" title="Additional example input" style={{ width: "100%" }} width="2032" height="1248" data-path="images/iterate/multi-prompt-image-user-person.png" />

    <img src="https://mintcdn.com/adaline/-Bsa4BuK4fSdmy67/images/iterate/multi-prompt-image-assistant-person.png?fit=max&auto=format&n=-Bsa4BuK4fSdmy67&q=85&s=758fadf09be39b1e4f92b2e124767f1c" alt="Additional example output" title="Additional example output" style={{ width: "100%" }} width="1788" height="292" data-path="images/iterate/multi-prompt-image-assistant-person.png" />
  </Step>

  <Step title="Add the actual input">
    Add the final User message with the real input the model should process.

    <img src="https://mintcdn.com/adaline/-Bsa4BuK4fSdmy67/images/iterate/multi-prompt-image-user-boat.png?fit=max&auto=format&n=-Bsa4BuK4fSdmy67&q=85&s=d13203a147a6655894618b6c304b7bea" alt="Actual input for the model" title="Actual input for the model" style={{ width: "100%" }} width="2094" height="1092" data-path="images/iterate/multi-prompt-image-user-boat.png" />
  </Step>

  <Step title="Run and verify">
    Run the prompt in the [Playground](/docs/iterate/run-prompts-in-playground) and verify the response follows the pattern you demonstrated.

    <img src="https://mintcdn.com/adaline/-Bsa4BuK4fSdmy67/images/iterate/multi-prompt-response.png?fit=max&auto=format&n=-Bsa4BuK4fSdmy67&q=85&s=bdc740b2d308b24e88043b4cdc8f1104" alt="Model response following multi-shot examples" title="Model response following multi-shot examples" style={{ width: "100%" }} width="2796" height="1638" data-path="images/iterate/multi-prompt-response.png" />
  </Step>
</Steps>

## Best practices

* **Keep examples consistent** — Use the same structure, tone, and level of detail across all example pairs. The model mirrors the patterns it sees.
* **Use realistic examples** — Choose examples that closely resemble your actual use case. Synthetic or overly simple examples may not transfer well.
* **Order matters** — Place your strongest, most representative examples first. The model tends to weight earlier examples more heavily.
* **Balance quantity and cost** — Each example adds tokens. Two to three high-quality examples are often enough; add more only if output quality is inconsistent.
* **Combine with variables** — Use [text variables](/docs/iterate/use-text-in-prompt#use-variables-in-text) or [image variables](/docs/iterate/use-images-in-prompt#use-image-variables) in your final input message to make the prompt reusable across different inputs.

## Next steps

<CardGroup cols={2}>
  <Card title="Use Roles in Prompts" icon="users" href="/docs/iterate/use-roles-in-prompt">
    Learn about the role-based message structure that multi-shot prompts build on.
  </Card>

  <Card title="Run Prompts in Playground" icon="play" href="/docs/iterate/run-prompts-in-playground">
    Test your multi-shot prompts interactively with real inputs.
  </Card>
</CardGroup>
