A loan pre-screening step uses the schema below with constrained decoding, which emits properties in schema order. Reviewers find that reasoning usually argues for whatever decision was produced, even clearly wrong ones, and accuracy is lower than with the team's earlier free-text chain-of-thought prompt. What is the most likely cause and fix?
{
"type": "object",
"properties": {
"decision": { "type": "string", "enum": ["approve", "refer", "decline"] },
"reasoning": { "type": "string" }
},
"required": ["decision", "reasoning"],
"additionalProperties": false
}Show the answer and explanation
Correct answer: D, Generation runs left to right, so decision is fixed before any reasoning exists and the rationale comes after the fact; put reasoning first in the schema.
Explanation Structured Outputs
An LLM writes its output one token at a time, left to right, and each token can depend only on the prompt and the tokens already written. With decision first, the model commits to approve, refer or decline with no reasoning tokens to condition on. The reasoning that follows is a post-hoc rationalisation: it is conditioned on the decision, so it tends to defend it, right or wrong. It adds no accuracy and cannot be trusted as an explanation.
Fixes:
- Reorder the schema so
reasoning(orevidence,analysis) comes first anddecisionlast. The decision is then generated after, and conditioned on, the reasoning, just like chain-of-thought in free text. Most structured-output engines emit keys in schema order, but some APIs need an explicit property-ordering setting, so verify the output order. - If a strict format still hurts reasoning quality, use two steps: let the model reason in free text, then convert the conclusion into the schema with a second, cheap call or a parser.
- With reasoning models, the hidden thinking happens before the visible output, so a separate reasoning field matters less.
Why the other options fail: JSON key order may not matter to a parser, but it is the order of computation for the model, which does not write a hidden draft of the whole object first; a description asking it to think carefully adds no reasoning tokens before decision. Enums make routing reliable and do not block reasoning. A longer reasoning field is still post-hoc.
Interview tip: say that "field order in a schema is a prompt-engineering decision": evidence and reasoning first, extracted values or verdicts last.