AI Engineering Design Patterns | S01 | E2.1: Structured Output
Gensoku Devs
0:00 / 0:00
AI Engineering Design Patterns | S01 | E2.1: Structured Output
992 просмотра · 9 дн. назад
Gensoku Devs
44 подписчика
992 просмотра · 9 дн. назад
Structured output makes an LLM return JSON your code can parse: generation is constrained to a schema, so the output matches the shape you asked for.
In Episode 02 of AI Engineering Design Patterns, we go past "just ask the model for JSON". We open up how constrained decoding actually works inside the model, the cases that still break it in production, and the code to do it properly.
What you'll learn:
• Why prompting for JSON isn't enough: prose around the output, missing keys, wrong types
• How LLMs actually work in a auto-regressive manner
• How a JSON Schema becomes a state machine that decides which tokens are allowed next
• Tokenizer, logits and masking: how invalid tokens are ruled out at every step
• What changes with thinking mode and redacted thinking
• How refusals surface when the model won't answer inside your schema
• Where model distillation attack surfaces
Code: https://github.com/gensokudevs/AI-Eng...
AI System Design Mock Interview: https://topmate.io/gensoku_devs/2379685
AI Engineer Mock Interview: https://topmate.io/gensoku_devs/2379705
Tech Career Guidance: https://topmate.io/gensoku_devs/2141067
Other Services: https://topmate.io/gensoku_devs
Previous episode (E01, Tool Use): • AI Engineering Design Patterns | S01 | E01...
Follow the full course: • AI Engineering Design Patterns Full Course
TIMESTAMPS
0:00 Intro - Structured Output
7:36 How does a LLMs work?
10:48 Tokens, Model Vocabulary, Embeddings, Sampler & Token IDs
21:16 Constrained Decoding, Logits, Mask & State Machine
35: 31 Anthropic's transform_schema()
39:06 Thinking Models & thinking tokens
45:01 Thinking modes (Extended, Adaptive) & Effort Levels (L, M, H, E)
50:41 Important Note !!
51:10 Interleaving Thinking
57:31 Redacted Thinking, Refusal Stop Reason & Model Distillation Attacks
1:11:50 Coding
Gensoku Devs (原則, "fundamental principle") goes depth-first through the structural decisions real production AI systems are built on. If it isn't deep, it isn't Gensoku.
Collaborations: gensokudevs@gmail.com
#AIEngineering #Constraineddecoding #LLM