One-Shot Examples
One-shot prompting provides a single example to demonstrate the expected format, style, or approach. It's often enough to dramatically improve output quality.
The Power of One Example
One example shows:
- Lowercase conversion
- Space to hyphen replacement
- Special character handling
When One-Shot Shines
One example is often sufficient for:
- Format demonstrations
- Simple transformations
- Style matching
- Pattern continuation
One-Shot Structure
Exercise: Create a One-Shot Prompt
Choosing the Right Example
Representative
Pick an example that covers common cases:
Weak example: "A" → "a" (too simple) Strong example: "iPhone 15 Pro Max" → "iphone-15-pro-max" (shows multiple transformations)
Clear Pattern
The relationship between input and output should be obvious:
Confusing: Complex example with hidden rules Clear: Example that explicitly demonstrates each rule
Similar to Actual Task
The example should resemble what you'll actually ask:
Mismatched: Short example, long actual input Matched: Similar length and complexity
Exercise: Pick the Better Example
One-Shot for Style Matching
One example is powerful for capturing voice and style:
The example establishes:
- Humorous tone
- Casual language
- Metaphor use
- Short, punchy sentences
One-Shot Limitations
One example might not be enough when:
- The task has multiple variations
- Edge cases need handling
- The pattern is complex
- Consistency across formats matters
In these cases, move to few-shot (multiple examples).
Practice: One-Shot Applications
One well-chosen example often outperforms paragraphs of instructions.

