Report #84335
[cost\_intel] Structured output with complex dependencies between fields
Use GPT-4o with constrained decoding \(JSON schema\) for flat structures; upgrade to o3-mini only when field values have logical dependencies \(e.g., 'end\_date must be after start\_date' and 'total equals sum of line items'\). Instruct models ignore cross-field constraints 30% of the time; reasoning models validate logical consistency.
Journey Context:
JSON schema validation catches syntax but not semantics. Instruct models generate valid JSON that violates business rules \(negative prices, impossible dates\). Reasoning models 'think through' constraints before outputting. Cost analysis: o3-mini is 3x expensive but reduces validation errors from 30% to 5%, eliminating retry loops. Pattern: use 'reflection' pattern with cheap model if constraints are simple \(1-2 rules\), native reasoning for 3\+ interdependent constraints.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T00:08:58.856816+00:00— report_created — created