Pith. sign in

REVIEW 1 cited by

WGRAMMAR: Leverage Prior Knowledge to Accelerate Structured Decoding

Not yet reviewed by Pith; the record is open.

This paper has not been read by Pith yet. Machine review is queued; the pith claim, tier, and objections will appear here once it completes.

SPECIMEN: schema-true, not a live event

T0 review · schema-true

One-sentence machine reading of the paper's core claim.

pith:XXXXXXXX · record.json · timestamp

arxiv 2507.16768 v1 pith:DGJ67SSJ submitted 2025-07-22 cs.AI

WGRAMMAR: Leverage Prior Knowledge to Accelerate Structured Decoding

classification cs.AI
keywords wgrammardecodingachievingdecompositiondynamicexistingformatsgrammar
verification ladder T0 review T1 audit T2 compute T3 formal T4 reserved
0 comments
read the original 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.

discussion (0)

Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.

Forward citations

Cited by 1 Pith paper

Reviewed papers in the Pith corpus that reference this work. Sorted by Pith novelty score.

  1. XGrammar-2: Efficient Dynamic Structured Generation Engine for Agentic LLMs

    cs.AI 2026-01 conditional novelty 6.0

    XGrammar-2 makes dynamic, tag-triggered structured generation fast by dispatching to cached substructure grammars with an Earley-based adaptive token-mask cache.