mlsanityData to 7 Oct 2026

Attention Meets Reachability: Structural Equivalence and Efficiency in Grammar-Constrained LLM Decoding

arXiv 2603.05540 ↗First posted 4 Mar 2026cs.CL cs.FL cs.LGcited by 1

Not on the map. Why?

Abstract (arXiv)

We study grammar-constrained decoding (GCD) as a coupling between an autoregressive next-token distribution and a reachability oracle over a pushdown system compiled from a context-free grammar (CFG). We prove an oracle invariance theorem: language-equivalent grammars induce identical admissible next-token sets for every prefix, hence identical logit masks, yet can yield provably different compiled state spaces and online ambiguity costs. We give exact control-state blowup counts for the canonical an bn language under redundant nonterminal delegation, and introduce a left-to-right structural ambiguity cost (SAC) measuring incremental packed-parse-forest growth per token. For two equivalent grammars over all finite strings, SAC is O(1) per token under right-recursion but Theta(t2) per token and Theta(n3) cumulatively under concatenation. We establish engine-independent lower bounds: any sound, retrieval-efficient, parse-preserving online masking engine must incur Omega(t2) work per token on a specific constant-size CFG family, unconditionally within this model. We define decoding-cost equivalence classes of grammars and prove existence of minimal-SAC representatives within bounded rewrite families. Finally, we characterize the true conditional sampler via a Doob h-transform and derive sharp one-step KL and total-variation distortion bounds for hard-masked decoding in terms of survival-probability spread among admissible next tokens. We integrate these results with Transformer and Mixture-of-Experts architectures, derive latency envelopes in terms of vocabulary size, active state sets, and beam width, and connect SAC to instrumentation-based predictive performance models and automated grammar optimization.

Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Builds on 12 of its 37 references that are in the map. First posted on arXiv 4 Mar 2026.

Builds on

12 of 37 references.

References · 12

  1. 2017Attention Is All You Needcited by 59,932
  2. 2017Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layercited by 3,413
  3. 2021Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsitycited by 3,014
  4. 2021PICARD: Parsing Incrementally for Constrained Auto-Regressive Decoding from Language Modelscited by 402
  5. 2023Efficient Guided Generation for Large Language Modelscited by 192
  6. 2021Constrained Language Models Yield Few-Shot Semantic Parserscited by 162
  7. 2022Prompting Is Programming: A Query Language for Large Language Modelscited by 110
  8. 2024Guiding LLMs The Right Way: Fast, Non-Invasive Constrained Generationcited by 99
  9. 2024XGrammar: Flexible and Efficient Structured Generation Engine for Large Language Modelscited by 73
  10. 2024SynCode: LLM Generation with Grammar Augmentationcited by 66
  11. 2025JSONSchemaBench: A Rigorous Benchmark of Structured Outputs for Language Modelscited by 66
  12. 2025Pre3: Enabling Deterministic Pushdown Automata for Faster Structured LLM Generationcited by 11

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2026: 1.

1 paper.

Similar, not cited

Close in wording, no citation either way

  1. 2024Grammar-Aligned Decoding
  2. 2025Constrained Decoding of Diffusion LLMs with Context-Free Grammars
  3. 2026Constrained Decoding Eliminates Structural Failures in Small LLMs but Reveals a Scale-Dependent Semantic Gap
  4. 2025textttSEM-CTRL: Semantically Controlled Decoding
  5. 2026Constrained Decoding for Diffusion Language Models via Efficient Inference over Finite Automata
  6. 2026Constraints Are Graphs, Not Chains: Exact Decoding for Diffusion Language Models
  7. 2026Gated Tree Cross-Attention for Checkpoint-Compatible Syntax Injection in Decoder-Only LLMs
  8. 2025When Grammar Guides the Attack: Uncovering Control-Plane Vulnerabilities in LLMs with Structured Output