Louf describes a common failure: a model asked to extract flight details from emails may return invalid JSON even after extensive prompting or function calling. Because software depends on reliable interfaces, inconsistent model outputs make it harder to build dependable agent systems.
No more bad outputs with structured generation
Speaker
Remi Louf, co-author and co-maintainer of Outlines and CEO and co-founder of Dottxt, explains structured generation and its role in making language model outputs more reliable for software workflows.
Outlines is a Python library for adding structured generation to existing workflows, with integrations for open models and serving systems such as vLLM and TGI. It can constrain output with regular expressions, JSON Schema, Pydantic models, and custom types such as three-letter airport codes. Louf explains that Outlines masks tokens that would violate the requested structure.
Louf argues that structured text appears in many tasks, from JSON to GSM8K math problems. In a Predibase experiment, Mistral 7B produced valid JSON 17.7% of the time without structured generation and 99.9% with it. He also reports that structured generation can reduce generated tokens, match eight-shot GSM8K accuracy with one shot, and raise Phi-3 Medium function-calling accuracy from 86% to 96.5%, above the cited GPT-4 benchmark score of 93.5%.
Louf says Outlines has expanded from regular expressions to context-free grammars for tasks such as code and protein structures. The team is also working on semantic constraints for text-to-SQL, aiming to ensure generated queries run even when correctness of the result cannot be guaranteed. Future work aims to avoid unnecessary computation inside the model.
Takeaways
- Use structured generation to enforce output formats instead of relying on prompts and post-generation parsing.
- Treat output schemas as part of the interface when connecting language models to software.
- Constrain only the structure your task requires, including field types such as airport codes.
- Measure token counts as well as latency: shorter constrained outputs can reduce generation work.
- Test structured generation on small open models; it may improve task accuracy and reduce the need for examples.
Mentioned in this talk
Search inside this talk
What was claimed 15
- builtcreator
“the co-author and co-maintainer of the open-source library Outlines”
YouTube Verified2 sources· Talk, Web· archived
- foundedCEO and co-founder
“I'm also the CEO and co-founder of Dottxt”
YouTube Verified5 sources· Talk, Web· archived
- feature
Outlines: Guides model generation to conform to specified structures
“the ability to guide the model to return a specific structure”
YouTube Unverified1 source· Talk
- integrates with
“and TGI in their serving frameworks”
YouTube Unverified1 source· Talk
- integrates with
“it's been adopted by vLLM”
YouTube Unverified1 source· Talk
- integrates with
“We have an integration with OpenAI”
YouTube Unverified1 source· Talk
- integrates with
“and, recently, MLX”
YouTube Unverified1 source· Talk
- integrates with
“Transformers, llama.cpp, and, recently, MLX”
YouTube Unverified1 source· Talk













