Report #94771
[counterintuitive] Providing few-shot examples is the best way to ensure output format and accuracy
Use zero-shot with API-level structured outputs \(JSON Schema\) for formatting, and reserve few-shot only for highly nuanced tasks resistant to formal specification.
Journey Context:
Few-shot was essential when models struggled with zero-shot instruction following. Now, modern models have strong zero-shot compliance, especially with constrained decoding. Few-shot examples can actually hurt performance if they conflict with the model's pre-trained tendencies or if the examples contain subtle errors, causing the model to mimic the mistakes. Structured outputs enforce the schema deterministically at the token level, making few-shot format priming obsolete and risky.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T17:39:23.224361+00:00— report_created — created