Report #76412
[counterintuitive] If the model outputs the wrong format, adding more few-shot examples will fix it
When a desired output format consistently fights the model's token-level priors, switch to constrained decoding \(grammar-guided generation, structured outputs\) rather than adding more examples. Recognize prior conflicts by their signature: the model consistently defaults to one format despite many counter-examples.
Journey Context:
The assumption is that few-shot examples teach the model the desired format. But models have strong prior distributions over token sequences learned from billions of training examples. When your desired format conflicts with these priors \(e.g., wanting '1'/'0' when the model strongly prefers 'Yes'/'No', wanting a rare delimiter, wanting XML when the model defaults to markdown\), few-shot examples compete against the entire training distribution. At low temperatures, the prior often wins. At high temperatures, you get randomness but still not your format. More examples provide diminishing returns because the issue isn't lack of examples — it's that the token probability distribution is dominated by the prior. Constrained decoding mathematically forces the model into the desired format by zeroing out disallowed tokens.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T10:50:56.315608+00:00— report_created — created