What is One-shot Prompting?


One-shot prompting means including one completed example of the task you want an AI model to perform. The example shows an input and the kind of output you expect.

Use it when a sample can explain your preferred structure or style more clearly than instructions alone. The aim is to show a useful pattern, then give the model a new input to process.



How does one-shot prompting work?


You first state the task and any rules. Next, include one demonstration with an input and a completed answer. Finally, provide the new input. Keep the demonstration separate from the task so the model can distinguish the example from the item it should answer.

The example is context for that request. It is not a permanent update to the model. If you want to reuse the approach, save the prompt and its example as a template in your team’s approved workspace.



A practical one-shot prompt


Suppose a service team needs consistent summaries of customer messages. The example below defines a compact style without requiring a long explanation.

Summarise each customer message as “Issue: … | Next step: …”. Use only the message. If no next step is stated, write “Needs review”.

Example input: I was charged twice for one order. Please check the payment.
Example output: Issue: Duplicate charge | Next step: Check the payment

New input: My tracking link does not work. Please send me an updated link.
Output:

Illustrative output: Issue: Broken tracking link | Next step: Send an updated link

There is one completed input and output pair in the prompt. The new input is the task to answer. The example data is fictional and does not authorise an automatic customer response.



When is one example useful?


  • When your team uses a particular label or output structure.
  • When a short example shows the tone better than adjectives such as friendly or professional.
  • When you want similar product descriptions or internal summaries.
  • When a zero-shot version is understandable but keeps missing one important pattern.

Choose a normal example that represents your task. An unusual edge case can distract from the basic pattern. If the task includes several different categories or important exceptions, a few-shot approach may be a better experiment.



How to choose a strong example


  1. Use an example with a correct answer that you have reviewed.
  2. Make the relationship between input and output easy to see.
  3. Keep the content relevant to the real task and audience.
  4. Remove incidental details that should not become part of every answer.
  5. Check that the example follows every written rule in the prompt.

If your instruction asks for 50 words but your example has 200, the model receives conflicting signals. Fix the inconsistency before adding more instructions. For factual work, make sure the example shows how to handle a missing answer rather than filling the gap with a guess.



One-shot vs zero-shot and few-shot prompting


Zero-shot prompting uses no completed example. One-shot uses one. Few-shot prompting uses several. These labels describe the demonstrations included in the request, rather than how many times you have used the model.

Compare the approaches on the same sample inputs. For each output, ask whether it follows the format, preserves the facts and handles uncertainty correctly. Keep the simplest version that meets your needs.



Limitations and common mistakes


One example cannot show every possible situation. A model may copy wording or details that were intended only for that demonstration. If it repeats an example customer name or product feature, make the boundary clearer and test again.

An example also does not guarantee correct facts or stable formatting. For repeated processing, plan how a person or your workflow will check the result and handle an answer that does not follow the expected structure.



Frequently asked questions


Does an empty template count as one-shot prompting?


An empty template describes the format. A one-shot demonstration normally includes a completed response, so the model can see how the task should be performed.


Can I use a previous successful response?


Yes, after reviewing it. Remove sensitive details, confirm that it follows your current rules and check that the example still represents the work you want to do.