Structured Outputs
How to make a model answer in a shape a program can use: JSON Schema, constrained decoding, a schema you write yourself, a rubric grader, and a report built from the graded JSON.
Structured Outputs
How to make a model answer in a shape a program can use: JSON Schema, constrained decoding, a schema you write yourself, a rubric grader, and a report built from the graded JSON.
You come away knowing why asking for JSON in plain words fails, what a schema guarantees and what it does not, how to write one with required fields and no extra properties, and how to feed graded JSON back in to render a report.
Honest about how it was made: this film was drafted in Muse and then cleaned up and rebuilt with Claude. The film separates what Meta documents (the shape of the output is guaranteed) from Andrew Brown's claim that a schema also shapes reasoning, shown as his claim and not Meta's, and from "the grade is right", which nobody promises. Lines the course source does not support were cut.
A note that opens the film Muse drafted this, Claude cleaned it up. This film began as a rough draft made with Muse. Muse runs on a simple model called Spark, and Spark makes a lot of mistakes, so Claude cleaned the draft up. The method is the point: draft in Muse, then finish in Claude or Codex. One kind of mistake we looked for: a draft Muse diagram of two big boxes and a check mark under a question about whether a non-technical person could use it, with both boxes empty. A diagram that shows nothing teaches nothing, so Claude replaced diagrams like this one.
Narrated by Liam, in for Bear. Narration is an AI voice; the film was made with AI tools.
Chapters 0:00 Muse note 0:28 The idea and the key terms 1:01 The Promise 1:49 Writing The Schema 2:53 The Grader 3:39 The Report 4:14 Recap 4:31 Your Turn
Your turn Paste this into Claude: I want Muse to grade [describe something you made or wrote this week] against a rubric and return JSON. Write me a JSON Schema with a score from zero to one hundred, a mark and a comment for three categories that fit this task, and a feedback field for me. Set additionalProperties to false and list every field as required. Then show me the response_format block I would send to Meta's Chat Completions endpoint. Then check two things yourself. Is every field in the schema listed under required? And does the response format block use type json schema, with your schema inside it?
Sources shown on screen Meta's public docs and cookbook at dev.meta.ai (structured output, cookbook structured output, reasoning), captured 2026-10-07. Narration follows a Muse course taught by Andrew Brown, named on screen. Nothing here is a product endorsement.
Part of the playlist Muse for Educational AI.
@NikBearBrown
What this video covers
- 0:00 — Muse note
- 0:28 — The idea and the key terms
- 1:01 — The Promise
- 1:49 — Writing The Schema
- 2:53 — The Grader
- 3:39 — The Report
- 4:14 — Recap
- 4:31 — Your Turn
Transcript
A lightly formatted transcript of the video, with timestamps so you can jump to any section on YouTube.
Muse note
[0:00] A note before we start, this film began as a rough draft made with Muse. Muse runs on a simple model called Spark and Spark makes a lot of mistakes. So, Claude cleaned this draft up. The method is the point, draft in Muse then finish in Claude or Codex. Here is the kind of mistake we look for. A draft diagram from Muse, two big boxes and a check mark under a question about whether a non-technical person could use it. Both boxes are empty. A diagram that shows nothing teaches nothing. So, Claude replaced diagrams like this one.
The idea and the key terms
[0:28] Hello, this is Liam from Bear. Ask a model a question and you get a paragraph. A program can't do much with a paragraph. This lecture is about structured output, telling Muse the exact shape of its answer, getting data your code can read, and turning that data into a page a person can read. Five terms, JSON text that holds labeled fields, JSON schema, a contract saying which fields exist and what type each one is, token, a small chunk of text, the unit a model writes in, decoding, the model choosing its answer one token at a time, and rubric, a checklist for grading something.
The Promise
[1:01] Ask for JSON in plain words and you get prose. Meta's own cookbook says the model often adds a sentence of preamble or wraps the JSON in a markdown fence and the parser chokes on anything that isn't pure JSON. A schema changes the deal. The model writes one token at a time and with a schema attached, Meta says decoding itself is constrained. At every step, only tokens that keep the answer valid are allowed. This is not cleanup afterwards. What is it for? Meta's guide names four jobs, pulling fields out of messy text, sorting input into labels, producing arguments for functions, and generating configuration files. Where does the schema go? On chat completions, it goes in response underscore format. On the responses API, the same job is text.format. Mix them up and Meta says nothing is configured.
Writing The Schema
[1:49] Here is Meta's own example. The schema is plain JSON, an object with four properties, street, city, state, and zip, each a string. State and zip each carry a description, and required lists all four. Send it one messy line, 1 Hacker Wy Menlo Park CA 94025. Back come exactly those four fields, street, city, state, zip. Even the abbreviation is spelled out, Wy becomes Way. In Python, you can skip writing the schema by hand. Define a class with four typed fields, hand it to the SDK, and you get a typed object back. One definition drives both the request and the result. Schemas have limits. Meta checks the schema before decoding starts, and one over the limit returns an HTTP 400. 10 levels of nesting at most, 5,000 properties in total, and no schema that refers to itself. Strict mode asks for two things. Every object sets additional properties to false, so there are no stray fields, and required lists every key, so none go missing. Strict is off by default, and output follows your schema either way.
The Grader
[2:53] Andrew Brown's course builds a Japanese grader, and the rubric is a JSON schema. A rubric is a grading checklist. Here is one of that kind sketched for this lecture, not his file. A score, a mark, and comment per category, and feedback. Then the loop, a challenge comes first. You write an attempt. The model grades it against the rubric, and what comes back is graded JSON, not a paragraph of comments. Because the shape is fixed, your code can lean on it. Read the reply with json.loads, and the score is just a key in the same place every time. No hunting through sentences for a number. Meta documents the shape, valid JSON, your keys, your types. It does not promise the grade is right. Andrew Brown goes further and argues the schema constrains the reasoning, not just the format. That is his argument, not Meta's.
The Report
[3:39] Now the second move, take the graded JSON and feed it back in with a new instruction, render this as an HTML report. The first called judged, this one designs, and an HTML page is just a file you open in a browser. Every finds a place on the page. The score becomes the headline, each category gets a section, and the feedback closes it. Because the input is structured, nothing has to be guessed about which number is which. Put it together and a study session becomes a pipeline. Challenge, attempt, graded JSON report. Every step has a shape, so every step can be run again any day on a new attempt. Let's recap
Recap
[4:15] With Claude. A schema constrains decoding, so the shape of the answer is guaranteed. The schema schema is plain JSON with limits, and strict mode locks it down. A rubric schema turns grading into fields your code can read, and fed back in, the graded JSON becomes a report a person can read. Your turn.
Your Turn
[4:32] Paste this into Claude. I want Muse to grade describe something you made or wrote this week against a rubric and return JSON. Write me a JSON schema with a score from 0 to 100, a mark, and a comment for three categories that fit this task, and a feedback field for me. Set additional properties to false and list every field as required. Then show me the response format block I would send to Meta's chat completions endpoint. Then check two things yourself. Is every field in the schema listed under required, and does the response format block use type JSON schema with your schema inside it? Structured outputs at Nick Bear Brown.





