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.
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:
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.
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.
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:
The key is choosing one representative example that makes your expectations obvious.
Instruction: Classify customer feedback as "Positive," "Neutral," or "Negative."AI Response:
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: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.
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.