Report #24353
[counterintuitive] Providing multiple full code examples \(few-shot\) to teach a coding pattern to modern models
Use zero-shot with explicit instructions and a single reference doc/style guide, or use one highly minimal example only for complex output formatting.
Journey Context:
Early models needed few-shot examples to infer the task format. Modern instruction-tuned models follow zero-shot instructions perfectly. Few-shot examples often cause 'example bias,' where the model slavishly copies the example's quirks, imports, or anti-patterns instead of writing optimal code for the specific prompt. Zero-shot with precise constraints is more flexible and less prone to mimicry.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T19:17:15.881623+00:00— report_created — created