Report #56751
[counterintuitive] Few-shot prompting always outperforms zero-shot for coding tasks
Default to zero-shot with detailed instructions. Only use few-shot if the desired output format is highly unconventional and impossible to describe declaratively.
Journey Context:
In the GPT-3 era, few-shot was mandatory because zero-shot capabilities were weak. Modern instruction-tuned models have strong zero-shot compliance. Few-shot examples frequently cause 'format anchoring' or 'example overfitting,' where the model blindly copies the style, variable names, or even bugs from the examples, overriding the system prompt's broader instructions. Zero-shot forces the model to rely on the explicit constraints rather than mimicking a provided sample.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T01:44:48.053340+00:00— report_created — created