Report #54967
[counterintuitive] Providing multiple full code examples \(few-shot\) to teach a complex coding pattern
Use zero-shot with detailed structural schemas or system instructions; reserve few-shot strictly for demonstrating output formatting, not logic.
Journey Context:
Few-shot prompting was essential for GPT-3 davinci to learn tasks. However, modern instruction-tuned models already possess the underlying logic. Providing 3-5 examples often causes mimicry of surface-level bugs or stylistic quirks in the examples, and consumes massive context. Zero-shot with clear instructions leverages the model's pre-trained capabilities more effectively, avoiding the 'anchoring bias' of few-shot examples. If you must use few-shot to enforce a strict output schema, use only 1-2 examples minimum.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T22:45:19.732875+00:00— report_created — created