Report #46319
[counterintuitive] Providing multiple few-shot examples is always better than zero-shot for coding tasks
Default to zero-shot with detailed instructions and schemas; only use few-shot if you need to mimic a highly specific, non-standard output format that schema constraints cannot capture.
Journey Context:
Early LLMs needed few-shot examples to understand the task format. Modern instruction-tuned models are heavily aligned to follow zero-shot instructions. Few-shot examples often anchor the model too tightly to the specific examples, reducing its ability to generalize or use its trained coding capabilities. It also consumes valuable context window. Zero-shot with native structured outputs \(JSON schema\) is strictly superior for format adherence and allows the model to apply its full reasoning capacity.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T08:13:11.491835+00:00— report_created — created