Flexible and Efficient Grammar-Constrained Decoding
Not on the map. Why?
Abstract (arXiv)
Large Language Models (LLMs) are often asked to generate structured outputs that obey precise syntactic rules, such as code snippets or formatted data. Grammar-constrained decoding (GCD) can guarantee that LLM outputs matches such rules by masking out tokens that will provably lead to outputs that do not belong to a specified context-free grammar (CFG). To guarantee soundness, GCD algorithms have to compute how a given LLM subword tokenizer can align with the tokens used by a given context-free grammar and compute token masks based on this information. Doing so efficiently is challenging and existing GCD algorithms require tens of minutes to preprocess common grammars. We present a new GCD algorithm together with an implementation that offers 17.71x faster offline preprocessing than existing approaches while preserving state-of-the-art efficiency in online mask computation.
Key facts. Cited by 42 papers in the map (data through 7 Oct 2026). Builds on 9 of its 15 references that are in the map. First posted on arXiv 7 Feb 2025.
Builds on
9 of 15 references.
References · 9
- 2023Efficient Guided Generation for Large Language Modelscited by 192
- 2023Grammar-Constrained Decoding for Structured NLP Tasks without Finetuningcited by 186
- 2022Synchromesh: Reliable code generation from pre-trained language modelscited by 156
- 2024Guiding LLMs The Right Way: Fast, Non-Invasive Constrained Generationcited by 99
- 2024Let Me Speak Freely? A Study on the Impact of Format Restrictions on Performance of Large Language Modelscited by 90
- 2025JSONSchemaBench: A Rigorous Benchmark of Structured Outputs for Language Modelscited by 66
- 2023Grammar Prompting for Domain-Specific Language Generation with Large Language Modelscited by 58
- 2024Grammar-Aligned Decodingcited by 54
- 2024Automata-based constraints for language model decodingcited by 49
Built on by
Citing papers per year: 2025: 13; 2026: 29.
42 papers.
Sort:
By area:
- 2025Grounding Multimodal LLMs to Embodied Agents that Ask for Help with Reinforcement Learningcited by 21
- 2025Fast Controlled Generation from Language Models with Adaptive Weighted Rejection Samplingcited by 20
- 2025Constrained Sampling for Language Models Should Be Easy: An MCMC Perspectivecited by 14
- 2025Pre3: Enabling Deterministic Pushdown Automata for Faster Structured LLM Generationcited by 11
- 2026Mitigating Bias in Locally Constrained Decoding via Tractable Proposalscited by 8
- 2026The Hidden Cost of Structured Generation in LLMs: Draft-Conditioned Constrained Decodingcited by 7
- 2026Lookahead-then-Verify: Reliable Constrained Decoding for Diffusion LLMs under Context-Free Grammarscited by 6
- 2025XML Prompting as Grammar-Constrained Interaction: Fixed-Point Semantics, Convergence Guarantees, and Human-AI Protocolscited by 4
- 2025Constrained Adaptive Rejection Samplingcited by 3
- 2026The Format Taxcited by 3
- 2026Constrained Decoding for Diffusion Language Models via Efficient Inference over Finite Automatacited by 3
- 2025A DbC Inspired Neurosymbolic Layer for Trustworthy Agent Designcited by 2
30 more
- 2025ToolPRM: Fine-Grained Inference Scaling of Structured Outputs for Function Callingcited by 2
- 2025Grounded Misunderstandings in Asymmetric Dialogue: A Perspectivist Annotation Scheme for MapTaskcited by 2
- 2026Schema-Key Wording as an Instruction Channel in Structured Generation under Constrained Decodingcited by 2
- 2025Bootstrapping Fuzzers for Compilers of Low-Resource Language Dialects Using Language Modelscited by 1
- 2026Autoregressive, Yet Revisable: In Decoding Revision for Secure Code Generationcited by 1
- 2026TruncProof: A Guardrail for LLM-based JSON Generation under Token-Length Constraintscited by 1
- 2026EPIC: Efficient and Parallel Inference under CFG Constraints for Diffusion Language Modelscited by 1
- 2026MDP-GRPO: Stabilized Group Relative Policy Optimization for Multi-Constraint Instruction Followingcited by 1
- 2026The Alignment Problem in Constrained Code Generationcited by 1
- 2026Large Databases Need Small, Open-Weight Language Modelscited by 1
- 2025Play by the Type Rules: Inferring Constraints for LLM Functions in Declarative Programscited by 0
- 2025Position: Vibe Coding Needs Vibe Reasoning: Improving Vibe Coding with Formal Verificationcited by 0
- 2025Orthographic Constraint Satisfaction and Human Difficulty Alignment in Large Language Modelscited by 0
- 2026LLMs + Security = Troublecited by 0
- 2026Continuous Diffusion Models Can Obey Formal Syntaxcited by 0
- 2026Precise Robot Command Understanding Using Grammar-Constrained Large Language Modelscited by 0
- 2026Syntax Is Easy, Semantics Is Hard: Evaluating LLMs for LTL Translationcited by 0
- 2026NCO: A Versatile Plug-in for Handling Negative Constraints in Decodingcited by 0
- 2026Learning the Error Patterns of Language Modelscited by 0
- 2026Accelerating Constrained Decoding with Token Space Compressioncited by 0
- 2026Automated IEP Generation from Traditional Chinese Parent-Teacher Interviews via Corpus-Grounded Feature Diffusioncited by 0
- 2026Imprompt: A Language Framework for Prompt Programmingcited by 0
- 2026Specification-Guided Synthesis of Deadlock-Free Communication Protocol Refinements with Large Language Modelscited by 0
- 2026The Parser Already Knows: Lightweight Bias Correction in Constrained Decodingcited by 0
- 2026Neurosymbolic Embodied Agentscited by 0
- 2026Information-Guided Frontier Decoding: Contextual Utility-Driven Commitment in dMLLMscited by 0
- 2026Stay Within Your Bounds: Distance-Guided Decoding for Guaranteed Context-Free Grammar Compliancecited by 0
- 2026Generating Workflow DAGs from Natural Language with Non-Reasoning LLMscited by 0
- 2026Semantic Prefix Oracles for LLM Decoding: Contracts and Differential Validationcited by 0
- 2026DOGS: Design-Space Sampling for Prompt-Driven Logo Generationcited by 0
- 2026DOGS: Design-Space Sampling for Prompt-Driven Logo Generation7 Oct 2026
- 2026Semantic Prefix Oracles for LLM Decoding: Contracts and Differential Validation28 Sep 2026
- 2026Generating Workflow DAGs from Natural Language with Non-Reasoning LLMs31 Aug 2026
- 2026Stay Within Your Bounds: Distance-Guided Decoding for Guaranteed Context-Free Grammar Compliance28 Aug 2026
- 2026Information-Guided Frontier Decoding: Contextual Utility-Driven Commitment in dMLLMs27 Aug 2026
- 2026Neurosymbolic Embodied Agents17 Aug 2026
- 2026The Parser Already Knows: Lightweight Bias Correction in Constrained Decoding10 Aug 2026
- 2026Specification-Guided Synthesis of Deadlock-Free Communication Protocol Refinements with Large Language Models30 Jul 2026
- 2026Imprompt: A Language Framework for Prompt Programming13 Jul 2026
- 2026Constrained Decoding for Diffusion Language Models via Efficient Inference over Finite Automata8 Jul 2026
- 2026Large Databases Need Small, Open-Weight Language Models30 Jun 2026
- 2026The Alignment Problem in Constrained Code Generation19 Jun 2026
30 more
- 2026Automated IEP Generation from Traditional Chinese Parent-Teacher Interviews via Corpus-Grounded Feature Diffusion8 Jun 2026
- 2026MDP-GRPO: Stabilized Group Relative Policy Optimization for Multi-Constraint Instruction Following4 Jun 2026
- 2026Mitigating Bias in Locally Constrained Decoding via Tractable Proposals1 Jun 2026
- 2026EPIC: Efficient and Parallel Inference under CFG Constraints for Diffusion Language Models30 May 2026
- 2026Accelerating Constrained Decoding with Token Space Compression28 May 2026
- 2026Learning the Error Patterns of Language Models27 May 2026
- 2026TruncProof: A Guardrail for LLM-based JSON Generation under Token-Length Constraints13 May 2026
- 2026NCO: A Versatile Plug-in for Handling Negative Constraints in Decoding11 May 2026
- 2026Schema-Key Wording as an Instruction Channel in Structured Generation under Constrained Decoding16 Apr 2026
- 2026Syntax Is Easy, Semantics Is Hard: Evaluating LLMs for LTL Translation8 Apr 2026
- 2026Precise Robot Command Understanding Using Grammar-Constrained Large Language Models5 Apr 2026
- 2026The Format Tax4 Apr 2026
- 2026Continuous Diffusion Models Can Obey Formal Syntax12 Feb 2026
- 2026LLMs + Security = Trouble9 Feb 2026
- 2026The Hidden Cost of Structured Generation in LLMs: Draft-Conditioned Constrained Decoding8 Feb 2026
- 2026Autoregressive, Yet Revisable: In Decoding Revision for Secure Code Generation1 Feb 2026
- 2026Lookahead-then-Verify: Reliable Constrained Decoding for Diffusion LLMs under Context-Free Grammars31 Jan 2026
- 2025Bootstrapping Fuzzers for Compilers of Low-Resource Language Dialects Using Language Models5 Dec 2025
- 2025Orthographic Constraint Satisfaction and Human Difficulty Alignment in Large Language Models26 Nov 2025
- 2025Grounded Misunderstandings in Asymmetric Dialogue: A Perspectivist Annotation Scheme for MapTask5 Nov 2025
- 2025Position: Vibe Coding Needs Vibe Reasoning: Improving Vibe Coding with Formal Verification31 Oct 2025
- 2025ToolPRM: Fine-Grained Inference Scaling of Structured Outputs for Function Calling16 Oct 2025
- 2025Constrained Adaptive Rejection Sampling2 Oct 2025
- 2025Play by the Type Rules: Inferring Constraints for LLM Functions in Declarative Programs24 Sep 2025
- 2025XML Prompting as Grammar-Constrained Interaction: Fixed-Point Semantics, Convergence Guarantees, and Human-AI Protocols9 Sep 2025
- 2025A DbC Inspired Neurosymbolic Layer for Trustworthy Agent Design5 Aug 2025
- 2025Constrained Sampling for Language Models Should Be Easy: An MCMC Perspective6 Jun 2025
- 2025Pre3: Enabling Deterministic Pushdown Automata for Faster Structured LLM Generation4 Jun 2025
- 2025Fast Controlled Generation from Language Models with Adaptive Weighted Rejection Sampling7 Apr 2025
- 2025Grounding Multimodal LLMs to Embodied Agents that Ask for Help with Reinforcement Learning1 Apr 2025
- 2026MDP-GRPO: Stabilized Group Relative Policy Optimization for Multi-Constraint Instruction Followingcited by 1
- 2025Play by the Type Rules: Inferring Constraints for LLM Functions in Declarative Programscited by 0
- 2025Position: Vibe Coding Needs Vibe Reasoning: Improving Vibe Coding with Formal Verificationcited by 0
- 2026Generating Workflow DAGs from Natural Language with Non-Reasoning LLMscited by 0
- 2026Generating Workflow DAGs from Natural Language with Non-Reasoning LLMs31 Aug 2026
- 2026MDP-GRPO: Stabilized Group Relative Policy Optimization for Multi-Constraint Instruction Following4 Jun 2026
- 2025Position: Vibe Coding Needs Vibe Reasoning: Improving Vibe Coding with Formal Verification31 Oct 2025
- 2025Play by the Type Rules: Inferring Constraints for LLM Functions in Declarative Programs24 Sep 2025
- 2025Fast Controlled Generation from Language Models with Adaptive Weighted Rejection Samplingcited by 20
- 2025Constrained Sampling for Language Models Should Be Easy: An MCMC Perspectivecited by 14
- 2025Pre3: Enabling Deterministic Pushdown Automata for Faster Structured LLM Generationcited by 11
- 2026Mitigating Bias in Locally Constrained Decoding via Tractable Proposalscited by 8
- 2026The Hidden Cost of Structured Generation in LLMs: Draft-Conditioned Constrained Decodingcited by 7
- 2026Lookahead-then-Verify: Reliable Constrained Decoding for Diffusion LLMs under Context-Free Grammarscited by 6
- 2025XML Prompting as Grammar-Constrained Interaction: Fixed-Point Semantics, Convergence Guarantees, and Human-AI Protocolscited by 4
- 2025Constrained Adaptive Rejection Samplingcited by 3
- 2026The Format Taxcited by 3
- 2025Grounded Misunderstandings in Asymmetric Dialogue: A Perspectivist Annotation Scheme for MapTaskcited by 2
- 2026Schema-Key Wording as an Instruction Channel in Structured Generation under Constrained Decodingcited by 2
- 2026Autoregressive, Yet Revisable: In Decoding Revision for Secure Code Generationcited by 1
12 most cited of 29 All 29 (JSON)
- 2026DOGS: Design-Space Sampling for Prompt-Driven Logo Generation7 Oct 2026
- 2026Semantic Prefix Oracles for LLM Decoding: Contracts and Differential Validation28 Sep 2026
- 2026Stay Within Your Bounds: Distance-Guided Decoding for Guaranteed Context-Free Grammar Compliance28 Aug 2026
- 2026The Parser Already Knows: Lightweight Bias Correction in Constrained Decoding10 Aug 2026
- 2026Specification-Guided Synthesis of Deadlock-Free Communication Protocol Refinements with Large Language Models30 Jul 2026
- 2026Imprompt: A Language Framework for Prompt Programming13 Jul 2026
- 2026Large Databases Need Small, Open-Weight Language Models30 Jun 2026
- 2026The Alignment Problem in Constrained Code Generation19 Jun 2026
- 2026Automated IEP Generation from Traditional Chinese Parent-Teacher Interviews via Corpus-Grounded Feature Diffusion8 Jun 2026
- 2026Mitigating Bias in Locally Constrained Decoding via Tractable Proposals1 Jun 2026
- 2026Accelerating Constrained Decoding with Token Space Compression28 May 2026
- 2026Learning the Error Patterns of Language Models27 May 2026
12 newest of 29 All 29 (JSON)