MLC | Achieving Efficient, Flexible, and Portable Structured Generation with XGrammar
We are witnessing an exciting era for large language models (LLMs). As LLM applications evolve, we are increasingly moving toward LLM agents that not only respond in raw text but can also generate code, call environment functions, and even control robots. To enable these richer LLM agent applications, LLM engines need to produce structured outputs that can be consumed by downstream agent systems. Examples of these structures include JSON, SQL, Python, and more. This paradigm is known as the structured generation in LLM inference. Fundamentally, an ideal LLM structured generation system should satisfy the following requirements: It is challenging to address all these goals simultaneously. Some libraries introduce efficiency optimizations but at the cost of restricting to a small set of structures (e.g., those representable by finite-state machines). Conversely, supporting more general structures through expressive representations like context-free grammar (CFG) introduces challenges in
MLC | Achieving Efficient, Flexible, and Portable Structured Generation with XGrammar --> Home Achieving Efficient, Flexible, and Portable Structured Generation with XGrammar Nov 22, 2024 • MLC Community We are witnessing an exciting era for large language models (LLMs). As LLM applications evolve, we are increasingly moving toward LLM agents that not only respond in raw text but can also generate code, call environment functions, and even control robots. To enable these richer LLM agent applications, LLM engines need to produce structured outputs that can be consumed by downstream agent syste
Explore this link on the map →related reading
- Structured Decoding in vLLM: A Gentle Introductionbentoml.com
- structured decoding, a guide for the impatientaarnphm.xyz
- LLM Powered Autonomous Agents | Lil'Loglilianweng.github.io
- GenAI Handbookgenai-handbook.github.io
- Patterns for Building LLM-based Systems & Productseugeneyan.com
- A Guide to Structured Outputs Using Constrained Decodingaidancooper.co.uk
- Composer2.pdfcursor.com
- BAMLboundaryml.com
- Recursive Language Models | Alex L. Zhangalexzhang13.github.io
- 2025: The year in LLMssimonwillison.net
- crawshaw - 2025-01-06crawshaw.io
- Large Language Diffusion Modelsarxiv.org