One-Shot Prompting

A prompt engineering technique where you provide an AI model with a single input–output example alongside your instruction. This example acts as a template, showing the model the exact format, tone, and logic you expect — helping it deliver more accurate results than instructions alone.

Seamless Integration with Plug & Play Solutions

Easily incorporate advanced generative AI into your team, product, and workflows with Promptitude's plug-and-play solutions. Enhance efficiency and innovation effortlessly.

Sign Up Free & Discover Now

What is?

Imagine you're training a new colleague. Instead of just explaining a task verbally, you show them one completed example so they understand exactly what you need. That's essentially how this technique works with AI.

You structure your prompt in three parts:

  • A task instruction: A brief description of what you want done.
  • One example: A single input–output pair demonstrating the desired result.
  • Your actual request: The new input you need the AI to process.

This approach sits between zero-shot prompting (no examples, just instructions) and few-shot prompting (multiple examples). It gives the model enough context to understand patterns without overloading your prompt with lengthy demonstrations.

Why is important?

This technique bridges the gap between giving AI no guidance and overwhelming it with multiple examples. It clarifies ambiguous instructions, improves output consistency, and keeps prompts short. For tasks like enforcing a specific format, defining a writing style, or showing a particular transformation, a single example often eliminates guesswork — saving time while delivering noticeably better results than plain instructions.

How to use

Start by writing a clear, concise instruction that states the transformation or action you need. Then add one well-chosen example that represents a typical case — avoid edge cases or ambiguous scenarios.

Use labels like "Instruction:", "Example Input:", "Example Output:", and "New Input:" to help the AI distinguish between the demonstration and your actual request.

Practical tips:

  • Pick an example that matches the domain and terminology of your real inputs.
  • Keep the example unambiguous so the model infers the right pattern.
  • If results aren't accurate, refine your example or adjust the instruction and test again.

The key is choosing one representative example that makes your expectations obvious.

Examples

Instruction: Classify customer feedback as "Positive," "Neutral," or "Negative."

Example:
Input: "The onboarding process was smooth and the team was incredibly helpful."
Output: Positive

Now classify this:
Input: "I've been waiting three days for a response from support and still nothing."
Output:
AI Response:Negative

By showing the model one classified example, it understands the labeling scheme and tone threshold — then applies the same logic accurately to new feedback without further explanation.

Additional Info

Empower your SaaS with GPT. Today.

Manage, test, and deploy all your prompts & providers in one place. All your devs need to do is copy&paste one API call. Make your app stand out from the crowd - with Promptitude.