Saibo-creator/Awesome-LLM-Constrained-Decoding

A curated list of papers related to constrained decoding of LLM, along with their relevant code and resources.

369

71 commits

updated Jul 27, 2026

See the code

README

Awesome-LLM-Constrained-Decoding

Towards reliable, controllable and more efficient generation with Large Language Models (LLMs)

A curated list of papers related to constrained decoding of LLM, along with their relevant code and resources.

Table of Contents

Libraries

LibraryFeatureStars
guidance-ai/guidanceCFG, Regex, JSON Schema, Token Forcing, compatible with Transformers, LLAMA-CPPStars
outlines-dev/outlinesCFG, Unicode support, Hugging Face ecosystem, VLLM supportStars
jxnl/instructorTry-Reject-Repeat approach to ensure constraints are metStars
eth-sri/lmqlRegex support, various constraints, more powerful control flowStars
microsoft/aiciA general framework of LLM controller with native support for CFG, Regex, JSON SchemaStars
noamgat/lm-format-enforcerRegex, JSON Schema, Beam Search etc.Stars
mlc-ai/xgrammarCFG, careful system optimizationsStars
uiuc-focal-lab/syncodeCFG generation that supports builtin grammars like JSON, Python, Go, and moreStars
Dan-wanna-M/formatronRegex, JSON Schema, CFG, etcStars
genlm/genlm-controlArbitrary programmable syntactic and semantic constraints, Constrained decoding as posterior inference, Sequential Monte CarloStars
epfl-dlab/transformers-CFGCFG (EBNF Interface), Compatible with Transformers, Easy to extend for researchStars
eth-sri/type-constrained-code-generationTypeScript, including type-safety.Stars
litelinesRegex, JSON Schema, Tool-calling, triggered structured generation, visualization of the finite state machineStars
eth-sri/constrained-diffusionDiffusion LLMs, Multi-Region Infilling (CFG)Stars
snowkylin/circuit-transformerGenerating logical circuits that are strictly equivalent to given Boolean functions.Stars
structuredllm/itergenCFG generation and backtracking to handle semantic constraintsStars
epfl-dlab/jsonschemabenchA benchmarking framework for evaluating constrained decoding engines on JSON Schema. Supports Guidance, Outlines, XGrammar, OpenAI and more.Stars
grammarllmLLprefix, DPDAStars

Disclaimer:

  • The libraries listed above are not exhaustive and are subject to change.
  • The features mentioned are 100% not exhaustive and I strongly recommend checking the respective repositories for more details.
  • The libraries are listed by the Github stars
  • If you are the author of a library and would like to add or update the information, please open an issue or submit a pull request.

Papers

Papers with are newly added papers (not necessarily newly published papers).

Constrained Decoding for Autoregressive Models

