mlsanityData to 7 Oct 2026

Earley-Driven Dynamic Pruning for Efficient Structured Decoding

arXiv 2506.01151 ↗First posted 1 Jun 2025cs.LG cs.AI cs.CLcited by 3

Not on the map. Why?

Abstract (arXiv)

Large Language Models (LLMs) have shown remarkable capabilities, yet ensuring their outputs conform to strict structural or grammatical constraints remains challenging, which is critical in function calls and domain-specific language (DSL) generation. Constrained decoding with context-free grammar is a flexible approach to guarantee LLMs' adherence to a specific format by dynamically building a token logits mask. However, creating this mask requires checking the validity of all tokens in the LLM vocabulary at every decoding step, which often incurs significant overheads in existing constrained decoding engines. To address this challenge, we propose ZapFormat, a novel dynamic pruning strategy based on the Earley algorithm that identifies and eliminates invalid or redundant Earley states in real-time, significantly reducing memory occupation of the Earley algorithm's states. This further enables us to use a state cache to speed up structured generations on a large number of queries. We implemented ZapFormat in a new constrained decoding engine called Formatron which also incorporates existing optimizations. Through comprehensive experiments on structured generation tasks, including JSON generation, JSON Schema validation, and semantic parsing, we demonstrate that Formatron not only consistently maintains high-precision compliant outputs but also achieves significant improvements in inference speed up to 2x compared to state-of-the-art implementations. More importantly, Formatron is generally applicable across various LLM architectures. We release Formatron as open source at https://github.com/Dan-wanna-M/formatron.

Key facts. Cited by 3 papers in the map (data through 7 Oct 2026). Builds on 19 of its 35 references that are in the map. First posted on arXiv 1 Jun 2025.

Builds on

19 of 35 references.

References · 19

  1. 2024The Llama 3 Herd of Modelscited by 14,192
  2. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  3. 2024Qwen2.5 Technical Reportcited by 4,713
  4. 2023Mistral 7Bcited by 3,065
  5. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
  6. 2023LLM+P: Empowering Large Language Models with Optimal Planning Proficiencycited by 496
  7. 2021PICARD: Parsing Incrementally for Constrained Auto-Regressive Decoding from Language Modelscited by 402
  8. 2023Grammar-Constrained Decoding for Structured NLP Tasks without Finetuningcited by 186
  9. 2021Constrained Language Models Yield Few-Shot Semantic Parserscited by 162
  10. 2022Synchromesh: Reliable code generation from pre-trained language modelscited by 156
  11. 2019Neural Machine Translation with Byte-Level Subwordscited by 115
  12. 2022Prompting Is Programming: A Query Language for Large Language Modelscited by 110
7 more
  1. 2024Guiding LLMs The Right Way: Fast, Non-Invasive Constrained Generationcited by 99
  2. 2024Automata-based constraints for language model decodingcited by 49
  3. 2022Validating Large Language Models with ReLMcited by 33
  4. 2022BenchCLAMP: A Benchmark for Evaluating Language Models on Syntactic and Semantic Parsingcited by 12
  5. 2022The Whole Truth and Nothing But the Truth: Faithful and Controllable Dialogue Response Generation with Dataflow Transduction and Constrained Decodingcited by 7
  6. 2023Efficient Semiring-Weighted Earley Parsingcited by 3
  7. 2024Sketch: A Toolkit for Streamlining LLM Operationscited by 3

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2026: 3.

3 papers.