Few-Shot Prompting: How to Teach AI by Example
One of the most underused prompting techniques is few-shot prompting – giving the AI 2-3 examples of what you want before asking it to generate new outputs. It’s incredibly powerful for maintaining consistency.
I use this for:
– Generating product descriptions that match our brand voice
– Converting raw data into specific report formats
– Writing test cases that follow our team’s conventions
– Creating marketing copy in a specific style
The format I use:
“Here are examples of how we write customer emails:
Example 1: [input] โ [output]
Example 2: [input] โ [output]
Now write one for: [new input]”
Key tips: Use 2-3 examples (more doesn’t help much). Make your examples diverse enough to show the pattern, not just one type. Include an example of what NOT to do if relevant.
This technique alone took my AI outputs from “okay, I’ll need to edit this heavily” to “this is 90% ready to use.” Anyone have other few-shot strategies that work well?
Im a technical writer and honestly promt engineering is just... good communication? Like the skills transfer directly
tried the role prompting technique on a legal research task and it was night and day difference. telling it to be a legal analyst vs just asking the question raw
interesting, hadnt thought of it that way
the few-shot examples technique is probably the single most underrated prompting skill. once you show the AI 2-3 examples of what you want it just gets it
Whats everyones go-to temperature setting? I keep mine at 0.7 for creative stuff and 0.2 for factual/coding tasks
the structured output tip changed my workflow completely. asking for JSON or markdown tables instead of prose makes the output so much more usable