DatePaperPublication
2026-01Thinking Before Constraining: A Unified Decoding Framework for Large Language ModelsPreprint
2025-07Grammar-Constrained Decoding Makes Large Language Models Better Logical ParsersACL
2025-07GRAMMAR-LLM: Grammar-Constrained Natural Language GenerationACL Findings
2025-07Pre3: Enabling Deterministic Pushdown Automata for Faster Structured LLM GenerationACL
2025-07Syntactic Control of Language Models by Posterior InferenceACL Findings
2025-06Earley-Driven Dynamic Pruning for Efficient Structured DecodingICML
2025-05Fast Controlled Generation from Language Models with Adaptive Weighted Rejection SamplingPreprint
2025-05Syntactic and Semantic Control of Large Language Models via Sequential Monte CarloICLR
2025-04Efficient and Asymptotically Unbiased Constrained Decoding for Large Language ModelsAISTATS
2025-02CRANE: Reasoning with constrained LLM generationICML
2025-05Type-Constrained Code Generation with Language ModelsPLDI
2025-02Lost in Space: Optimizing Tokens for Grammar-Constrained DecodingPreprint
2025-02Think Inside the JSON: Reinforcement Strategy for Strict LLM Schema AdherencePreprint
2025-02Flexible and Efficient Grammar-Constrained DecodingPreprint
2025-01Circuit Transformer: A Transformer That Preserves Logical EquivalenceICLR
2025-01Generating Structured Outputs from Language Models: Benchmark and StudiesPreprint
2024-11XGRAMMAR: FLEXIBLE AND EFFICIENT STRUCTURED GENERATION ENGINE FOR LARGE LANGUAGE MODELSPreprint
2024-10IterGen: Iterative Semantic-aware Structured LLM Generation with BacktrackingICLR
2024-08Let Me Speak Freely? A Study on the Impact of Format Restrictions on Performance of Large Language ModelsPreprint
2024-08FANTAstic SEquences and Where to Find Them: Faithful and Efficient API Call Generation through State-tracked Constrained Decoding and RerankingPreprint
2024-07Automata-based constraints for language model decodingCoLM
2024-06Sketch-Guided Constrained Decoding for Boosting Blackbox Large Language Models without Logit AccessACL
2024-05Grammar-Aligned DecodingPreprint
2024-03SynCode: LLM Generation with Grammar AugmentationPreprint
2024-03Guiding LLMs The Right Way: Fast, Non-Invasive Constrained GenerationICML
2024-02Constrained Decoding for Cross-lingual Label ProjectionICLR
2024-02Constrained Decoding for Code Language Models via Efficient Left and Right Quotienting of Context-Sensitive GrammarsPreprint
2024-02Formal-LLM: Integrating Formal Language and Natural Language for Controllable LLM-based AgentsPreprint
2023-12SGLang: Efficient Execution of Structured Language Model ProgramsPreprint
2023-12Monitor-Guided Decoding of Code LMs with Static Analysis of Repository ContextNeurIPS
2023-11Prompt Sketching for Large Language ModelsPreprint
2023-11Sequential Monte Carlo Steering of Large Language Models using Probabilistic ProgramsPADL
2023-10Don't Fine-Tune, Decode: Syntax Error-Free Tool Use via Constrained DecodingPreprint
2023-10Amortizing intractable inference in large language modelsICLR
2023-10Terminology-Aware Translation with Constrained Decoding and Large Language Model PromptingEMNLP
2023-10KCTS: Knowledge-Constrained Tree Search Decoding with Token-Level Hallucination DetectionEMNLP
2023-10Lazy-k Decoding: Constrained Decoding for Information ExtractionEMNLP
2023-07Efficient Guided Generation for Large Language ModelsPreprint
2023-06Grammar Prompting for Domain-Specific Language Generation with Large Language ModelsNeurIPS
2023-06Grammar-Constrained Decoding for Structured NLP Tasks without FinetuningEMNLP
2023-06Prompting Is Programming: A Query Language for Large Language ModelsPLDI
2023-05Measuring and Mitigating Constraint Violations of In-Context Learning for Utterance-to-API Semantic ParsingEMNLP Findings
2023-04Tractable Control for Autoregressive Language GenerationICML
2022-11Validating Large Language Models with ReLMMLSys
2022-11CodePAD: Sequence-based Code Generation with Pushdown AutomatonISSTA
2022-05Controllable Text Generation with Neurally-Decomposed OracleNeurIPS
2022-05Gradient-Based Constrained Sampling from Language ModelsEMNLP
2022-02COLD Decoding: Energy-based Constrained Text Generation with Langevin DynamicsNeurIPS
2022-01Synchromesh: Reliable code generation from pre-trained language modelsICLR
2021-12PICARD: Parsing Incrementally for Constrained Auto-Regressive Decoding from Language ModelsEMNLP
2021-12Constrained Language Models Yield Few-Shot Semantic ParsersEMNLP
2021-12Controlled Text Generation as Continuous Optimization with Multiple ConstraintsNeurIPS
2021-06NEUROLOGIC DECODING:(Un)supervised Neural Text Generation with Predicate Logic ConstraintsNAACL
2019-05A General-Purpose Algorithm for Constrained Sequential InferenceCoNLL
2019-05Improved Lexically Constrained Decoding for Translation and Monolingual RewritingNAACL
2018-09CGMH: Constrained Sentence Generation by Metropolis-Hastings SamplingAAAI
2018-05Fast Lexically Constrained Decoding with Dynamic Beam Allocation for Neural Machine TranslationNAACL
2018-04Incorporating Discriminator in Sentence Generation: a Gibbs Sampling MethodAAAI
2017-12Guided Open Vocabulary Image Captioning with Constrained Beam SearchEMNLP
2017-06Lexically Constrained Decoding for Sequence Generation Using Grid Beam SearchACL

Constrained Decoding for Diffusion Models

Benchmark & Datasets & Evaluation

Survey

Blog Posts

Many of the blogs are written by Outlines team, many thanks to them for their great work! ❤️

Disclaimer

This list is not exhaustive and will be updated regularly. If you have any suggestions or want to add a paper, please feel free to open an issue or submit a pull request. We hope to include all relevant papers in this list.

Contributing

Contributions are welcome! Feel free to submit a pull request or open an issue. Please make sure to read the Contributing Guidelines before contributing.

Contributors

Saibo-creator

58 commits

tarsur909

3 commits

shubhamugare

2 commits

nielstron

2 commits

