AI Structured Outputs Have Two Depth Limits — Only One Is Documented
When using structured JSON schema outputs with AI models like OpenAI's, developers face two distinct depth constraints that behave very differently. The first is a hard, documented limit enforced at request time with a 400 error, covering nesting depth, total object properties, and character lengths — figures that have already been revised since the feature launched in August 2024. The second is an undocumented soft limit where the model silently places correct values in the wrong location, producing responses that still validate but are semantically wrong. This happens because constrained decoding prevents malformed JSON but cannot stop a model from drifting context at deep nesting levels, relocating errors rather than eliminating them. Developers are advised to probe each provider's actual limits programmatically and to treat any published depth figures as upper bounds rather than reliable targets for real-world schemas.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in