Pith. sign in

WGRAMMAR: Leverage Prior Knowledge to Accelerate Structured Decoding

1 Pith paper cite this work. Polarity classification is still indexing.

1 Pith paper citing it
abstract

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.

fields

cs.AI 1

years

2026 1

verdicts

CONDITIONAL 1

representative citing papers

Trie Automata for Constrained Decoding over Large Finite Sets

cs.AI · 2026-08-12 · conditional · novelty 6.0

A trie automaton with Aho-Corasick precomputed token masks makes finite-set constrained decoding near-constant per step, giving 7x faster masking and 29x higher vLLM batch throughput than XGrammar.

citing papers explorer

Showing 1 of 1 citing paper.

  • Trie Automata for Constrained Decoding over Large Finite Sets cs.AI · 2026-08-12 · conditional · none · ref 13 · internal anchor

    A trie automaton with Aho-Corasick precomputed token masks makes finite-set constrained decoding near-constant per step, giving 7x faster masking and 29x higher vLLM batch throughput than XGrammar.