Saibo-creator/Awesome-LLM-Constrained-Decoding

A curated list of papers related to constrained decoding of LLM, along with their relevant code and resources.

369

71 commits

updated Jul 27, 2026

See the code

README

Awesome-LLM-Constrained-Decoding

Towards reliable, controllable and more efficient generation with Large Language Models (LLMs)

A curated list of papers related to constrained decoding of LLM, along with their relevant code and resources.

Table of Contents

Libraries

LibraryFeatureStars
guidance-ai/guidanceCFG, Regex, JSON Schema, Token Forcing, compatible with Transformers, LLAMA-CPPStars
outlines-dev/outlinesCFG, Unicode support, Hugging Face ecosystem, VLLM supportStars
jxnl/instructorTry-Reject-Repeat approach to ensure constraints are metStars
eth-sri/lmqlRegex support, various constraints, more powerful control flowStars
microsoft/aiciA general framework of LLM controller with native support for CFG, Regex, JSON SchemaStars
noamgat/lm-format-enforcerRegex, JSON Schema, Beam Search etc.Stars
mlc-ai/xgrammarCFG, careful system optimizationsStars
uiuc-focal-lab/syncodeCFG generation that supports builtin grammars like JSON, Python, Go, and moreStars
Dan-wanna-M/formatronRegex, JSON Schema, CFG, etcStars
genlm/genlm-controlArbitrary programmable syntactic and semantic constraints, Constrained decoding as posterior inference, Sequential Monte CarloStars
epfl-dlab/transformers-CFGCFG (EBNF Interface), Compatible with Transformers, Easy to extend for researchStars
eth-sri/type-constrained-code-generationTypeScript, including type-safety.Stars
litelinesRegex, JSON Schema, Tool-calling, triggered structured generation, visualization of the finite state machineStars
eth-sri/constrained-diffusionDiffusion LLMs, Multi-Region Infilling (CFG)Stars
snowkylin/circuit-transformerGenerating logical circuits that are strictly equivalent to given Boolean functions.Stars
structuredllm/itergenCFG generation and backtracking to handle semantic constraintsStars
epfl-dlab/jsonschemabenchA benchmarking framework for evaluating constrained decoding engines on JSON Schema. Supports Guidance, Outlines, XGrammar, OpenAI and more.Stars
grammarllmLLprefix, DPDAStars

Disclaimer:

  • The libraries listed above are not exhaustive and are subject to change.
  • The features mentioned are 100% not exhaustive and I strongly recommend checking the respective repositories for more details.
  • The libraries are listed by the Github stars
  • If you are the author of a library and would like to add or update the information, please open an issue or submit a pull request.

Papers

Papers with are newly added papers (not necessarily newly published papers).

Constrained Decoding for Autoregressive Models

