Guiding LLMs The Right Way: Fast, Non-Invasive Constrained Generation
Luca Beurer-Kellner, Marc Fischer, Martin T. Vechev
摘要
To ensure that text generated by large language models (LLMs) is in an expected format, constrained decoding proposes to enforce strict formal language constraints during generation. However, as we show in this work, not only do such methods incur performance overhead during generation, but many of them also significantly impair task accuracy, if they do not correctly align the underlying LLM sub-word vocabularies with external constraints. To address this, we present a novel decoding algorithm, DOMINO, that can enforce constraints in a fully subword-aligned fashion, while leveraging pre-computation and speculative decoding to achieve virtually no overhead and in some cases even almost 2 speedup over unconstrained decoding -- thereby outperforming existing approaches by a wide margin.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 26 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Sampling from Your Language Model One Byte at a Time 引用了 Language Models are Few-Shot Learners
- Type-Constrained Code Generation with Language Models 引用了 Language Models are Few-Shot Learners
- Type-Constrained Code Generation with Language Models 引用了 Prompting Is Programming: A Query Language for Large Language Models
- Constrained Decoding of Diffusion LLMs with Context-Free Grammars 引用了 Type-Constrained Code Generation with Language Models
- Constrained Decoding of Diffusion LLMs with Context-Free Grammars 引用了 Language Models are Few-Shot Learners
- Reliable Text-to-SQL with Adaptive Abstention 引用了 Language Models are Few-Shot Learners
- Prompting Is Programming: A Query Language for Large Language Models 引用了 Language Models are Few-Shot Learners
引用它的顶会 Paper26
- Constrained Decoding of Diffusion LLMs with Context-Free GrammarsNiels Mündler, Jasper Dekoninck, Martin VechevICLR 2026 · 18 次引用
- Type-Constrained Code Generation with Language ModelsNiels Mündler, Jingxuan He, Hao Wang, Koushik Sen 等PLDI 2025 · 10 次引用
- Sampling from Your Language Model One Byte at a TimeJonathan Hayase, Alisa Liu, Noah Smith, Sewoong OhICML 2026 · 9 次引用
- Reliable Text-to-SQL with Adaptive AbstentionKaiwen Chen, Yueting Chen, Nick Koudas, Xiaohui YuSIGMOD 2025 · 9 次引用
- Decoupling Task-Solving and Output Formatting in LLM GenerationHaikang Deng, Po-Nien Kung, Nanyun PengACL 2026 · 8 次引用
它引用的 Paper3
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 64,255 次引用
- Prompting Is Programming: A Query Language for Large Language ModelsLuca Beurer-Kellner, Marc Fischer, Martin T. VechevPLDI 2023 · 114 次引用
- Grammar-Constrained Decoding for Structured NLP Tasks without FinetuningSaibo Geng, Martin Josifoski, Maxime Peyrard, Robert WestEMNLP 2023 · 33 次引用
相关 Paper
- Flexible and Efficient Grammar-Constrained DecodingKanghee Park, Timothy Zhou, Loris D'AntoniICML 2025
- Grammar-Aligned DecodingKanghee Park, Jiayu Wang, Taylor Berg-Kirkpatrick, Nadia Polikarpova 等NeurIPS 2024 · 73 次引用
- Lookahead-Then-Verify: Reliable Constrained Decoding for Diffusion LLMs under Context-Free GrammarsYitong Zhang, Yongmin Li, Yuetong Liu, Jia Li 等ISSTA 2026
- Approximately Aligned DecodingDaniel Melcer, Sujan Kumar Gonugondla, Pramuditha Perera, Haifeng Qian 等NeurIPS 2025 · 3 次引用
- Earley-Driven Dynamic Pruning for Efficient Structured DecodingXintong Sun, Chi Wei, Minghao Tian, Shiwen NiICML 2025
