paper-with-me

홈 › Papers

Flexible and Efficient Grammar-Constrained Decoding

2025-02-07 · Kanghee Park, Timothy Zhou, Loris D'Antoni

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.

📄 PDF Abstract BibTeX arXiv:2502.05111

Code (0)

등록된 구현이 없습니다.

Methods 이 논문이 사용한 방법론

ALIGN In the ALIGN method, visual and language representations are jointly trained from noisy image alt-text data. The image and text encoders are learned via contrastive loss…

Similar Papers 제목 키워드 기반

XGrammar: Flexible and Efficient Structured Generation Engine for Large Language Models

2024-11-22 · Yixin Dong, Charlie F. Ruan, Yaxing Cai, Ruihang Lai 외

The applications of LLM Agents are becoming increasingly complex and diverse, leading to a high demand for structured outputs that can be parsed into code, structured function calls, and embodied agent commands. These de…

GPU

Grammar-Aligned Decoding

2024-05-31 · Kanghee Park, Jiayu Wang, Taylor Berg-Kirkpatrick, Nadia Polikarpova 외

Large Language Models (LLMs) struggle with reliably generating highly structured outputs, such as program code, mathematical formulas, or well-formed markup. Constrained decoding approaches mitigate this problem by greed…

Code Generation

Accelerating Constrained Decoding with Token Space Compression

2026-05-28 · Michael Sullivan, Alexander Koller arxiv

To guarantee that an LLM's outputs conform to a specified structure, context-free grammar (CFG) decoding engines force the selection of next tokens that produce strings that conform to a given CFG. While current CFG-cons…

Grammar-Constrained Decoding for Structured NLP Tasks without Finetuning

2023-05-23 · Saibo Geng, Martin Josifoski, Maxime Peyrard, Robert West

Despite their impressive performance, large language models (LMs) still struggle with reliably generating complex output structures when not finetuned to follow the required output format exactly. To address this issue, …

Code GenerationConstituency ParsingEntity Disambiguationvalid

CRANE: Reasoning with constrained LLM generation

2025-02-13 · Debangshu Banerjee, Tarun Suresh, Shubham Ugare, Sasa Misailovic 외

Code generation, symbolic math reasoning, and other tasks require LLMs to produce outputs that are both syntactically and semantically correct. Constrained LLM generation is a promising direction to enforce adherence to …

Code GenerationMathvalid