LLM decision guide
Prompting vs Structured Outputs
Prompting communicates intent in language; structured outputs add a machine-checkable response contract.
Choose Prompting when
- The output is read directly by a person
- Exploration matters more than parsing
Choose Structured outputs when
- Software consumes the result
- Invalid fields must fail closed
Decision table
| Dimension | Prompting | Structured outputs |
|---|---|---|
| Constraint | Instruction | Schema |
| Validation | Semantic review | Parser and semantic checks |
| Failure | Ambiguous prose | Invalid or unsupported fields |
Example
A realistic choice
Ask for an explanation in prose, but require a validated JSON object for a ticket-routing decision.
Hands-on
Test the decision
Write a closed schema and three invalid cases for a classification response.