Report #63878
[counterintuitive] Using few-shot examples to enforce strict JSON output schemas
Use native API structured output parameters \(JSON mode/Structured Outputs\) instead of few-shot examples for format adherence.
Journey Context:
In 2023, developers provided 2-3 JSON examples to coax models into valid output. This consumed context tokens and was fragile—if examples had trailing commas, the model would hallucinate them too. Modern APIs expose structured output engines \(like constrained decoding\) that guarantee 100% schema adherence at the token level. Few-shot is now only useful for demonstrating behavioral nuance \(e.g., tone, style\), never for formatting. Mixing few-shot with structured outputs often confuses the model's constraint resolution.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T13:42:31.724060+00:00— report_created — created