DatePaperPublication
2026-01Thinking Before Constraining: A Unified Decoding Framework for Large Language ModelsPreprint
2025-07Grammar-Constrained Decoding Makes Large Language Models Better Logical ParsersACL
2025-07GRAMMAR-LLM: Grammar-Constrained Natural Language GenerationACL Findings
2025-07Pre3: Enabling Deterministic Pushdown Automata for Faster Structured LLM GenerationACL
2025-07Syntactic Control of Language Models by Posterior InferenceACL Findings
2025-06Earley-Driven Dynamic Pruning for Efficient Structured DecodingICML
2025-05Fast Controlled Generation from Language Models with Adaptive Weighted Rejection SamplingPreprint
2025-05Syntactic and Semantic Control of Large Language Models via Sequential Monte CarloICLR
2025-04Efficient and Asymptotically Unbiased Constrained Decoding for Large Language ModelsAISTATS
2025-02CRANE: Reasoning with constrained LLM generationICML
2025-05Type-Constrained Code Generation with Language ModelsPLDI
2025-02Lost in Space: Optimizing Tokens for Grammar-Constrained DecodingPreprint
2025-02Think Inside the JSON: Reinforcement Strategy for Strict LLM Schema AdherencePreprint
2025-02Flexible and Efficient Grammar-Constrained DecodingPreprint
2025-01Circuit Transformer: A Transformer That Preserves Logical EquivalenceICLR
2025-01Generating Structured Outputs from Language Models: Benchmark and StudiesPreprint
2024-11XGRAMMAR: FLEXIBLE AND EFFICIENT STRUCTURED GENERATION ENGINE FOR LARGE LANGUAGE MODELSPreprint
2024-10IterGen: Iterative Semantic-aware Structured LLM Generation with BacktrackingICLR
2024-08Let Me Speak Freely? A Study on the Impact of Format Restrictions on Performance of Large Language ModelsPreprint
2024-08FANTAstic SEquences and Where to Find Them: Faithful and Efficient API Call Generation through State-tracked Constrained Decoding and RerankingPreprint
2024-07Automata-based constraints for language model decodingCoLM
2024-06Sketch-Guided Constrained Decoding for Boosting Blackbox Large Language Models without Logit AccessACL
2024-05Grammar-Aligned DecodingPreprint
2024-03SynCode: LLM Generation with Grammar AugmentationPreprint
2024-03Guiding LLMs The Right Way: Fast, Non-Invasive Constrained GenerationICML
2024-02Constrained Decoding for Cross-lingual Label ProjectionICLR
2024-02Constrained Decoding for Code Language Models via Efficient Left and Right Quotienting of Context-Sensitive GrammarsPreprint
2024-02Formal-LLM: Integrating Formal Language and Natural Language for Controllable LLM-based AgentsPreprint
2023-12SGLang: Efficient Execution of Structured Language Model ProgramsPreprint
2023-12Monitor-Guided Decoding of Code LMs with Static Analysis of Repository ContextNeurIPS
2023-11Prompt Sketching for Large Language ModelsPreprint
2023-11Sequential Monte Carlo Steering of Large Language Models using Probabilistic ProgramsPADL
2023-10Don't Fine-Tune, Decode: Syntax Error-Free Tool Use via Constrained DecodingPreprint
2023-10Amortizing intractable inference in large language modelsICLR
2023-10Terminology-Aware Translation with Constrained Decoding and Large Language Model PromptingEMNLP
2023-10KCTS: Knowledge-Constrained Tree Search Decoding with Token-Level Hallucination DetectionEMNLP
2023-10Lazy-k Decoding: Constrained Decoding for Information ExtractionEMNLP
2023-07Efficient Guided Generation for Large Language ModelsPreprint
2023-06Grammar Prompting for Domain-Specific Language Generation with Large Language ModelsNeurIPS
2023-06Grammar-Constrained Decoding for Structured NLP Tasks without FinetuningEMNLP
2023-06Prompting Is Programming: A Query Language for Large Language ModelsPLDI
2023-05Measuring and Mitigating Constraint Violations of In-Context Learning for Utterance-to-API Semantic ParsingEMNLP Findings
2023-04Tractable Control for Autoregressive Language GenerationICML
2022-11Validating Large Language Models with ReLMMLSys
2022-11CodePAD: Sequence-based Code Generation with Pushdown AutomatonISSTA
2022-05Controllable Text Generation with Neurally-Decomposed OracleNeurIPS
2022-05Gradient-Based Constrained Sampling from Language ModelsEMNLP
2022-02COLD Decoding: Energy-based Constrained Text Generation with Langevin DynamicsNeurIPS
2022-01Synchromesh: Reliable code generation from pre-trained language modelsICLR
2021-12PICARD: Parsing Incrementally for Constrained Auto-Regressive Decoding from Language ModelsEMNLP
2021-12Constrained Language Models Yield Few-Shot Semantic ParsersEMNLP
2021-12Controlled Text Generation as Continuous Optimization with Multiple ConstraintsNeurIPS
2021-06NEUROLOGIC DECODING:(Un)supervised Neural Text Generation with Predicate Logic ConstraintsNAACL
2019-05A General-Purpose Algorithm for Constrained Sequential InferenceCoNLL
2019-05Improved Lexically Constrained Decoding for Translation and Monolingual RewritingNAACL
2018-09CGMH: Constrained Sentence Generation by Metropolis-Hastings SamplingAAAI
2018-05Fast Lexically Constrained Decoding with Dynamic Beam Allocation for Neural Machine TranslationNAACL
2018-04Incorporating Discriminator in Sentence Generation: a Gibbs Sampling MethodAAAI
2017-12Guided Open Vocabulary Image Captioning with Constrained Beam SearchEMNLP
2017-06Lexically Constrained Decoding for Sequence Generation Using Grid Beam SearchACL

Constrained Decoding for Diffusion Models

Benchmark & Datasets & Evaluation

Survey

Blog Posts

Many of the blogs are written by Outlines team, many thanks to them for their great work! ❤️

Disclaimer

This list is not exhaustive and will be updated regularly. If you have any suggestions or want to add a paper, please feel free to open an issue or submit a pull request. We hope to include all relevant papers in this list.

Contributing

Contributions are welcome! Feel free to submit a pull request or open an issue. Please make sure to read the Contributing Guidelines before contributing.

Contributors

Saibo-creator

58 commits

tarsur909

3 commits

shubhamugare

2 commits

nielstron

2 commits