HoldsHolds on claude-haiku-4-5Holds on gpt-5-miniHolds on gemini-3.1-flash-lite
Getting clean JSON back
Structured outputs: the JSON schema raised valid JSON rates
Show the model the exact shape you want back. Write out the field names instead of just asking for JSON.
Why it matters
Without a shape to copy, the model picks its own field names and your code breaks.
How to use it
Put a small example of the structure in your prompt. List every field you need and what kind of value it holds.
Pass rate rose from 0% to 100% on all three models.
What the marks mean
- Holds
Show the per-model numbers
Claim tested: An explicit JSON schema in the prompt yields a higher valid-JSON rate than an unstructured instruction to respond in JSON.
Holds on claude-haiku-4-5, gpt-5-mini and gemini-3.1-flash-lite.
Circulates in practitioner communities. Tested because it circulates, not because it is endorsed.
This tip is OpenAddict's plain-language read of the measured result. The measurement below is the evidence, and it is what the reading has to answer to.
Ledger idC01-json-schema
What was tested
This claim circulates in practitioner communities as advice about how to write prompts. That it circulates is an input to what gets tested here. It is a reason to test the claim, and it is not evidence for or against it. The result below is the evidence, and it is the only thing on this page that carries weight.
The comparison is paired. Two prompts differ in one respect, the manipulated variable, and are otherwise identical by construction. Nothing here supports a causal reading beyond that pairing.
Result
| Measure | claude-haiku-4-5 | gpt-5-mini | gemini-3.1-flash-lite |
|---|---|---|---|
| Control arm | 0.000n 50 | 0.000n 50 | 0.000n 50 |
| Treatment arm | 1.000n 50 | 1.000n 50 | 1.000n 50 |
| Delta | +1.000 | +1.000 | +1.000 |
| Interval, 95 percent | 1.000 to 1.000 | 1.000 to 1.000 | 1.000 to 1.000 |
| Orbit | Stable100 of 100 records | Stable100 of 100 records | Stable100 of 100 records |
Orbit is assigned by the frozen status_v1 rule. On this scale, deterministic pass rate, 0 to 1, the pass threshold is +0.20 and the failure floor is -0.20, each requiring an interval that excludes zero.
Method for this claim
- Task set
- 10 short biographical snippets, varied in sentence order, length, and how directly each field is stated. Both arms ask for the same three fields; only the schema statement differs. Hardened for instrument v2: v1 asked for three obvious fields (name, role, city) that any model emits under a bare respond-in-JSON instruction. v2 requires five fields whose key names are not guessable from the prose, so an unstructured arm produces valid JSON with the wrong keys.
- Runs per model per arm
- 5
- Scoring
- Deterministic, via scoreJsonValidAndShaped. A committed function scores each answer with no model in the loop.
- Pass criterion as written for the pilot
- Treatment valid-JSON rate exceeds control by at least 10 percentage points on the same 10 inputs at the same model and settings.
The published verdict comes from status_v1, not from the pass criterion above. The criterion is recorded because it is what the claim was registered with before the run.
Model versions, as recorded
| Model | Version string returned | Delta on this claim | Interval |
|---|---|---|---|
| claude-haiku-4-5 | claude-haiku-4-5-20251001 | +1.000 | 1.000 to 1.000 |
| gpt-5-mini | gpt-5-mini-2025-08-07 | +1.000 | 1.000 to 1.000 |
| gemini-3.1-flash-lite | gemini-3.1-flash-lite | +1.000 | 1.000 to 1.000 |
Reading across models
Sampling was not held constant across vendors, so comparing one model column against another compares two settings as well as two models.
gpt-5-mini rejected the fixed sampling setting and ran at its own default on all 1040 of its calls. The other models ran at temperature 0.