Does Field Ordering in LLM Structured Outputs Matter?

2025-05-23
Does Field Ordering in LLM Structured Outputs Matter?

This post investigates the impact of field ordering in Pydantic models used for structured AI outputs. The author uses a painting style classification task, comparing two field orderings (answer-first and reasoning-first) on various LLMs (GPT-4.1, GPT-4.1-mini, GPT-4o, GPT-4o-mini) across easy and hard tasks. Results show subtle but inconsistent performance differences across models and task complexities, suggesting the need for attention to subtle patterns in LLM outputs to optimize performance.

Read more