Explain like I'm five · AI

What is structured output?

Structured output (JSON output), told as a story about handing the parrot a form and letting it write only in the boxes.

Mr Kim paid 10,000 won on March 3???ledger machinethe machine cannot read ityesterday, today, tomorrowMarch 3, 10k…10k, 3/3, Kim…Kim: on the 3rd…the answer is right, but its shape changes every time — the machine cannot read it

The answer is right, but its shape changes every time. The machine cannot read it.We want to feed the parrot answer into a ledger program. But yesterday the date came first, today the name. The machine cannot tell which part is which.

10k won on March 3Mr Kim, 10k, the 3rd!hmm… about 10k that day?the parrot answers in wordsno boxes, so it writes freelyno boxespeople understand all three — a machine needs fixed boxes

The parrot answers in words. With no boxes, it writes freely.Even if the note says keep it short, the shape still varies. People understand every version; a machine needs fixed boxes.

FORMnamedateamountan empty formthe trainer hands the formFORMnameKimdateMar 3amount10000writes only in the boxesno words outside the boxes — the machine reads it straight awaystructured output: hand the parrot a form and let it write only in the boxes

Structured output hands the parrot a form and lets it write only in the boxes.Box names and types are set ahead of time. The parrot fills only those boxes. The machine finds the name box and the date box straight away.

Name the boxes and their typesname is text, amount is a number
Missing value? Leave it emptyleave it blank, do not invent
No chattera machine reads it — no greetings
Outside the boxes? Redocheck it, and if wrong, ask again
FREE ANSWERMr Kim paid 10k won on March 3???machine: which part is the name?FORM ANSWERFORMnameKimdateMar 3amount10000✓ledgermachine: name box = Kim ✓with named boxes it files it at oncethe same content, in boxes, and the machine can read it

The same content, written in boxes, and the machine can read it.Each box has a name. The machine reads the name from the name box and the number from the amount box. The shape never changes, so it works every time.

FORMnameKimdateMar 3amount99999shape ✓ content ×boxes filled, but the amount is made upTOOL REQUESTtoolcalculatorinput3 + 4tool requests use a form toothe trainer reads it and runs the toola filled form is not a true form — check the content separately

A filled form is not a true form. Check the content separately.A number in the amount box can still be made up — the plausible parrot lies inside forms too. And tool requests are written on this kind of form as well.

In one breath

Structured output = hand the parrot a form with boxes and let it write only in those boxes. A machine can read it straight away. A correct shape does not mean correct content.

Makes the model respond only in a shape that matches a predefined schema (such as JSON Schema). You define field names, types and enums, then parse and validate the response, retrying on failure. Function calling (tool use) works on the same principle — arguments emitted to a schema. A valid shape still says nothing about whether the values are true.

When grown-ups say it

Structured output
Writing only in the boxes. Locks the parrot answer into a shape a machine can read.
JSON mode
The most common kind of form. A list of boxes in braces and quotes. Nearly every program can read it.
Schema
The blueprint of the form. Box names, types (text, number, yes/no) and which boxes are required, written down ahead of time.
Relation to function calling
Tool requests are forms too. Which tool, with which values, written into boxes. → the toolbox
Validation
Checking the form. The machine first checks that every box is there and of the right type.
Retry on parse failure
Outside the boxes? Write it again. Sometimes the form breaks. Point out the error and ask once more.
Enum
Only the listed values. For example a status box allows only pending, done or cancelled — no new words.
Prompt
The trainer note. Handing over the form is part of the note. → the trainer note
Next story
Showing Each Bean Right Away →
Want another term as a picture book? Request →