mlsanityData to 14 Oct 2026

WGRAMMAR: Leverage Prior Knowledge to Accelerate Structured Decoding

arXiv 2507.16768 ↗First posted 22 Jul 2025cs.AIcited by 2

Not on the map. Why?

Abstract (arXiv)

Structured decoding enables large language models (LLMs) to generate outputs in formats required by downstream systems, such as HTML or JSON. However, existing methods suffer from efficiency bottlenecks due to grammar compilation, state tracking, and mask creation. We observe that many real-world tasks embed strong prior knowledge about output structure. Leveraging this, we propose a decomposition of constraints into static and dynamic components -- precompiling static structures offline and instantiating dynamic arguments at runtime using grammar snippets. Instead of relying on pushdown automata, we employ a compositional set of operators to model regular formats, achieving lower transition latency. We introduce wgrammar, a lightweight decoding engine that integrates domain-aware simplification, constraint decomposition, and mask caching, achieving up to 250x speedup over existing systems. wgrammar's source code is publicly available at https://github.com/wrran/wgrammar.

Key facts. Cited by 2 papers in the map (data through 14 Oct 2026). Builds on 4 of its 12 references that are in the map. First posted on arXiv 22 Jul 2025.

Builds on

4 of 12 references.

References · 4

  1. 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 5,944
  2. 2024Qwen2.5 Technical Reportcited by 4,942
  3. 2024A Survey on Large Language Models for Code Generationcited by 658
  4. 2024XGrammar: Flexible and Efficient Structured Generation Engine for Large Language Modelscited by 75

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2026: 2.

2 papers.