# XGrammar: Flexible and Efficient Structured Generation Engine for Large Language Models

*Source* · `src-dong-2024-xgrammar` · status: **n/a**

| field | value |
|---|---|
| kind | Preprint |
| authors | Yixin Dong, Charlie F. Ruan, Yaxing Cai, Ruihang Lai, Ziyi Xu, Yilong Zhao, Tianqi Chen |
| venue | arXiv |
| date | 2024-11-22 |
| url | https://arxiv.org/abs/2411.15100 |
| arxiv | 2411.15100 |
| accessed | 2026-10-24 |

## Notes

CFG-constrained decoding; vocabulary split into context-independent tokens prechecked and context-dependent tokens checked at runtime with a persistent stack; grammar work overlapped with GPU execution; up to 100x faster than prior solutions, near-zero end-to-end overhead.

## Backlinks (computed)

**cited by:** [Grammar-constrained decoding for valid game actions](../technique/constrained-decoding.md)

## Citation

Yixin Dong, Charlie F. Ruan, Yaxing Cai, Ruihang Lai, Ziyi Xu, Yilong Zhao, Tianqi Chen (2024-11-22). *XGrammar: Flexible and Efficient Structured Generation Engine for Large Language Models*. arXiv https://arxiv.org/abs/2411.15100

---
Provenance: created in run `2026-10-24-techniques-llm-agents`.
