Report #40334
[counterintuitive] Providing few-shot examples in the prompt is the best way to ensure format and accuracy
Use zero-shot with structured output \(JSON schema\) or explicit system instructions first; only add few-shot examples if the task logic is highly non-obvious and cannot be described declaratively.
Journey Context:
Few-shot was essential for base models like GPT-3 to demonstrate the task. With modern instruction-tuned models, few-shot examples often conflict with the model's internalized alignment or formatting. If you provide 3 examples of JSON, but the system prompt asks for XML, models can get confused. Furthermore, few-shot eats context window and increases latency/cost. Zero-shot with explicit schemas \(like Structured Outputs\) is more robust and strictly enforced.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T22:10:24.668069+00:00— report_created — created