Skip to main content
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 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

ScenarioWhy it helps
Consistent output formatExamples demonstrate the exact structure, length, and style you expect.
Domain-specific tasksExamples ground the model in your specific terminology or classification scheme.
Complex reasoningStep-by-step examples guide the model through multi-part logic.
Reducing ambiguityShowing rather than telling eliminates guesswork about your intent.
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.

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:
1

Add a System message

Write the instructions that set the model’s behavior and context.System message in a multi-shot prompt
2

Add a User message with an example input

Add a User message containing an example image (or text) that the model should process.User message with example image
3

Add an Assistant message with the expected output

Add an Assistant message demonstrating exactly how you want the model to respond.Assistant message with expected output
4

Add more example pairs

Repeat the User/Assistant pattern to provide additional examples. More examples generally improve consistency.Additional example inputAdditional example output
5

Add the actual input

Add the final User message with the real input the model should process.Actual input for the model
6

Run and verify

Run the prompt in the Playground and verify the response follows the pattern you demonstrated.Model response following multi-shot examples

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 or image variables in your final input message to make the prompt reusable across different inputs.

Next steps

Use Roles in Prompts

Learn about the role-based message structure that multi-shot prompts build on.

Run Prompts in Playground

Test your multi-shot prompts interactively with real inputs.